Advertisement
Guest User

Untitled

a guest
Aug 1st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.55 KB | None | 0 0
  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.       local ausnahme2 = minetest.find_node_near(pos, 3, {"default:bush_stem"})
  10.       if found == nil and ausnahme == nil and ausnahme2 == nil then
  11.         minetest.remove_node(pos)
  12.         local itemstacks = minetest.get_node_drops(node.name)
  13.         for _, itemname in ipairs(itemstacks) do
  14.           minetest.add_item(pos, itemname)
  15.         end
  16.       end
  17.     end
  18.   end})
  19.  
  20. minetest.register_abm({
  21.     nodenames = {"factory:sapling_fertilizer"},
  22.     interval = 1,
  23.     chance = 1,
  24.     action = function(pos, node, active_object_count, active_object_count_wider)
  25.       minetest.remove_node(pos)
  26.     end})
  27.  
  28. minetest.register_abm({
  29.     nodenames = {"trunks:moss"},
  30.     interval = 1,
  31.     chance = 1,
  32.     action = function(pos, node, active_object_count, active_object_count_wider)
  33.       local found = minetest.find_node_near(pos, 1, {"group:tree"})
  34.       if found == nil then
  35.         minetest.remove_node(pos)
  36.         local itemstacks = minetest.get_node_drops(node.name)
  37.         for _, itemname in ipairs(itemstacks) do
  38.           minetest.add_item(pos, itemname)
  39.         end
  40.       end
  41.     end})
  42.  
  43. minetest.register_abm({
  44.     nodenames = {"trunks:moss_fungus"},
  45.     interval = 1,
  46.     chance = 1,
  47.     action = function(pos, node, active_object_count, active_object_count_wider)
  48.       local found = minetest.find_node_near(pos, 1, {"group:tree"})
  49.       if found == nil then
  50.         minetest.remove_node(pos)
  51.         local itemstacks = minetest.get_node_drops(node.name)
  52.         for _, itemname in ipairs(itemstacks) do
  53.           minetest.add_item(pos, itemname)
  54.         end
  55.       end
  56.     end})
  57.  
  58. minetest.register_abm({
  59.     nodenames = {"default:snow"},
  60.     interval = 1,
  61.     chance = 1,
  62.     action = function(pos, node, active_object_count, active_object_count_wider)
  63.       local found1 = minetest.find_node_near(pos, 1, {"group:soil"})
  64.       local found2 = minetest.find_node_near(pos, 1, {"group:leaves"})
  65.       if found1 == nil and found2 == nil then
  66.         minetest.remove_node(pos)
  67.         local itemstacks = minetest.get_node_drops(node.name)
  68.         for _, itemname in ipairs(itemstacks) do
  69.           minetest.add_item(pos, itemname)
  70.         end
  71.       end
  72.     end})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement