summaryrefslogtreecommitdiffstats
path: root/cwd/assets/altcraft/scripts/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'cwd/assets/altcraft/scripts/init.lua')
-rw-r--r--cwd/assets/altcraft/scripts/init.lua44
1 files changed, 44 insertions, 0 deletions
diff --git a/cwd/assets/altcraft/scripts/init.lua b/cwd/assets/altcraft/scripts/init.lua
new file mode 100644
index 0000000..5021a00
--- /dev/null
+++ b/cwd/assets/altcraft/scripts/init.lua
@@ -0,0 +1,44 @@
+local plugin = {
+ name = 'altcraft',
+ displayName = "AltCraft Core Plugin",
+ onLoad = nil,
+ onUnload = nil,
+ onChangeState = nil,
+ onTick = nil,
+ onRequestBlockInfo = nil,
+}
+
+function plugin.onLoad ()
+ print("Loaded AltCraft plugin!")
+end
+
+function plugin.onChangeState (newState)
+ AC.LogWarning("New state: "..newState)
+end
+
+function plugin.onUnload ()
+ AC.LogInfo("AC Core unloaded")
+end
+
+function plugin.onTick (deltaTime)
+ if AC.GetGameState() and AC.GetGameState():GetPlayer() and AC.GetGameState():GetTimeStatus().worldAge > 0 then
+ -- local player = AC.GetGameState():GetPlayer()
+ -- player.pos.x = player.pos.x + deltaTime * 0.5
+
+ -- local playerPos = AC.GetGameState():GetPlayer().pos
+ -- local wrld = AC.GetGameState():GetWorld()
+ -- playerPosV = Vector.new(playerPos.x, playerPos.y - 1, playerPos.z)
+ -- bid = wrld:GetBlockId(playerPosV)
+ -- print(bid.id..":"..bid.state)
+ end
+end
+
+local blocks = require("altcraft/blocks")
+blocks.RegisterBlocks()
+
+function plugin.onRequestBlockInfo(blockPos)
+ return blocks.GetBlockInfo(blockPos)
+end
+
+AC.RegisterPlugin(plugin)
+plugin = nil \ No newline at end of file