Config setting to nerf corium
authorZefram <zefram@fysh.org>
Wed, 23 Jul 2014 21:13:45 +0000 (22:13 +0100)
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Wed, 23 Jul 2014 21:24:52 +0000 (17:24 -0400)
For use on servers that have a mainly creative purpose, the setting
enable_corium_griefing=false will prevent corium from flowing far or
unpredictably and from destroying nodes other than water.  All reactor
meltdowns will stay contained.

technic/config.lua
technic/machines/HV/nuclear_reactor.lua

index 525c79fe3299c475affc42472dcd53b2e46845bb..1dfce66c6367fbcf7194ee71bdc171fce7fcd0f1 100644 (file)
@@ -13,6 +13,7 @@ local defaults = {
        enable_marble_generation = "true",
        enable_granite_generation = "true",
        enable_wind_mill = "false",
+       enable_corium_griefing = "true",
 }
 
 for k, v in pairs(defaults) do
index 80cf24dc71fbc6e7189de4a9a4102a033baf7b7f..003ca6b3d9735bfd0231da25d2ba448b17fa69a3 100644 (file)
@@ -351,30 +351,34 @@ minetest.register_abm({
        end,
 })
 
+local griefing = technic.config:get_bool("enable_corium_griefing")
+
 minetest.register_abm({
        nodenames = {"technic:corium_flowing"},
        interval = 5,
-       chance = 10,
+       chance = (griefing and 10 or 1),
        action = function (pos, node)
                minetest.set_node(pos, {name="technic:chernobylite_block"})
        end,
 })
 
-minetest.register_abm({
-       nodenames = { "technic:corium_source", "technic:corium_flowing" },
-       interval = 4,
-       chance = 4,
-       action = function (pos, node)
-               for _, offset in ipairs({
-                       vector.new(1,0,0),
-                       vector.new(-1,0,0),
-                       vector.new(0,0,1),
-                       vector.new(0,0,-1),
-                       vector.new(0,-1,0),
-               }) do
-                       if math.random(8) == 1 then
-                               minetest.dig_node(vector.add(pos, offset))
+if griefing then
+       minetest.register_abm({
+               nodenames = { "technic:corium_source", "technic:corium_flowing" },
+               interval = 4,
+               chance = 4,
+               action = function (pos, node)
+                       for _, offset in ipairs({
+                               vector.new(1,0,0),
+                               vector.new(-1,0,0),
+                               vector.new(0,0,1),
+                               vector.new(0,0,-1),
+                               vector.new(0,-1,0),
+                       }) do
+                               if math.random(8) == 1 then
+                                       minetest.dig_node(vector.add(pos, offset))
+                               end
                        end
-               end
-       end,
-})
+               end,
+       })
+end