diff options
author | Zefram <zefram@fysh.org> | 2014-07-23 22:13:45 +0100 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2014-07-23 17:24:52 -0400 |
commit | c5e9480d99af35dd646e525bb20608cc0ca5c1ab (patch) | |
tree | f2e0a77f87eff89f0799322a08c4126d8e4ecf40 | |
parent | 366fc3bc6503a03100ddb50d473385e0cb7376fa (diff) |
Config setting to nerf corium
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.
-rw-r--r-- | technic/config.lua | 1 | ||||
-rw-r--r-- | technic/machines/HV/nuclear_reactor.lua | 40 |
2 files changed, 23 insertions, 18 deletions
diff --git a/technic/config.lua b/technic/config.lua index 525c79f..1dfce66 100644 --- a/technic/config.lua +++ b/technic/config.lua @@ -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 diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua index 80cf24d..003ca6b 100644 --- a/technic/machines/HV/nuclear_reactor.lua +++ b/technic/machines/HV/nuclear_reactor.lua @@ -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 |