clean old nodes
This commit is contained in:
parent
096ede397b
commit
f2acb29911
9
mods/_clean/README.txt
Normal file
9
mods/_clean/README.txt
Normal file
@ -0,0 +1,9 @@
|
||||
This mod deletes old blocks and objects from Minetest.
|
||||
Insert the names of the old nodes in the table "old_nodes" like this:
|
||||
local old_nodes = {"modname:nodename1", "modname:nodename2"}
|
||||
The nodes will automatically be removed when a player is close to them.
|
||||
The same will happen to entities when you insert there names
|
||||
into the table "old_entities".
|
||||
|
||||
License:
|
||||
Sourcecode: WTFPL
|
25
mods/_clean/init.lua
Normal file
25
mods/_clean/init.lua
Normal file
@ -0,0 +1,25 @@
|
||||
local old_nodes = {"flowers:flower_seaweed"}
|
||||
local old_entities = {}
|
||||
|
||||
for _,node_name in ipairs(old_nodes) do
|
||||
minetest.register_node(":"..node_name, {
|
||||
groups = {old=1},
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:old"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
minetest.env:remove_node(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
for _,entity_name in ipairs(old_entities) do
|
||||
minetest.register_entity(":"..entity_name, {
|
||||
on_activate = function(self, staticdata)
|
||||
self.object:remove()
|
||||
end,
|
||||
})
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user