From 8d9c5059f3aa8fc6e83a58ceb85808ce362fa207 Mon Sep 17 00:00:00 2001 From: cora Date: Tue, 12 Jul 2022 23:03:52 +0200 Subject: [PATCH] Fix wither dupe faulty on_place would not removed placed wither skelly head from inv. This also prevents the execution of the schematic checking routine if there is no soul sand under the head. --- mods/ENTITIES/mcl_wither_spawning/init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_wither_spawning/init.lua b/mods/ENTITIES/mcl_wither_spawning/init.lua index 2f1d744d8..a8f7f108d 100644 --- a/mods/ENTITIES/mcl_wither_spawning/init.lua +++ b/mods/ENTITIES/mcl_wither_spawning/init.lua @@ -46,6 +46,9 @@ end local wither_head = minetest.registered_nodes["mcl_heads:wither_skeleton"] local old_on_place = wither_head.on_place function wither_head.on_place(itemstack, placer, pointed) - minetest.after(0, wither_spawn, pointed.above) - old_on_place(itemstack, placer, pointed) + local n = minetest.get_node(vector.offset(pointed.above,0,-1,0)) + if n and n.name == "mcl_nether:soul_sand" then + minetest.after(0, wither_spawn, pointed.above) + end + return old_on_place(itemstack, placer, pointed) end