summaryrefslogtreecommitdiff
path: root/clientmods
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-04-11 00:09:11 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2020-04-11 13:12:51 +0200
commit1292bdbbcec45613c95aff9f2ea88aa49af25011 (patch)
tree382e24bba4da9699809e1fd8088dcd4ad92de0fa /clientmods
parent5f3a17eb65c1ad9259f03bde346a8d69fe0c1069 (diff)
downloadminetest-1292bdbbcec45613c95aff9f2ea88aa49af25011.tar.gz
minetest-1292bdbbcec45613c95aff9f2ea88aa49af25011.tar.bz2
minetest-1292bdbbcec45613c95aff9f2ea88aa49af25011.zip
Various features and fixes
Diffstat (limited to 'clientmods')
-rw-r--r--clientmods/preview/init.lua40
1 files changed, 5 insertions, 35 deletions
diff --git a/clientmods/preview/init.lua b/clientmods/preview/init.lua
index 5777adcaf..d2440369a 100644
--- a/clientmods/preview/init.lua
+++ b/clientmods/preview/init.lua
@@ -31,6 +31,7 @@ core.after(4, function()
end)
core.after(1, function()
+ print("armor: " .. dump(core.localplayer:get_armor_groups()))
id = core.localplayer:hud_add({
hud_elem_type = "text",
name = "example",
@@ -125,19 +126,6 @@ core.register_chatcommand("dump", {
end,
})
-core.register_chatcommand("colorize_test", {
- func = function(param)
- return true, core.colorize("red", param)
- end,
-})
-
-core.register_chatcommand("test_node", {
- func = function(param)
- core.display_chat_message(dump(core.get_node({x=0, y=0, z=0})))
- core.display_chat_message(dump(core.get_node_or_nil({x=0, y=0, z=0})))
- end,
-})
-
local function preview_minimap()
local minimap = core.ui.minimap
if not minimap then
@@ -157,7 +145,7 @@ end
core.after(2, function()
print("[PREVIEW] loaded " .. modname .. " mod")
modstorage:set_string("current_mod", modname)
- print(modstorage:get_string("current_mod"))
+ assert(modstorage:get_string("current_mod") == modname)
preview_minimap()
end)
@@ -184,30 +172,12 @@ end)
core.register_on_punchnode(function(pos, node)
print("The local player punched a node!")
- local itemstack = core.get_wielded_item()
- --[[
- -- getters
- print(dump(itemstack:is_empty()))
- print(dump(itemstack:get_name()))
- print(dump(itemstack:get_count()))
- print(dump(itemstack:get_wear()))
- print(dump(itemstack:get_meta()))
- print(dump(itemstack:get_metadata()
- print(dump(itemstack:is_known()))
- --print(dump(itemstack:get_definition()))
- print(dump(itemstack:get_tool_capabilities()))
- print(dump(itemstack:to_string()))
- print(dump(itemstack:to_table()))
- -- setters
- print(dump(itemstack:set_name("default:dirt")))
- print(dump(itemstack:set_count("95")))
- print(dump(itemstack:set_wear(934)))
- print(dump(itemstack:get_meta()))
- print(dump(itemstack:get_metadata()))
- --]]
+ local itemstack = core.localplayer:get_wielded_item()
print(dump(itemstack:to_table()))
print("pos:" .. dump(pos))
print("node:" .. dump(node))
+ local meta = core.get_meta(pos)
+ print("punched meta: " .. (meta and dump(meta:to_table()) or "(missing)"))
return false
end)