Remove ABMs

This commit is contained in:
rubenwardy 2019-01-05 23:24:53 +00:00
parent 7edfc34070
commit 244d256afe
3 changed files with 2 additions and 81 deletions

View file

@ -7,6 +7,7 @@ regen_interval = 6
regen_amount = 1 regen_amount = 1
random_messages_interval = 60 random_messages_interval = 60
sprint_stamina = 5 sprint_stamina = 5
enable_lavacooling = false
# #
# CTF_PVP_ENGINE # CTF_PVP_ENGINE

View file

@ -211,18 +211,3 @@ for _, chest_color in pairs(colors) do
end end
}) })
end end
minetest.register_abm({
nodenames = {"group:team_chest"},
interval = 10, -- Run every 10 seconds
chance = 1, -- Select every 1 in 50 nodes
action = function(pos, node, active_object_count, active_object_count_wider)
local current_owner = assert(chest_name_to_team[node.name])
local territory_owner = ctf.get_territory_owner(pos)
if territory_owner and current_owner ~= territory_owner then
ctf.warning("ctf_team_base", "Wrong chest, changing to " .. territory_owner .. " from " .. current_owner)
minetest.set_node(pos, { name = "ctf_team_base:chest_" .. territory_owner })
end
end
})

View file

@ -360,72 +360,7 @@ end
-- --
-- Convert dirt to something that fits the environment -- Convert dirt to something that fits the environment
-- --
-- SNIP
minetest.register_abm({
label = "Grass spread",
nodenames = {"default:dirt"},
neighbors = {
"air",
"group:grass",
"group:dry_grass",
"default:snow",
},
interval = 6,
chance = 50,
catch_up = false,
action = function(pos, node)
-- Check for darkness: night, shadow or under a light-blocking node
-- Returns if ignore above
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
if (minetest.get_node_light(above) or 0) < 13 then
return
end
-- Look for spreading dirt-type neighbours
local p2 = minetest.find_node_near(pos, 1, "group:spreading_dirt_type")
if p2 then
local n3 = minetest.get_node(p2)
minetest.set_node(pos, {name = n3.name})
return
end
-- Else, any seeding nodes on top?
local name = minetest.get_node(above).name
-- Snow check is cheapest, so comes first
if name == "default:snow" then
minetest.set_node(pos, {name = "default:dirt_with_snow"})
-- Most likely case first
elseif minetest.get_item_group(name, "grass") ~= 0 then
minetest.set_node(pos, {name = "default:dirt_with_grass"})
elseif minetest.get_item_group(name, "dry_grass") ~= 0 then
minetest.set_node(pos, {name = "default:dirt_with_dry_grass"})
end
end
})
--
-- Grass and dry grass removed in darkness
--
minetest.register_abm({
label = "Grass covered",
nodenames = {"group:spreading_dirt_type"},
interval = 8,
chance = 50,
catch_up = false,
action = function(pos, node)
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or
nodedef.paramtype == "light") and
nodedef.liquidtype == "none") then
minetest.set_node(pos, {name = "default:dirt"})
end
end
})
-- --
-- Checks if specified volume intersects a protected volume -- Checks if specified volume intersects a protected volume