ComputerCraft Forums

ComputerCraft => Programs => Command Programs => Topic started by: hugeblank on Jan 25, 2019, 06:58 AM

Title: Allium | My second take on a Lua based MC plugin loader
Post by: hugeblank on Jan 25, 2019, 06:58 AM
Let's all flash back to around a year ago. I was one of the administrators for Kaos Network, creators of various servers including NexCore, Acora, Shinexus, and Project BETA. Project Beta 2 had been released, and was off to a moderate start. I was definitely not my best at Lua, but I had this idea to create a platform for players to interact and create plugins for Lua/CC, much like those found in Sponge and Bukkit. due to my incompetence in many things more than Lua it never took off. I had something to show though, I called it BagelBot, and I developed a plugin for it that I called BetaBot. They were terribly buggy, and not functional in every possible case. Last week I found the motivation to look back at it. After several hours of axing each and every flaw it had, I came up with this. This is
Allium (https://github.com/hugeblank/Allium).
The simple Minecraft plugin interface for Lua.
This is gonna be awesome...

Allium uses Computercraft's Command Computer, and Plethora Peripherals' Creative Chat Recorder to function. The command computer can already do many things, being a programmable command block. Allium takes that power to the next level and expands functionality to allow for plugins to be registered. From there you can add commands that get triggered by players, threads that can do command based things without the need of a command to execute them, and data that can be stored in a persistent file so that things you want to hang onto don't get lost in the event of a crash or restart.

In addition to these capabilities, communication to the has been made so much easier. With the chat text formatting API provided by roger109z (https://github.com/roger109z/), instead of having to use a bulky tellraw JSON table, all color, emphasis, and action can be implemented directly into the string using a simple prefix character '&' and then a single character.

BagelBot as aforementioned had several critical flaws. One of those was that the command listener could not listen while a command was being run, which led to several problems. Allium fixes these problems by using Raisin (https://github.com/hugeblank/raisin), my simple and flexible multi-threading API that covers what the standard parallel API can't do. I'd highly recommend checking it out, since some of the functionality of Allium is built on Raisin's API, particularly Allium's threads (naturally).

One of the greatest benefits of Allium is that it isn't bound to any specific minecraft version, or plugin loader version like all 'real' plugins are restricted to. With the advent of Fabric (http://fabric.asie.pl/) making modding a possibility in snapshots, Allium may have a niche in stable plugin programming for Lua. I have hope, but doubt it

Allium comes with a base plugin, with two functions. The first is to provide core commands to Allium, giving Allium its stem. The second is to provide a demonstration of what Allium can do. Here's a screenshot:
(https://camo.tmpim.com/c6664e95f4ae2ca0dd4960b7d7b7817fad674604/68747470733a2f2f692e696d6775722e636f6d2f434b6c52466b792e706e67)
Demonstrated here is the help menu in all its user-friendliness, the plugin list, showing all loaded plugins, and the credits command, directing users to where issues can be reported.

Installation
What you're hopefully here for

Installation is fairly simple, consisting of only one line:
pastebin run LGwrkjxm
The installer installs Apemanzilla's gitget (http://www.computercraft.info/forums2/index.php?/topic/17387-gitget-version-2-release/), a github repository downloader that is necessary to download Allium, and the plugins that you may want to be installed. Credit goes to him for creating such an easy to use tool.

Documentation
Ooo... whatcha gonna make?
All documentation is found within Allium's README (https://github.com/hugeblank/Allium/blob/master/README.md), under the API (https://github.com/hugeblank/Allium/blob/master/README.md#api) section. Directly underneath that is documentation on Formatting Codes (https://github.com/hugeblank/Allium/blob/master/README.md#formatting-codes), which if you plan on having any decent interaction with the player (you do ;p) I advise you read that. For the sake of sparing my own time, keeping things in one place, and not cluttering this post more than I already have, the documentation will stay there instead of on here.

Genuine Note
About as cool as an apology video on youtube...
Being that this has been done in Lua, CC, and things that do this without a mod exist, this definitely isn't going to pick up much traction. However people here on this forums have done some amazing things, and I think that amazing things can be done here, with Allium. Like I said earlier, Allium may have a niche in snapshot plugin programming, but that's neither here nor there and totally subject to how well received this project is.


Banter over, Enjoy! :)
~ hugeblank