From a2fd708de4ede7427589125e680f3fb339926f4e Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sun, 17 Feb 2019 21:24:52 +0500 Subject: Refactored lua-api --- cwd/assets/altcraft/scripts/init.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'cwd') diff --git a/cwd/assets/altcraft/scripts/init.lua b/cwd/assets/altcraft/scripts/init.lua index d48ecd0..5fd9e11 100644 --- a/cwd/assets/altcraft/scripts/init.lua +++ b/cwd/assets/altcraft/scripts/init.lua @@ -1,12 +1,17 @@ -plug = { +local plugin = { name = 'altcraft', displayName = "AltCraft Core Plugin", onLoad = nil, onUnload = nil, + onChangeState = nil, } -function plug:onLoad () - print("Loaded "..self.name.."-plugin!") +function plugin.onLoad () + print("Loaded AltCraft plugin!") end -AC:RegisterPlugin(plug) \ No newline at end of file +function plugin.onChangeState (newState) + AC:LogWarning("New state: "..newState) +end + +AC:RegisterPlugin(plugin) \ No newline at end of file -- cgit v1.2.3