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.
This commit is contained in:
Zefram 2014-07-23 22:13:45 +01:00 committed by Vanessa Ezekowitz
parent 366fc3bc65
commit c5e9480d99
2 changed files with 23 additions and 18 deletions

@ -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

@ -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