Textures Optimized
78
init.lua
@ -1,12 +1,22 @@
|
||||
--[[TODO
|
||||
ropebox rope break results in bottom rope dissapearing and bottom drop rope node to appear at the new bottom
|
||||
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 +102,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 +130,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 +149,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 +177,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 +194,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 +213,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 +241,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,33 +253,54 @@ 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
|
||||
walldir = node.param2
|
||||
local walldir = node.param2
|
||||
minetest.add_node(pos, {name=node.name.."_rotten", param2 = walldir})
|
||||
end
|
||||
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)
|
||||
if n.name == "air" then
|
||||
walldir = node.param2
|
||||
local walldir = node.param2
|
||||
minetest.add_node(p, {name=node.name, param2 = walldir})
|
||||
end
|
||||
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 +348,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 |