]> git.lizzy.rs Git - dragonfireclient.git/blob - clientmods/preview/init.lua
91b12d81047c9dd8bdad958a8d878765426adcd4
[dragonfireclient.git] / clientmods / preview / init.lua
1 local modname = core.get_current_modname() or "??"
2
3 -- This is an example function to ensure it's working properly, should be removed before merge
4 core.register_on_shutdown(function()
5         print("[PREVIEW] shutdown client")
6 end)
7
8 -- This is an example function to ensure it's working properly, should be removed before merge
9 core.register_on_receiving_chat_messages(function(message)
10         print("[PREVIEW] Received message " .. message)
11         return false
12 end)
13
14 -- This is an example function to ensure it's working properly, should be removed before merge
15 core.register_on_sending_chat_messages(function(message)
16         print("[PREVIEW] Sending message " .. message)
17         return false
18 end)
19
20 -- This is an example function to ensure it's working properly, should be removed before merge
21 core.register_on_hp_modification(function(hp)
22         print("[PREVIEW] HP modified " .. hp)
23 end)
24
25 -- This is an example function to ensure it's working properly, should be removed before merge
26 core.register_on_damage_taken(function(hp)
27         print("[PREVIEW] Damage taken " .. hp)
28 end)
29
30 -- This is an example function to ensure it's working properly, should be removed before merge
31 core.register_globalstep(function(dtime)
32         -- print("[PREVIEW] globalstep " .. dtime)
33 end)
34
35 -- This is an example function to ensure it's working properly, should be removed before merge
36 core.register_chatcommand("dump", {
37         func = function(param)
38                 return true, dump(_G)
39         end,
40 })
41
42 core.register_chatcommand("test_node", {
43         func = function(param)
44                 core.display_chat_message(dump(core.get_node({x=0, y=0, z=0})))
45                 core.display_chat_message(dump(core.get_node_or_nil({x=0, y=0, z=0})))
46         end,
47 })
48
49
50 core.after(2, function()
51         print("[PREVIEW] loaded " .. modname .. " mod")
52 end)
53
54 core.register_on_dignode(function(pos, node)
55         print("pos:" .. dump(pos))
56         print("node:" .. dump(node))
57         return false
58 end)