]> git.lizzy.rs Git - Crafter.git/blobdiff - mods/utility/chest.lua
remove server debug
[Crafter.git] / mods / utility / chest.lua
index e61d404e9efd2d8f2cc2146c9e0f50f58bfd633e..cdf8718ca3155631c3c192a67b1c5f2918289f87 100644 (file)
@@ -8,7 +8,7 @@ function chest.get_chest_formspec(pos)
                "background[-0.19,-0.25;9.41,9.49;gui_hb_bg.png]"..
                "list[nodemeta:" .. spos .. ";main;0,0.3;9,4;]" ..
                "list[current_player;main;0,4.5;9,1;]" ..
-               "list[current_player;main;0,6.08;9,3;8]" ..
+               "list[current_player;main;0,6.08;9,3;9]" ..
                "listring[nodemeta:" .. spos .. ";main]" ..
                "listring[current_player;main]" --..
                --default.get_hotbar_bg(0,4.85)
@@ -34,6 +34,7 @@ function chest.chest_lid_close(pn)
                        minetest.swap_node(pos,{name = "utility:"..swap,param2=node.param2})
                        minetest.sound_play(sound, {gain = 0.3, pos = pos, max_hear_distance = 10},true)
                end
+               redstone.collect_info(pos)
        end,pos,swap,node)
 end
 
@@ -132,6 +133,7 @@ function chest.register_chest(name, d)
                         minetest.show_formspec(clicker:get_player_name(),"utility:chest", chest.get_chest_formspec(pos))
                        chest.open_chests[clicker:get_player_name()] = { pos = pos,
                                        sound = def.sound_close, swap = name }
+                       
                end
                def.on_blast = function() end
                def.on_key_use = function(pos, player)
@@ -195,6 +197,7 @@ function chest.register_chest(name, d)
                                
                        minetest.show_formspec(clicker:get_player_name(),"utility:chest", chest.get_chest_formspec(pos))
                        chest.open_chests[clicker:get_player_name()] = { pos = pos,sound = def.sound_close, swap = name }
+                       redstone.collect_info(pos)
                end
                def.on_blast = function(pos)
                        local drops = {}
@@ -259,9 +262,9 @@ chest.register_chest("chest", {
 minetest.register_craft({
        output = "utility:chest",
        recipe = {
-               {"group:wood", "group:wood", "group:wood"},
-               {"group:wood", "",                          "group:wood"},
-               {"group:wood", "group:wood", "group:wood"},
+               {"main:wood", "main:wood", "main:wood"},
+               {"main:wood", "",          "main:wood"},
+               {"main:wood", "main:wood", "main:wood"},
        }
 })
 
@@ -271,3 +274,11 @@ minetest.register_craft({
        recipe = "utility:chest",
        burntime = 5,
 })
+
+
+local groups = minetest.registered_nodes["utility:chest_open"].groups
+groups["redstone_torch"]=1
+groups["redstone_power"]=9
+minetest.override_item("utility:chest_open", {
+       groups = groups 
+})