From d55f83346e421cdae8e3e35c785427d8796dc7a0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 8 Sep 2017 15:28:38 +0200 Subject: [PATCH] Fire on bedrock in the End is now eternal --- mods/ITEMS/mcl_core/nodes_base.lua | 3 ++- mods/ITEMS/mcl_fire/depends.txt | 1 + mods/ITEMS/mcl_fire/init.lua | 18 +++++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index bf55932f2..3a2e2e802 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -553,7 +553,8 @@ minetest.register_node("mcl_core:brick_block", { minetest.register_node("mcl_core:bedrock", { description = "Bedrock", - _doc_items_longdesc = "Bedrock is a very hard type of rock. It can not be broken, destroyed, collected or moved by normal means, unless in Creative Mode.", + _doc_items_longdesc = "Bedrock is a very hard type of rock. It can not be broken, destroyed, collected or moved by normal means, unless in Creative Mode.".."\n".. + "In the End dimension, starting a fire on this block will create an eternal fire.", tiles = {"mcl_core_bedrock.png"}, stack_max = 64, groups = {creative_breakable=1, building_block=1, material_stone=1}, diff --git a/mods/ITEMS/mcl_fire/depends.txt b/mods/ITEMS/mcl_fire/depends.txt index a9b740535..3beb7648d 100644 --- a/mods/ITEMS/mcl_fire/depends.txt +++ b/mods/ITEMS/mcl_fire/depends.txt @@ -1,3 +1,4 @@ mcl_core +mcl_util mcl_sounds mcl_nether? diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index f35dbfa4d..9991dfca6 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -379,7 +379,8 @@ else -- Fire enabled end --- Spawn eternal fire when using flint and steel on netherrack or magma block +-- Spawn eternal fire when fire starts on netherrack or magma block. +-- Also on bedrock when it's in the end. local eternal_override = { after_destruct = function(pos, oldnode) @@ -399,7 +400,22 @@ local eternal_override = { end end, } +local eternal_override_end = { + after_destruct = eternal_override.after_destruct, + _on_ignite = function(player, pointed_thing) + local pos = pointed_thing.under + local _, dim = mcl_util.y_to_layer(pos.y) + local flame_pos = {x = pos.x, y = pos.y + 1, z = pos.z} + local fn = minetest.get_node(flame_pos) + if dim == "end" and fn.name == "air" and not minetest.is_protected(flame_pos, "fire") and pointed_thing.under.y < pointed_thing.above.y then + minetest.set_node(flame_pos, {name = "mcl_fire:eternal_fire"}) + else + mcl_fire.set_fire(pointed_thing) + end + end, +} +minetest.override_item("mcl_core:bedrock", eternal_override_end) if minetest.get_modpath("mcl_nether") then minetest.override_item("mcl_nether:netherrack", eternal_override) minetest.override_item("mcl_nether:magma", eternal_override)