aboutsummaryrefslogtreecommitdiff
path: root/games/devtest/mods/chest/init.lua
diff options
context:
space:
mode:
authorWuzzy <Wuzzy@disroot.org>2022-10-08 19:49:28 +0200
committersfan5 <sfan5@live.de>2022-10-23 21:58:56 +0200
commita23701b5e654139158ba934155ecd99c8f4b8fd7 (patch)
tree94e387f3e363661b79f3e9c0e5ec7492a7ca0565 /games/devtest/mods/chest/init.lua
parentc1e732448ca3cfc1c7e2b1a8c19b8f80ac06bd06 (diff)
downloadminetest-a23701b5e654139158ba934155ecd99c8f4b8fd7.tar.xz
DevTest: Move detached inv tests to chest mod
Diffstat (limited to 'games/devtest/mods/chest/init.lua')
-rw-r--r--games/devtest/mods/chest/init.lua42
1 files changed, 2 insertions, 40 deletions
diff --git a/games/devtest/mods/chest/init.lua b/games/devtest/mods/chest/init.lua
index 5798c13e7..cb2974c64 100644
--- a/games/devtest/mods/chest/init.lua
+++ b/games/devtest/mods/chest/init.lua
@@ -1,40 +1,2 @@
-minetest.register_node("chest:chest", {
- description = "Chest" .. "\n" ..
- "32 inventory slots",
- 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,
- allow_metadata_inventory_put = function(pos, listname, index, stack, player)
- minetest.chat_send_player(player:get_player_name(), "Allow put: " .. stack:to_string())
- return stack:get_count()
- end,
- allow_metadata_inventory_take = function(pos, listname, index, stack, player)
- minetest.chat_send_player(player:get_player_name(), "Allow take: " .. stack:to_string())
- return stack:get_count()
- end,
- on_metadata_inventory_put = function(pos, listname, index, stack, player)
- minetest.chat_send_player(player:get_player_name(), "On put: " .. stack:to_string())
- end,
- on_metadata_inventory_take = function(pos, listname, index, stack, player)
- minetest.chat_send_player(player:get_player_name(), "On take: " .. stack:to_string())
- end,
-})
+dofile(minetest.get_modpath("chest").."/chest.lua")
+dofile(minetest.get_modpath("chest").."/detached.lua")