05-06-2015, 10:14 AM
(This post was last modified: 05-06-2015, 10:15 AM by DiamondToaster.)
(05-06-2015, 10:01 AM)Shadowraix Wrote:(05-06-2015, 09:43 AM)DiamondToaster Wrote: Also, the LuaJIT hack I put together seems to be very circumstantial. It seems to provide a noticeable boost for ARM HF platforms, but the performance increase is mucl lower on a poorly optimized bin (x86). It actually seems to be a bit better using -ofast MinGW x64.
Thebplugin interface is actually very flexible, I have made several completely different examples of plugins with the current API, ranging from a void generator to a very large plugin recreating Super Smash Bros. implementing most of the game's original features, including a sound pack. The API is also super easy to learn, fairly well documented, and if it isn't yet documented, the function names are obvious, so it shouldn't be too hard to figure out.
Thanks for the information DiamondToaster! The API does seem fairly easy which is why I enjoy Lua. It's just easy and simple.
Oh, by the way, can I structure my plugins in any fashion I want? As in having folders inside the main plugin folder?
Definitely, using the API, you can create subdirectories and write files/configs within the plugin folder. The root directory is the MCServer executable. I do this by using the Plugin object that is passed when using the Initialize function at the start of the plugin.
PluginFolder = "" ConfigFolder = "" function Initialize(Plugin) Plugin:SetName("SomeName") Plugin:SetVersion(1) -- Returns "Plugins/<Name of Plugin Folder>" PluginFolder = Plugin:GetLocalFolder() -- Append /config to the end. For example, the final result will be -- Plugins/SomePlugin/config (depending on the name of the plugin main folder) ConfigFolder = PluginFolder .. "/config" -- If the folder does not exist, then create one if not cFile:IsFolder(ConfigFolder) then LOG("Config folder does not exist! Creating directory *config*...") cFile:CreateFolder(ConfigFolder) end LOG("Initialized " .. Plugin:GetName() .. " v0." .. tostring(Plugin:GetVersion())) return true end