From 083b285f4319c470f307f0b52f03a2fb68facd38 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 26 May 2020 00:17:52 +0200 Subject: =?UTF-8?q?Rename=20=E2=80=9CMinimal=20development=20test=E2=80=9D?= =?UTF-8?q?=20to=20=E2=80=9CDevelopment=20Test=E2=80=9D=20(#9928)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- games/devtest/mods/chest/init.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 games/devtest/mods/chest/init.lua (limited to 'games/devtest/mods/chest/init.lua') diff --git a/games/devtest/mods/chest/init.lua b/games/devtest/mods/chest/init.lua new file mode 100644 index 000000000..c44522cb9 --- /dev/null +++ b/games/devtest/mods/chest/init.lua @@ -0,0 +1,27 @@ +minetest.register_node("chest:chest", { + description = "Chest", + tiles ={"chest_chest.png^[sheet:2x2:0,0", "chest_chest.png^[sheet:2x2:0,0", + "chest_chest.png^[sheet:2x2:1,0", "chest_chest.png^[sheet:2x2:1,0", + "chest_chest.png^[sheet:2x2:1,0", "chest_chest.png^[sheet:2x2:0,1"}, + paramtype2 = "facedir", + groups = {dig_immediate=2,choppy=3}, + is_ground_content = false, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", + "size[8,9]".. + "list[current_name;main;0,0;8,4;]".. + "list[current_player;main;0,5;8,4;]" .. + "listring[]") + meta:set_string("infotext", "Chest") + local inv = meta:get_inventory() + inv:set_size("main", 8*4) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("main") + end, +}) + + -- cgit v1.2.3