Fire on bedrock in the End is now eternal

This commit is contained in:
Wuzzy 2017-09-08 15:28:38 +02:00
parent 56e07cd010
commit d55f83346e
3 changed files with 20 additions and 2 deletions

View file

@ -553,7 +553,8 @@ minetest.register_node("mcl_core:brick_block", {
minetest.register_node("mcl_core:bedrock", { minetest.register_node("mcl_core:bedrock", {
description = "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"}, tiles = {"mcl_core_bedrock.png"},
stack_max = 64, stack_max = 64,
groups = {creative_breakable=1, building_block=1, material_stone=1}, groups = {creative_breakable=1, building_block=1, material_stone=1},

View file

@ -1,3 +1,4 @@
mcl_core mcl_core
mcl_util
mcl_sounds mcl_sounds
mcl_nether? mcl_nether?

View file

@ -379,7 +379,8 @@ else -- Fire enabled
end 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 = { local eternal_override = {
after_destruct = function(pos, oldnode) after_destruct = function(pos, oldnode)
@ -399,7 +400,22 @@ local eternal_override = {
end end
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 if minetest.get_modpath("mcl_nether") then
minetest.override_item("mcl_nether:netherrack", eternal_override) minetest.override_item("mcl_nether:netherrack", eternal_override)
minetest.override_item("mcl_nether:magma", eternal_override) minetest.override_item("mcl_nether:magma", eternal_override)