Code better commented.

master
A.C.M 2018-11-03 12:57:39 +01:00
parent 358afde977
commit 89a4a6a1aa
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,6 @@
-- Adds a lbm (load block modifer) to all found blocks,
-- to replace themself to air:air.
minetest.register_lbm({
name = ":lbm2",
nodenames = {

View File

@ -1,3 +1,4 @@
-- List of Nodes to remove
local old_nodes = { --- farming_plus:strawberry
"farming_plus:strawberry",
"farming_plus:strawberry_1",
@ -63,6 +64,7 @@ local old_nodes = { --- farming_plus:strawberry
"bamboo:bamboo"
}
-- List of Entities (like mobs)
local old_entities = {
"dmobs:dragon",
"dmobs:pig",
@ -72,21 +74,25 @@ local old_entities = {
"dmobs:treeman"
}
-- Mark all found Nodes to remove with the Group old.
for _,node_name in ipairs(old_nodes) do
minetest.register_node(":"..node_name, {
groups = {old=1},
})
end
-- Set the active block modifier to give the nodes with
-- the group old in it, the command to remove himself.
minetest.register_abm({
nodenames = {"group:old"},
interval = 1,
chance = 1,
interval = 2,
chance = 2,
action = function(pos, node)
minetest.env:remove_node(pos)
end,
})
-- Remove all found Entities
for _,entity_name in ipairs(old_entities) do
minetest.register_entity(":"..entity_name, {
on_activate = function(self, staticdata)