From 8b23388d63ed377eabb93ac50a4c94ec3d3d8921 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Thu, 22 Apr 2021 13:22:20 +0200 Subject: [PATCH] Fix #1590 (Bed drops itself when gets exploded) --- mods/ITEMS/mcl_beds/functions.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index 86f6a6852..f3824a6f3 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -301,7 +301,11 @@ function mcl_beds.on_rightclick(pos, player, is_top) local dim = mcl_worlds.pos_to_dimension(pos) if dim == "nether" or dim == "end" then -- Bed goes BOOM in the Nether or End. + local node = minetest.get_node(pos) + local dir = minetest.facedir_to_dir(node.param2) + minetest.remove_node(pos) + minetest.remove_node(string.sub(node.name, -4) == "_top" and vector.subtract(pos, dir) or vector.add(pos, dir)) if explosions_mod then mcl_explosions.explode(pos, 5, {drop_chance = 1.0, fire = true}) end