From fd05259202250dceb547a1f9bf11d391d7daafab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Fri, 17 Apr 2020 20:36:39 +0200 Subject: [PATCH] Make TNT and TNT Minecart use the explosions API The old api from mcl_tnt is still left in the code, and used by the mobs. --- mods/ENTITIES/mcl_minecarts/depends.txt | 1 + mods/ENTITIES/mcl_minecarts/init.lua | 4 ++-- mods/ITEMS/mcl_tnt/depends.txt | 1 + mods/ITEMS/mcl_tnt/init.lua | 3 +-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/ENTITIES/mcl_minecarts/depends.txt b/mods/ENTITIES/mcl_minecarts/depends.txt index 51e65fb89..cdf7feb54 100644 --- a/mods/ENTITIES/mcl_minecarts/depends.txt +++ b/mods/ENTITIES/mcl_minecarts/depends.txt @@ -1,3 +1,4 @@ +mcl_explosions mcl_core mcl_sounds mcl_player diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index 14f70d246..3aa1ec4ca 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -206,7 +206,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o -- Explode if already ignited if self._boomtimer then self.object:remove() - tnt.boom(pos) + mcl_explosions.explode(pos, 4, { drop_chance = 1.0 }) return end @@ -249,7 +249,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o local pos = self.object:get_pos() if self._boomtimer <= 0 then self.object:remove() - tnt.boom(pos) + mcl_explosions.explode(pos, 4, { drop_chance = 1.0 }) return else tnt.smoke_step(pos) diff --git a/mods/ITEMS/mcl_tnt/depends.txt b/mods/ITEMS/mcl_tnt/depends.txt index 548dace5d..e4c208ea6 100644 --- a/mods/ITEMS/mcl_tnt/depends.txt +++ b/mods/ITEMS/mcl_tnt/depends.txt @@ -1,3 +1,4 @@ +mcl_explosions mcl_sounds? mcl_mobitems? mcl_death_messages? diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index ed47f6973..5f53afaf8 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -104,7 +104,6 @@ minetest.register_node("mcl_tnt:tnt", { groups = { dig_immediate = 3, tnt = 1, enderman_takable=1 }, mesecons = tnt_mesecons, on_blast = function(pos) - minetest.chat_send_all("on_blast " .. minetest.pos_to_string(pos)) spawn_tnt(pos, "mcl_tnt:tnt") return true end, @@ -209,7 +208,7 @@ function TNT:on_step(dtime) self.blinkstatus = not self.blinkstatus end if self.timer > tnt.BOOMTIMER then - tnt.boom(self.object:get_pos(), nil, self.object) + mcl_explosions.explode(self.object:get_pos(), 4, { drop_chance = 1.0 }) self.object:remove() end end