From 49acbfed8e900b7d02588f6eb35268c248561d21 Mon Sep 17 00:00:00 2001 From: 3raven Date: Sat, 30 Apr 2022 22:08:08 +0000 Subject: [PATCH] Fix from mcl2 blackstone by cora Changes taken from https://git.minetest.land/MineClone2/MineClone2/commit/af5e3d84d4363cad61390be6fe5264c7ff07a29f Fire is briefly yellow upon ignition before becoming blue --- mods/ITEMS/mcl_blackstone/init.lua | 47 ++++++++++++------------------ mods/ITEMS/mcl_blackstone/mod.conf | 2 +- 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/mods/ITEMS/mcl_blackstone/init.lua b/mods/ITEMS/mcl_blackstone/init.lua index e1592d72c..1855e8ed5 100644 --- a/mods/ITEMS/mcl_blackstone/init.lua +++ b/mods/ITEMS/mcl_blackstone/init.lua @@ -4,36 +4,11 @@ local LIGHT_TORCH = 10 stairs = {} -local fire_enabled = minetest.settings:get_bool("enable_fire", true) - -local fire_help, eternal_fire_help -if fire_enabled then - fire_help = S("Fire is a damaging and destructive but short-lived kind of block. It will destroy and spread towards near flammable blocks, but fire will disappear when there is nothing to burn left. It will be extinguished by nearby water and rain. Fire can be destroyed safely by punching it, but it is hurtful if you stand directly in it. If a fire is started above netherrack or a magma block, it will immediately turn into an eternal fire.") -else - fire_help = S("Fire is a damaging but non-destructive short-lived kind of block. It will disappear when there is no flammable block around. Fire does not destroy blocks, at least not in this world. It will be extinguished by nearby water and rain. Fire can be destroyed safely by punching it, but it is hurtful if you stand directly in it. If a fire is started above netherrack or a magma block, it will immediately turn into an eternal fire.") -end - -if fire_enabled then - eternal_fire_help = S("Eternal fire is a damaging block that might create more fire. It will create fire around it when flammable blocks are nearby. Eternal fire can be extinguished by punches and nearby water blocks. Other than (normal) fire, eternal fire does not get extinguished on its own and also continues to burn under rain. Punching eternal fire is safe, but it hurts if you stand inside.") -else - eternal_fire_help = S("Eternal fire is a damaging block. Eternal fire can be extinguished by punches and nearby water blocks. Other than (normal) fire, eternal fire does not get extinguished on its own and also continues to burn under rain. Punching eternal fire is safe, but it hurts if you stand inside.") -end - - -local fire_death_messages = { - N("@1 has been cooked crisp."), - N("@1 felt the burn."), - N("@1 died in the flames."), - N("@1 died in a fire."), -} --nodes - - - local mod_screwdriver = minetest.get_modpath("screwdriver") ~= nil local on_rotate if mod_screwdriver then @@ -194,7 +169,7 @@ minetest.register_node("mcl_blackstone:soul_soil", { minetest.register_node("mcl_blackstone:soul_fire", { description = S("Eternal Soul Fire"), - _doc_items_longdesc = eternal_fire_help, + _doc_items_longdesc = minetest.registered_nodes["mcl_fire:eternal_fire"]._doc_items_longdesc , drawtype = "firelike", tiles = { { @@ -214,7 +189,7 @@ minetest.register_node("mcl_blackstone:soul_fire", { buildable_to = true, sunlight_propagates = true, damage_per_second = 2, - _mcl_node_death_message = fire_death_messages, + _mcl_node_death_message = minetest.registered_nodes["mcl_fire:fire"]._mcl_node_death_message, groups = {fire = 1, dig_immediate = 3, not_in_creative_inventory = 1, dig_by_piston = 1, destroys_items = 1, set_on_fire=8}, floodable = true, on_flood = function(pos, oldnode, newnode) @@ -222,7 +197,23 @@ minetest.register_node("mcl_blackstone:soul_fire", { minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true) end end, + on_construct=function(pos) + local under = minetest.get_node(vector.offset(pos,0,-1,0)).name + if under ~= "mcl_nether:soul_sand" and under ~= "mcl_blackstone:soul_soil" then + minetest.swap_node(pos, {name = "air"}) + end + end }) + +local old_onconstruct=minetest.registered_nodes["mcl_fire:fire"].on_construct +minetest.registered_nodes["mcl_fire:fire"].on_construct=function(pos) + local under = minetest.get_node(vector.offset(pos,0,-1,0)).name + if under == "mcl_nether:soul_sand" or under == "mcl_blackstone:soul_soil" then + minetest.swap_node(pos, {name = "mcl_blackstone:soul_fire"}) + end + old_onconstruct(pos) +end + --[[ minetest.register_node("mcl_blackstone:chain", { description = S("Chain"), @@ -823,4 +814,4 @@ minetest.register_craft({ { "mcl_nether:soul_sand" }, { "mcl_core:stick" }, } -}) \ No newline at end of file +}) diff --git a/mods/ITEMS/mcl_blackstone/mod.conf b/mods/ITEMS/mcl_blackstone/mod.conf index 99c247024..a46b4b35d 100644 --- a/mods/ITEMS/mcl_blackstone/mod.conf +++ b/mods/ITEMS/mcl_blackstone/mod.conf @@ -1,2 +1,2 @@ name = mcl_blackstone -depends = mcl_core,screwdriver,mcl_stairs,mclx_stairs,mcl_walls,mclx_fences,mcl_torches \ No newline at end of file +depends = mcl_core,screwdriver,mcl_stairs,mclx_stairs,mcl_walls,mclx_fences,mcl_torches, mcl_fire