Updated plantlife_modpack, using meshnodes for pebbles and bushes
@@ -3,10 +3,25 @@
 | 
			
		||||
  and rope does not drop anything!!!!
 | 
			
		||||
]]
 | 
			
		||||
 | 
			
		||||
vines = {}
 | 
			
		||||
 | 
			
		||||
local mod_name = "vines"
 | 
			
		||||
local average_height = 12
 | 
			
		||||
local spawn_interval = 90
 | 
			
		||||
local vines_group = {attached_node=1,vines=1,snappy=3,flammable=2,hanging_node=1}
 | 
			
		||||
local vines_group = {attached_node=1,vines=1,snappy=3,flammable=2,hanging_node=1,vines_cleanup=1}
 | 
			
		||||
 | 
			
		||||
vines.growth_interval = 300
 | 
			
		||||
vines.growth_chance = 2
 | 
			
		||||
vines.rot_interval = 300
 | 
			
		||||
vines.rot_chance = 8
 | 
			
		||||
 | 
			
		||||
local jungle_leaves_list = {
 | 
			
		||||
	"default:jungleleaves",
 | 
			
		||||
	"moretrees:jungle_leaves_red",
 | 
			
		||||
	"moretrees:jungle_leaves_yellow",
 | 
			
		||||
	"moretrees:jungle_leaves_green"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-- Nodes
 | 
			
		||||
minetest.register_node("vines:rope_block", {
 | 
			
		||||
  description = "Rope",
 | 
			
		||||
@@ -92,6 +107,7 @@ minetest.register_node("vines:side", {
 | 
			
		||||
  sunlight_propagates = true,
 | 
			
		||||
  paramtype = "light",
 | 
			
		||||
  paramtype2 = "wallmounted",
 | 
			
		||||
  buildable_to = true,
 | 
			
		||||
  tile_images = { "vines_side.png" },
 | 
			
		||||
  drawtype = "signlike",
 | 
			
		||||
  inventory_image = "vines_side.png",
 | 
			
		||||
@@ -119,10 +135,11 @@ minetest.register_node("vines:side_rotten", {
 | 
			
		||||
  sunlight_propagates = true,
 | 
			
		||||
  paramtype = "light",
 | 
			
		||||
  paramtype2 = "wallmounted",
 | 
			
		||||
  buildable_to = true,
 | 
			
		||||
  tile_images = { "vines_side_rotten.png" },
 | 
			
		||||
  drawtype = "signlike",
 | 
			
		||||
  inventory_image = "vines_side.png",
 | 
			
		||||
  groups = {snappy = 3,flammable=2, hanging_node=1},
 | 
			
		||||
  groups = {snappy = 3,flammable=2, hanging_node=1,vines_cleanup=1},
 | 
			
		||||
  sounds = default.node_sound_leaves_defaults(),
 | 
			
		||||
  selection_box = {
 | 
			
		||||
    type = "wallmounted",
 | 
			
		||||
@@ -137,6 +154,7 @@ minetest.register_node("vines:willow", {
 | 
			
		||||
  sunlight_propagates = true,
 | 
			
		||||
  paramtype = "light",
 | 
			
		||||
  paramtype2 = "wallmounted",
 | 
			
		||||
  buildable_to = true,
 | 
			
		||||
  tile_images = { "vines_willow.png" },
 | 
			
		||||
  drawtype = "signlike",
 | 
			
		||||
  inventory_image = "vines_willow.png",
 | 
			
		||||
@@ -164,10 +182,11 @@ minetest.register_node("vines:willow_rotten", {
 | 
			
		||||
  paramtype = "light",
 | 
			
		||||
  drop = "",
 | 
			
		||||
  paramtype2 = "wallmounted",
 | 
			
		||||
  buildable_to = true,
 | 
			
		||||
  tile_images = { "vines_willow_rotten.png" },
 | 
			
		||||
  drawtype = "signlike",
 | 
			
		||||
  inventory_image = "vines_willow.png",
 | 
			
		||||
  groups = {snappy = 3,flammable=2, hanging_node=1},
 | 
			
		||||
  groups = {snappy = 3,flammable=2, hanging_node=1,vines_cleanup=1},
 | 
			
		||||
  sounds = default.node_sound_leaves_defaults(),
 | 
			
		||||
  selection_box = {
 | 
			
		||||
    type = "wallmounted",
 | 
			
		||||
@@ -180,10 +199,11 @@ minetest.register_node("vines:root", {
 | 
			
		||||
  climbable = true,
 | 
			
		||||
  sunlight_propagates = true,
 | 
			
		||||
  paramtype = "light",
 | 
			
		||||
  buildable_to = true,
 | 
			
		||||
  tile_images = { "vines_root.png" },
 | 
			
		||||
  drawtype = "plantlike",
 | 
			
		||||
  inventory_image = "vines_root.png",
 | 
			
		||||
  groups = {vines=1,snappy = 3,flammable=2, hanging_node=1},
 | 
			
		||||
  groups = {vines=1,snappy = 3,flammable=2, hanging_node=1,vines_cleanup=1},
 | 
			
		||||
  sounds = default.node_sound_leaves_defaults(),
 | 
			
		||||
  selection_box = {
 | 
			
		||||
    type = "fixed",
 | 
			
		||||
@@ -198,6 +218,7 @@ minetest.register_node("vines:vine", {
 | 
			
		||||
  sunlight_propagates = true,
 | 
			
		||||
  drop = "",
 | 
			
		||||
  paramtype = "light",
 | 
			
		||||
  buildable_to = true,
 | 
			
		||||
  tile_images = { "vines_vine.png" },
 | 
			
		||||
  drawtype = "plantlike",
 | 
			
		||||
  inventory_image = "vines_vine.png",
 | 
			
		||||
@@ -225,10 +246,11 @@ minetest.register_node("vines:vine_rotten", {
 | 
			
		||||
  drop = "",
 | 
			
		||||
  sunlight_propagates = true,
 | 
			
		||||
  paramtype = "light",
 | 
			
		||||
  buildable_to = true,
 | 
			
		||||
  tile_images = { "vines_vine_rotten.png" },
 | 
			
		||||
  drawtype = "plantlike",
 | 
			
		||||
  inventory_image = "vines_vine_rotten.png",
 | 
			
		||||
  groups = {snappy = 3,flammable=2, hanging_node=1},
 | 
			
		||||
  groups = {snappy = 3,flammable=2, hanging_node=1,vines_cleanup=1},
 | 
			
		||||
  sounds = default.node_sound_leaves_defaults(),
 | 
			
		||||
  selection_box = {
 | 
			
		||||
    type = "fixed",
 | 
			
		||||
@@ -236,11 +258,12 @@ minetest.register_node("vines:vine_rotten", {
 | 
			
		||||
  },
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
--ABM
 | 
			
		||||
-- vine rotting
 | 
			
		||||
 | 
			
		||||
minetest.register_abm({
 | 
			
		||||
  nodenames = {"vines:vine", "vines:side", "vines:willow"},
 | 
			
		||||
  interval = 300,
 | 
			
		||||
  chance = 8,
 | 
			
		||||
  interval = vines.rot_interval,
 | 
			
		||||
  chance = vines.rot_chance,
 | 
			
		||||
  action = function(pos, node, active_object_count, active_object_count_wider)
 | 
			
		||||
    if minetest.find_node_near(pos, 5, "group:tree") == nil then
 | 
			
		||||
      local walldir = node.param2
 | 
			
		||||
@@ -249,10 +272,12 @@ minetest.register_abm({
 | 
			
		||||
  end
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- vine growth
 | 
			
		||||
 | 
			
		||||
minetest.register_abm({
 | 
			
		||||
  nodenames = {"vines:vine", "vines:side", "vines:willow"},
 | 
			
		||||
  interval = 300,
 | 
			
		||||
  chance = 2,
 | 
			
		||||
  interval = vines.growth_interval,
 | 
			
		||||
  chance = vines.growth_chance,
 | 
			
		||||
  action = function(pos, node, active_object_count, active_object_count_wider)
 | 
			
		||||
    local p = {x=pos.x, y=pos.y-1, z=pos.z}
 | 
			
		||||
    local n = minetest.get_node(p)
 | 
			
		||||
@@ -263,6 +288,24 @@ minetest.register_abm({
 | 
			
		||||
  end
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- cleanup if the initial tree is missing entirely (e.g. has been dug away)
 | 
			
		||||
 | 
			
		||||
minetest.register_abm({
 | 
			
		||||
	nodenames = {"group:vines_cleanup"},
 | 
			
		||||
	interval = 10,
 | 
			
		||||
	chance = 5,
 | 
			
		||||
	action = function(pos, node, active_object_count, active_object_count_wider)
 | 
			
		||||
		if not minetest.find_node_near(pos, 1, jungle_leaves_list) then
 | 
			
		||||
			local p_top = {x=pos.x, y=pos.y+1, z=pos.z}
 | 
			
		||||
			if minetest.get_item_group(minetest.get_node(p_top).name, "vines_cleanup") == 0 then
 | 
			
		||||
				minetest.remove_node(pos)
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- rope extension
 | 
			
		||||
 | 
			
		||||
minetest.register_abm({
 | 
			
		||||
  nodenames = {"vines:rope_end"},
 | 
			
		||||
  interval = 1,
 | 
			
		||||
@@ -310,12 +353,10 @@ plantslib:spawn_on_surfaces({
 | 
			
		||||
  spawn_delay = spawn_interval,
 | 
			
		||||
  spawn_plants = {"vines:side"},
 | 
			
		||||
  spawn_chance = 10,
 | 
			
		||||
  spawn_surfaces = {"group:leafdecay"},
 | 
			
		||||
  spawn_surfaces = jungle_leaves_list,
 | 
			
		||||
  spawn_on_side = true,
 | 
			
		||||
  near_nodes = {"default:water_source", "default:jungletree"},
 | 
			
		||||
  near_nodes_size = 10,
 | 
			
		||||
  near_nodes_vertical = 5,
 | 
			
		||||
  near_nodes_count = 1,
 | 
			
		||||
  near_nodes = {"default:jungletree"},
 | 
			
		||||
  near_nodes_size = 5,
 | 
			
		||||
  plantlife_limit = -0.9,
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
| 
		 Before Width: | Height: | Size: 441 B After Width: | Height: | Size: 201 B  | 
| 
		 Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 233 B  | 
| 
		 Before Width: | Height: | Size: 386 B After Width: | Height: | Size: 196 B  | 
| 
		 Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 187 B  | 
| 
		 Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 225 B  | 
| 
		 Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 223 B  | 
| 
		 Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 194 B  | 
| 
		 Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 167 B  | 
| 
		 Before Width: | Height: | Size: 441 B After Width: | Height: | Size: 201 B  | 
| 
		 Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 106 B  | 
| 
		 Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 118 B  | 
| 
		 Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 233 B  | 
| 
		 Before Width: | Height: | Size: 521 B After Width: | Height: | Size: 225 B  | 
| 
		 Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 187 B  | 
| 
		 Before Width: | Height: | Size: 386 B After Width: | Height: | Size: 196 B  | 
| 
		 Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 196 B  | 
| 
		 Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 190 B  |