Guest User

Untitled

a guest
Oct 5th, 2012
56
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. minetest.register_node("farming:rubber_sapling", {
  2. description = "Rubber Tree Sapling",
  3. drawtype = "plantlike",
  4. tiles = {"farming_rubber_sapling.png"},
  5. inventory_image = "farming_rubber_sapling.png",
  6. wield_image = "farming_rubber_sapling.png",
  7. paramtype = "light",
  8. walkable = false,
  9. groups = {dig_immediate=3,flammable=2},
  10. sounds = default.node_sound_defaults(),
  11. })
  12.  
  13. minetest.register_node("farming:rubber_tree_full", {
  14. description = "Rubber Tree",
  15. tiles = {"default_tree_top.png", "default_tree_top.png", "farming_rubber_tree_full.png"},
  16. groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
  17. drop = "default:tree",
  18. sounds = default.node_sound_wood_defaults(),
  19.  
  20. on_dig = function(pos, node, digger)
  21. minetest.node_dig(pos, node, digger)
  22. minetest.env:remove_node(pos)
  23. end,
  24.  
  25. after_destruct = function(pos, oldnode)
  26. oldnode.name = "farming:rubber_tree_empty"
  27. minetest.env:set_node(pos, oldnode)
  28. end
  29. })
  30.  
  31.  
  32. minetest.register_node("farming:rubber_tree_empty", {
  33. tiles = {"default_tree_top.png", "default_tree_top.png", "farming_rubber_tree_empty.png"},
  34. groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2, not_in_creative_inventory=1},
  35. drop = "default:tree",
  36. sounds = default.node_sound_wood_defaults(),
  37. })
  38.  
  39. minetest.register_abm({
  40. nodenames = {"farming:rubber_tree_empty"},
  41. interval = 60,
  42. chance = 15,
  43. action = function(pos, node)
  44. node.name = "farming:rubber_tree_full"
  45. minetest.env:set_node(pos, node)
  46. end
  47. })
  48.  
  49. minetest.register_node("farming:rubber_leaves", {
  50. drawtype = "allfaces_optional",
  51. visual_scale = 1.3,
  52. tiles = {"default_leaves.png"},
  53. paramtype = "light",
  54. groups = {snappy=3, leafdecay=3, flammable=2, not_in_creative_inventory=1},
  55. drop = {
  56. max_items = 1,
  57. items = {
  58. {
  59. items = {'farming:rubber_sapling'},
  60. rarity = 20,
  61. },
  62. }
  63. },
  64. sounds = default.node_sound_leaves_defaults(),
  65. })
  66.  
  67. minetest.register_abm({
  68. nodenames = {"farming:rubber_sapling"},
  69. interval = 60,
  70. chance = 20,
  71. action = function(pos, node)
  72. farming:generate_tree(pos, "farming:rubber_tree_full", "farming:rubber_leaves", {"default:dirt", "default:dirt_with_grass"})
  73. end
  74. })
  75.  
  76. minetest.register_on_generated(function(minp, maxp, blockseed)
  77. if math.random(1, 100) > 5 then
  78. return
  79. end
  80. local tmp = {x=(maxp.x-minp.x)/2+minp.x, y=(maxp.y-minp.y)/2+minp.y, z=(maxp.z-minp.z)/2+minp.z}
  81. local pos = minetest.env:find_node_near(tmp, maxp.x-minp.x, {"default:dirt_with_grass"})
  82. if pos ~= nil then
  83. farming:generate_tree({x=pos.x, y=pos.y+1, z=pos.z}, "farming:rubber_tree_full", "farming:rubber_leaves", {"default:dirt", "default:dirt_with_grass"})
  84. end
  85. end)
  86.  
  87. minetest.register_craftitem("farming:bucket_rubber", {
  88. description = "Bucket with Caoutchouc",
  89. inventory_image = "farming_bucket_rubber.png",
  90. stack_max = 1,
  91. })
  92.  
  93. local bucket_tmp = {
  94. source = "farming:rubber_tree_full",
  95. itemname = "farming:bucket_rubber"
  96. }
  97. bucket.liquids["farming:rubber_tree_full"] = bucket_tmp
  98.  
  99. -- ========= FUEL =========
  100. minetest.register_craft({
  101. type = "fuel",
  102. recipe = "farming:rubber_sapling",
  103. burntime = 10
  104. })
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×