From 49f447ba645dbfb49f64d3241f35f1d8c4dffb03 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 17 Mar 2019 09:33:44 +0100 Subject: [PATCH] Fix missing depends in mcl_tnt --- mods/ITEMS/mcl_tnt/depends.txt | 1 + mods/ITEMS/mcl_tnt/init.lua | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_tnt/depends.txt b/mods/ITEMS/mcl_tnt/depends.txt index f02d2b054..548dace5d 100644 --- a/mods/ITEMS/mcl_tnt/depends.txt +++ b/mods/ITEMS/mcl_tnt/depends.txt @@ -2,3 +2,4 @@ mcl_sounds? mcl_mobitems? mcl_death_messages? doc_identifier? +mesecons? diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index 738d6b085..6fa0728fb 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -54,6 +54,13 @@ local sounds if minetest.get_modpath("mcl_sounds") then sounds = mcl_sounds.node_sound_wood_defaults() end +local tnt_mesecons +if minetest.get_modpath("mesecons") then + tnt_mesecons = {effector = { + action_on = tnt.ignite, + rules = mesecon.rules.alldirs, + }} +end minetest.register_node("mcl_tnt:tnt", { tiles = {"default_tnt_top.png", "default_tnt_bottom.png", "default_tnt_side.png", "default_tnt_side.png", @@ -66,10 +73,7 @@ minetest.register_node("mcl_tnt:tnt", { _doc_items_longdesc = S("An explosive device. When it explodes, it will hurt living beings and destroy blocks around it. TNT has an explosion radius of @1. With a small chance, blocks may drop as an item (as if being mined) rather than being destroyed. TNT can be ignited by tools, explosions, fire, lava and redstone signals.", TNT_RANGE), _doc_items_usagehelp = S("Place the TNT and ignite it with one of the methods above. Quickly get in safe distance. The TNT will start to be affected by gravity and explodes in 4 seconds."), groups = { dig_immediate = 3, tnt = 1, enderman_takable=1 }, - mesecons = {effector = { - action_on = tnt.ignite, - rules = mesecon.rules.alldirs, - }}, + mesecons = tnt_mesecons, _on_ignite = function(player, pointed_thing) tnt.ignite(pointed_thing.under) return true