summaryrefslogtreecommitdiffstats
path: root/cwd/assets/altcraft/scripts/init.lua
blob: 21374642a28cc937b1c19fd28d005522c7f7d171 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
local plugin = {
	name = 'altcraft',
	displayName = "AltCraft Core Plugin",
	onLoad = nil,
	onUnload = nil,
	onChangeState = nil,
	onTick = 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() then
		local player = AC.GetGameState():GetPlayer()
		player.pos.x = player.pos.x + deltaTime * 0.5
	end
end

AC.RegisterPlugin(plugin)
plugin = nil