Guest User

Untitled

a guest
Aug 1st, 2017
7
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. minetest.register_abm({
  2.     nodenames = {"group:leaves"},
  3.     interval = 2,
  4.     chance = 15,
  5.     action = function(pos, node, active_object_count, active_object_count_wider)
  6.       if minetest.get_node(pos).param2 == 0 then
  7.       local found = minetest.find_node_near(pos, 5, {"group:tree"})
  8.       local ausnahme = minetest.find_node_near(pos, 3, {"bushes:youngtree2_bottom"})
  9.       if found == nil and ausnahme == nil then
  10.         minetest.remove_node(pos)
  11.         local itemstacks = minetest.get_node_drops(node.name)
  12.         for _, itemname in ipairs(itemstacks) do
  13.           minetest.add_item(pos, itemname)
  14.         end
  15.       end
  16.     end
  17.   end})
  18.  
  19. minetest.register_abm({
  20.     nodenames = {"factory:sapling_fertilizer"},
  21.     interval = 1,
  22.     chance = 1,
  23.     action = function(pos, node, active_object_count, active_object_count_wider)
  24.       minetest.remove_node(pos)
  25.     end})
  26.  
  27. minetest.register_abm({
  28.     nodenames = {"trunks:moss"},
  29.     interval = 1,
  30.     chance = 1,
  31.     action = function(pos, node, active_object_count, active_object_count_wider)
  32.       local found = minetest.find_node_near(pos, 1, {"group:tree"})
  33.       if found == nil then
  34.         minetest.remove_node(pos)
  35.         local itemstacks = minetest.get_node_drops(node.name)
  36.         for _, itemname in ipairs(itemstacks) do
  37.           minetest.add_item(pos, itemname)
  38.         end
  39.       end
  40.     end})
  41.  
  42. minetest.register_abm({
  43.     nodenames = {"trunks:moss_fungus"},
  44.     interval = 1,
  45.     chance = 1,
  46.     action = function(pos, node, active_object_count, active_object_count_wider)
  47.       local found = minetest.find_node_near(pos, 1, {"group:tree"})
  48.       if found == nil then
  49.         minetest.remove_node(pos)
  50.         local itemstacks = minetest.get_node_drops(node.name)
  51.         for _, itemname in ipairs(itemstacks) do
  52.           minetest.add_item(pos, itemname)
  53.         end
  54.       end
  55.     end})
  56.  
  57. minetest.register_abm({
  58.     nodenames = {"default:snow"},
  59.     interval = 1,
  60.     chance = 1,
  61.     action = function(pos, node, active_object_count, active_object_count_wider)
  62.       local found1 = minetest.find_node_near(pos, 1, {"group:soil"})
  63.       local found2 = minetest.find_node_near(pos, 1, {"group:leaves"})
  64.       if found1 == nil and found2 == nil then
  65.         minetest.remove_node(pos)
  66.         local itemstacks = minetest.get_node_drops(node.name)
  67.         for _, itemname in ipairs(itemstacks) do
  68.           minetest.add_item(pos, itemname)
  69.         end
  70.       end
  71.     end})
RAW Paste Data