diff --git a/mods/ITEMS/mcl_fire/fire_charge.lua b/mods/ITEMS/mcl_fire/fire_charge.lua index fbf75f18ac..9f4f6bc0fd 100644 --- a/mods/ITEMS/mcl_fire/fire_charge.lua +++ b/mods/ITEMS/mcl_fire/fire_charge.lua @@ -31,10 +31,10 @@ minetest.register_craftitem("mcl_fire:fire_charge", { if nodedef and nodedef._on_ignite then local overwrite = nodedef._on_ignite(user, pointed_thing) if not overwrite then - mcl_fire.set_fire(pointed_thing, user) + mcl_fire.set_fire(pointed_thing, user, false) end else - mcl_fire.set_fire(pointed_thing, user) + mcl_fire.set_fire(pointed_thing, user, false) end if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() diff --git a/mods/ITEMS/mcl_fire/flint_and_steel.lua b/mods/ITEMS/mcl_fire/flint_and_steel.lua index c5b1290b22..bb8c6ce734 100644 --- a/mods/ITEMS/mcl_fire/flint_and_steel.lua +++ b/mods/ITEMS/mcl_fire/flint_and_steel.lua @@ -36,10 +36,10 @@ minetest.register_tool("mcl_fire:flint_and_steel", { if nodedef and nodedef._on_ignite then local overwrite = nodedef._on_ignite(user, pointed_thing) if not overwrite then - mcl_fire.set_fire(pointed_thing, user) + mcl_fire.set_fire(pointed_thing, user, false) end else - mcl_fire.set_fire(pointed_thing, user) + mcl_fire.set_fire(pointed_thing, user, false) end used = true end diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index ca61d9a439..ff7b790266 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -395,7 +395,8 @@ end -- Set pointed_thing on (normal) fire. -- * pointed_thing: Pointed thing to ignite -- * player: Player who sets fire or nil if nobody -mcl_fire.set_fire = function(pointed_thing, player) +-- * allow_on_fire: If false, can't ignite fire on fire (default: true) +mcl_fire.set_fire = function(pointed_thing, player, allow_on_fire) local pname if player == nil then pname = "" @@ -403,6 +404,10 @@ mcl_fire.set_fire = function(pointed_thing, player) pname = player:get_player_name() end local n = minetest.get_node(pointed_thing.above) + local nu = minetest.get_node(pointed_thing.under) + if allow_on_fire == false and minetest.get_item_group(nu.name, "fire") ~= 0 then + return + end if minetest.is_protected(pointed_thing.above, pname) then minetest.record_protection_violation(pointed_thing.above, pname) return