diff options
Diffstat (limited to 'mods/vzxv_itemstacks/container.lua')
-rw-r--r-- | mods/vzxv_itemstacks/container.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mods/vzxv_itemstacks/container.lua b/mods/vzxv_itemstacks/container.lua index 119789b..a8fb4d9 100644 --- a/mods/vzxv_itemstacks/container.lua +++ b/mods/vzxv_itemstacks/container.lua @@ -24,6 +24,16 @@ minetest.register_entity("vzxv_itemstacks:itemstack",{ local pos = vzxv.round_pos(ent:get_pos()) container_entities[minetest.hash_node_position(pos)] = ent end, + on_step = function(self,dt) + local ent = self.object + local pos = vzxv.round_pos(ent:get_pos()) + pos.y = pos.y - 1 + if minetest.get_node(pos).name == "air" then + pos.y = pos.y + 1 + vzxv.drop_loose(pos,vzxv.get_container_stack(pos)) + minetest.set_node(pos,{name="air"}) + end + end, on_deactivate = function(self) local ent = self.object local pos = vzxv.round_pos(ent:get_pos()) |