mirror of
https://github.com/minetest-mods/technic.git
synced 2024-12-25 18:30:29 +01:00
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:
parent
366fc3bc65
commit
c5e9480d99
@ -13,6 +13,7 @@ local defaults = {
|
|||||||
enable_marble_generation = "true",
|
enable_marble_generation = "true",
|
||||||
enable_granite_generation = "true",
|
enable_granite_generation = "true",
|
||||||
enable_wind_mill = "false",
|
enable_wind_mill = "false",
|
||||||
|
enable_corium_griefing = "true",
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v in pairs(defaults) do
|
for k, v in pairs(defaults) do
|
||||||
|
@ -351,30 +351,34 @@ minetest.register_abm({
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local griefing = technic.config:get_bool("enable_corium_griefing")
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"technic:corium_flowing"},
|
nodenames = {"technic:corium_flowing"},
|
||||||
interval = 5,
|
interval = 5,
|
||||||
chance = 10,
|
chance = (griefing and 10 or 1),
|
||||||
action = function (pos, node)
|
action = function (pos, node)
|
||||||
minetest.set_node(pos, {name="technic:chernobylite_block"})
|
minetest.set_node(pos, {name="technic:chernobylite_block"})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_abm({
|
if griefing then
|
||||||
nodenames = { "technic:corium_source", "technic:corium_flowing" },
|
minetest.register_abm({
|
||||||
interval = 4,
|
nodenames = { "technic:corium_source", "technic:corium_flowing" },
|
||||||
chance = 4,
|
interval = 4,
|
||||||
action = function (pos, node)
|
chance = 4,
|
||||||
for _, offset in ipairs({
|
action = function (pos, node)
|
||||||
vector.new(1,0,0),
|
for _, offset in ipairs({
|
||||||
vector.new(-1,0,0),
|
vector.new(1,0,0),
|
||||||
vector.new(0,0,1),
|
vector.new(-1,0,0),
|
||||||
vector.new(0,0,-1),
|
vector.new(0,0,1),
|
||||||
vector.new(0,-1,0),
|
vector.new(0,0,-1),
|
||||||
}) do
|
vector.new(0,-1,0),
|
||||||
if math.random(8) == 1 then
|
}) do
|
||||||
minetest.dig_node(vector.add(pos, offset))
|
if math.random(8) == 1 then
|
||||||
|
minetest.dig_node(vector.add(pos, offset))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
end,
|
})
|
||||||
})
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user