AntumDeluge 2017-05-18 16:27:12 -07:00
parent 0c6f8b69b4
commit b5a4226673
2 changed files with 22 additions and 5 deletions

View File

@ -493,7 +493,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[patch.biome_lib]: https://github.com/AntumDeluge/mtmod-biome_lib/tree/4821839
[patch.campfire]: https://github.com/AntumDeluge/mtmod-campfire/tree/67b9dd7
[patch.christmas]: https://github.com/AntumDeluge/mtmod-christmas/tree/f6c8dc2
[patch.clean]: https://github.com/AntumDeluge/mtmod-clean/tree/c4b2b99
[patch.clean]: https://github.com/AntumDeluge/mtmod-clean/tree/a1e150f
[patch.cme]: https://github.com/AntumDeluge/mtmp-cme/tree/7a6e106
[patch.coloredwood]: https://github.com/AntumDeluge/mtmod-coloredwood/tree/e1e02b3
[patch.compassgps]: https://github.com/AntumDeluge/mtmod-compassgps/tree/888ec15

View File

@ -1,17 +1,29 @@
-- LICENSE: WTFPL
-- Copyright: PilzAdam
local old_nodes = {"mod:a", "mod:b"}
local old_nodes = {'mod:a', 'mod:b'}
local old_entities = {'mobs_mc:skeleton', 'mobs_mc:creeper', 'kpgmobs:sheep'}
-- Old/Missing nodes that should be replaced with something currently in game
local replace_nodes = {
{'homedecor:bed_regular', 'homedecor:bed_white_regular'},
}
-- "Replaces" an old/non-existent node
local function replace_node(old_node, new_node)
minetest.register_alias(old_node, new_node)
end
for _,node_name in ipairs(old_nodes) do
minetest.register_node(":"..node_name, {
minetest.register_node(':'..node_name, {
groups = {old=1},
})
end
minetest.register_abm({
nodenames = {"group:old"},
nodenames = {'group:old'},
interval = 1,
chance = 1,
action = function(pos, node)
@ -20,9 +32,14 @@ minetest.register_abm({
})
for _,entity_name in ipairs(old_entities) do
minetest.register_entity(":"..entity_name, {
minetest.register_entity(':'..entity_name, {
on_activate = function(self, staticdata)
self.object:remove()
end,
})
end
-- Replace old nodes
for _, node_group in pairs(replace_nodes) do
replace_node(node_group[1], node_group[2])
end