Add option to disable lavacooling (#1726)
authorEzhh <owlecho@live.com>
Sun, 7 May 2017 16:25:53 +0000 (17:25 +0100)
committerSmallJoker <SmallJoker@users.noreply.github.com>
Sun, 7 May 2017 16:25:53 +0000 (18:25 +0200)
minetest.conf.example
mods/default/functions.lua
settingtypes.txt

index 3f20eb7708f0441ae05352b9083fe024ae4d1ff7..9393b1a52a0ddb0531605768e7880a630ac15a4b 100644 (file)
@@ -27,6 +27,9 @@
 # Enable flame sound.
 #flame_sound = true
 
+# Whether lavacooling should be enabled.
+#enable_lavacooling = true
+
 # Whether the stuff in initial_stuff should be given to new players
 #give_initial_stuff = false
 #initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,default:torch 99,default:cobble 99
index 2268263e43f7d09ae618add288bb9e556d432ecf..936712cac272c187f007f0fe63f19ebe7ec61321 100644 (file)
@@ -131,18 +131,19 @@ default.cool_lava = function(pos, node)
                {pos = pos, max_hear_distance = 16, gain = 0.25})
 end
 
-minetest.register_abm({
-       label = "Lava cooling",
-       nodenames = {"default:lava_source", "default:lava_flowing"},
-       neighbors = {"group:cools_lava", "group:water"},
-       interval = 1,
-       chance = 2,
-       catch_up = false,
-       action = function(...)
-               default.cool_lava(...)
-       end,
-})
-
+if minetest.setting_getbool("enable_lavacooling") ~= false then
+       minetest.register_abm({
+               label = "Lava cooling",
+               nodenames = {"default:lava_source", "default:lava_flowing"},
+               neighbors = {"group:cools_lava", "group:water"},
+               interval = 1,
+               chance = 2,
+               catch_up = false,
+               action = function(...)
+                       default.cool_lava(...)
+               end,
+       })
+end
 
 --
 -- optimized helper to put all items in an inventory into a drops list
index eeea0bfcdb8a3ab7799498ce735141e355755adb..855235c2551735c09efdcbae94c1f2f1e79cbd34 100644 (file)
@@ -16,6 +16,9 @@ enable_fire (Fire) bool true
 #    Enable flame sound.
 flame_sound (Flame sound) bool true
 
+#    Enable lavacooling.
+enable_lavacooling (Lavacooling) bool true
+
 #    If enabled, steel tools, torches and cobblestone will be given to new
 #    players.
 give_initial_stuff (Give initial items) bool false