From 23c438f427be1c200e08c11cb8cd16d94e327d2b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 27 May 2017 15:37:15 +0200 Subject: [PATCH] Re-enable item falling after being in unloaded --- mods/ENTITIES/mcl_item_entity/init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index c59dcf7103..05b53777b0 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -375,13 +375,19 @@ core.register_entity(":__builtin:item", { local p = self.object:getpos() local node = core.get_node_or_nil(p) local in_unloaded = (node == nil) - if in_unloaded then + if in_unloaded and self.physical_state == true then -- Don't infinetly fall into unloaded map self.object:setvelocity({x = 0, y = 0, z = 0}) self.object:setacceleration({x = 0, y = 0, z = 0}) self.physical_state = false self.object:set_properties({physical = false}) return + elseif self.physical_state == false then + -- Start falling again if map has been loaded again + self.object:setacceleration({x = 0, y = -get_gravity(), z = 0}) + self.physical_state = true + self.object:set_properties({physical = true}) + return end -- Destroy item in lava or special nodes