Skip to content

Commit 0870631

Browse files
EzhhSmallJoker
authored andcommitted
Add option to disable lavacooling (#1726)
1 parent 6737952 commit 0870631

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

minetest.conf.example

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
# Enable flame sound.
2828
#flame_sound = true
2929

30+
# Whether lavacooling should be enabled.
31+
#enable_lavacooling = true
32+
3033
# Whether the stuff in initial_stuff should be given to new players
3134
#give_initial_stuff = false
3235
#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,default:torch 99,default:cobble 99

mods/default/functions.lua

+13-12
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,19 @@ default.cool_lava = function(pos, node)
131131
{pos = pos, max_hear_distance = 16, gain = 0.25})
132132
end
133133

134-
minetest.register_abm({
135-
label = "Lava cooling",
136-
nodenames = {"default:lava_source", "default:lava_flowing"},
137-
neighbors = {"group:cools_lava", "group:water"},
138-
interval = 1,
139-
chance = 2,
140-
catch_up = false,
141-
action = function(...)
142-
default.cool_lava(...)
143-
end,
144-
})
145-
134+
if minetest.setting_getbool("enable_lavacooling") ~= false then
135+
minetest.register_abm({
136+
label = "Lava cooling",
137+
nodenames = {"default:lava_source", "default:lava_flowing"},
138+
neighbors = {"group:cools_lava", "group:water"},
139+
interval = 1,
140+
chance = 2,
141+
catch_up = false,
142+
action = function(...)
143+
default.cool_lava(...)
144+
end,
145+
})
146+
end
146147

147148
--
148149
-- optimized helper to put all items in an inventory into a drops list

settingtypes.txt

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ enable_fire (Fire) bool true
1616
# Enable flame sound.
1717
flame_sound (Flame sound) bool true
1818

19+
# Enable lavacooling.
20+
enable_lavacooling (Lavacooling) bool true
21+
1922
# If enabled, steel tools, torches and cobblestone will be given to new
2023
# players.
2124
give_initial_stuff (Give initial items) bool false

0 commit comments

Comments
 (0)