mirror of
https://codeberg.org/AntumLuanti/mod-cleaner.git
synced 2025-03-25 01:09:07 +00:00
Remove functionality for cleaning anything other than entities:
For cleaning other objects it is recommended to use 'override' mod: https://github.com/AntumMT/mod-override
This commit is contained in:
parent
49fc2c6315
commit
6622ea8bab
1 changed files with 1 additions and 32 deletions
33
init.lua
33
init.lua
|
@ -18,35 +18,9 @@ local function logDebug(msg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local old_nodes = {}
|
|
||||||
local old_entities = {}
|
local old_entities = {}
|
||||||
|
|
||||||
-- Old/Missing nodes that should be replaced with something currently in game
|
|
||||||
local replace_nodes = {}
|
|
||||||
|
|
||||||
|
|
||||||
-- "Replaces" an old/non-existent node
|
|
||||||
local function replace_node(old_node, new_node)
|
|
||||||
core.register_alias(old_node, new_node)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
for _,node_name in ipairs(old_nodes) do
|
|
||||||
core.register_node(':' .. node_name, {
|
|
||||||
groups = {old=1},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
core.register_abm({
|
|
||||||
nodenames = {'group:old'},
|
|
||||||
interval = 1,
|
|
||||||
chance = 1,
|
|
||||||
action = function(pos, node)
|
|
||||||
core.remove_node(pos)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
-- Populate entities list from file in world path
|
-- Populate entities list from file in world path
|
||||||
local e_list = nil
|
local e_list = nil
|
||||||
local e_path = core.get_worldpath() .. '/clean_entities.txt'
|
local e_path = core.get_worldpath() .. '/clean_entities.txt'
|
||||||
|
@ -80,8 +54,3 @@ for _, entity_name in ipairs(old_entities) do
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Replace old nodes
|
|
||||||
for _, node_group in pairs(replace_nodes) do
|
|
||||||
replace_node(node_group[1], node_group[2])
|
|
||||||
end
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue