From 21992dc2653616db974ebfc6f0c48e436592fa34 Mon Sep 17 00:00:00 2001 From: NO11 Date: Sat, 3 Jul 2021 12:10:32 +0000 Subject: [PATCH] Fix #1746 (make anvils destroy items when falling) --- mods/ITEMS/mcl_anvils/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index fbf6fb751..e641183de 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -276,6 +276,12 @@ local function damage_anvil_by_using(pos) end local function damage_anvil_by_falling(pos, distance) + for _,object in pairs(minetest.get_objects_inside_radius(pos, 0.8)) do + local entity = object:get_luaentity() + if not object:is_player() and entity and entity.name == "__builtin:item" then + object:remove() + end + end local r = math.random(1, 100) if distance > 1 then if r <= (5*distance) then