diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index 2b8b25b1ed..c6a6d192f6 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -352,6 +352,23 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc end end end + + -- Punch End Crystals to make them explode + if ent and ent.name == "mcl_end:crystal" then + if direct then + local puncher = direct:get_luaentity() + if puncher and puncher.name == "mcl_end:crystal" then + ent.object:punch(direct, 1.0, { -- End Crystal nearby, trigger it. + full_punch_interval = 1.0, + damage_groups = {fleshy = 1}, + }, nil, nil) + else + ent.object:remove() -- Direct Exists, but it is not an end crystal, remove crystal. + end + else + ent.object:remove() -- Node exploded the end crystal, remove it. + end + end end local airs, fires = {}, {} diff --git a/mods/ITEMS/mcl_end/end_crystal.lua b/mods/ITEMS/mcl_end/end_crystal.lua index b7882a155d..78fe658b4b 100644 --- a/mods/ITEMS/mcl_end/end_crystal.lua +++ b/mods/ITEMS/mcl_end/end_crystal.lua @@ -40,8 +40,8 @@ local function crystal_explode(self, puncher) mcl_damage.finish_reason(reason) source = reason.source end - mcl_explosions.explode(vector.add(self.object:get_pos(), {x = 0, y = 1.5, z = 0}), strength, {drop_chance = 1}, self.object, source) minetest.after(0, self.object.remove, self.object) + mcl_explosions.explode(vector.add(self.object:get_pos(), {x = 0, y = 1.5, z = 0}), strength, {drop_chance = 1}, self.object, source) end local function set_crystal_animation(self)