Closed GnaspGames closed 8 years ago
I Did not know how plugins worked before. But this way you can easily transfer data from smelt to the plugin. It's looks easy to work with and responsive (if that is the right term).
smelt object now has: getVariable()
, setVariable()
and settings
property. See edited first post.
Support work for issue #12 - required changes to how plugins work so that additional data can be sent to plugins in the future.
Example of a plugin now:
Each plugin should implement an
Execute()
function and anInstall()
function.Execute()
takes the place of the old approach.By passing a single
smelt
object into these methods, it means that new properties and methods can be added more easily in the future. Affording backwards compatibility for the existing approach.The new
Install()
function will be used to register any support modules that the map maker should install into their world. By separating this out, we can add a call to this function by itself in other situations, such as when the plugin is installed, or if the command is implement to just give us the support module for a plugin.Building on top of this; I intend to add properties to the
smelt
object passed to plugins so that contextual data is available, such as what the previous command block was, the coordinates relative to the corner of the module, or relative to the next command block.