From 0eb5854067f9b1cda0c26eeb2eb4630f3b314dcb Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 2 Apr 2021 11:08:37 +0100 Subject: [PATCH] check for real_torch mod and disable built-in torch drop function --- lucky_block.lua | 1 + water.lua | 24 +++++++----------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/lucky_block.lua b/lucky_block.lua index 9d9d125..7281666 100644 --- a/lucky_block.lua +++ b/lucky_block.lua @@ -91,6 +91,7 @@ lucky_block:add_blocks({ {name = "ethereal:fishing_rod", max = 1}, {name = "ethereal:worm", max = 10}, }}, + {"dro", {"ethereal:lemon"}, 9}, }) if minetest.get_modpath("3d_armor") then diff --git a/water.lua b/water.lua index ed4f4d3..ed37626 100644 --- a/water.lua +++ b/water.lua @@ -127,21 +127,12 @@ minetest.register_abm({ end, }) --- If torch touching water then drop as item (when enabled) -if ethereal.torchdrop == true then - -local torch_drop = "default:torch" -local drop_sound = "fire_extinguish_flame" - -if minetest.get_modpath("real_torch") then - torch_drop = "real_torch:torch" - drop_sound = "real_torch_extinguish" -end +-- when enabled, drop torches that are touching water +if ethereal.torchdrop == true and not minetest.get_modpath("real_torch") then minetest.register_abm({ label = "Ethereal drop torch", - nodenames = {"default:torch", "default:torch_wall", "default:torch_ceiling", - "real_torch:torch", "real_torch:torch_wall", "real_torch:torch_ceiling"}, + nodenames = {"default:torch", "default:torch_wall", "default:torch_ceiling"}, neighbors = {"group:water"}, interval = 5, chance = 1, @@ -171,12 +162,11 @@ minetest.register_abm({ minetest.set_node(pos, {name = "air"}) - minetest.sound_play({name = drop_sound, gain = 0.2}, - {pos = pos, max_hear_distance = 10}) + minetest.sound_play("fire_extinguish_flame", + {pos = pos, gain = 0.2, max_hear_distance = 10}) - minetest.add_item(pos, {name = torch_drop}) + minetest.add_item(pos, {name = "default:torch"}) end - end, + end }) - end