From ea83c64feedb4ca1f67cba97b22cee73a3f442fe Mon Sep 17 00:00:00 2001 From: Alexander Weber Date: Sat, 21 Apr 2018 13:59:32 +0200 Subject: [PATCH] add infotext --- init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.lua b/init.lua index 7937c63..e1e40af 100644 --- a/init.lua +++ b/init.lua @@ -22,6 +22,7 @@ local trampoline_punch = function(pos, node) id = id + 1 if id == 7 then id = 1 end minetest.add_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id}) + minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id) end for i = 1, 6 do @@ -31,6 +32,9 @@ for i = 1, 6 do node_box = trampolinebox, selection_box = trampolinebox, paramtype = "light", + on_construct = function(pos) + minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..i) + end, on_punch = trampoline_punch, tiles = { "jumping_trampoline_top.png",