Textures Optimized

This commit is contained in:
bas080 2015-02-09 02:12:47 +01:00
parent 5269e44b60
commit fbb90b10ff
18 changed files with 57 additions and 21 deletions

@ -1,12 +1,22 @@
--[[TODO vines = {}
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!!!!
]]
local mod_name = "vines" local mod_name = "vines"
local average_height = 12 local average_height = 12
local spawn_interval = 90 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 -- Nodes
minetest.register_node("vines:rope_block", { minetest.register_node("vines:rope_block", {
description = "Rope", description = "Rope",
@ -92,6 +102,7 @@ minetest.register_node("vines:side", {
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
buildable_to = true,
tile_images = { "vines_side.png" }, tile_images = { "vines_side.png" },
drawtype = "signlike", drawtype = "signlike",
inventory_image = "vines_side.png", inventory_image = "vines_side.png",
@ -119,10 +130,11 @@ minetest.register_node("vines:side_rotten", {
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
buildable_to = true,
tile_images = { "vines_side_rotten.png" }, tile_images = { "vines_side_rotten.png" },
drawtype = "signlike", drawtype = "signlike",
inventory_image = "vines_side.png", 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(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "wallmounted", type = "wallmounted",
@ -137,6 +149,7 @@ minetest.register_node("vines:willow", {
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
buildable_to = true,
tile_images = { "vines_willow.png" }, tile_images = { "vines_willow.png" },
drawtype = "signlike", drawtype = "signlike",
inventory_image = "vines_willow.png", inventory_image = "vines_willow.png",
@ -164,10 +177,11 @@ minetest.register_node("vines:willow_rotten", {
paramtype = "light", paramtype = "light",
drop = "", drop = "",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
buildable_to = true,
tile_images = { "vines_willow_rotten.png" }, tile_images = { "vines_willow_rotten.png" },
drawtype = "signlike", drawtype = "signlike",
inventory_image = "vines_willow.png", 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(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "wallmounted", type = "wallmounted",
@ -180,10 +194,11 @@ minetest.register_node("vines:root", {
climbable = true, climbable = true,
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
buildable_to = true,
tile_images = { "vines_root.png" }, tile_images = { "vines_root.png" },
drawtype = "plantlike", drawtype = "plantlike",
inventory_image = "vines_root.png", 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(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
@ -198,6 +213,7 @@ minetest.register_node("vines:vine", {
sunlight_propagates = true, sunlight_propagates = true,
drop = "", drop = "",
paramtype = "light", paramtype = "light",
buildable_to = true,
tile_images = { "vines_vine.png" }, tile_images = { "vines_vine.png" },
drawtype = "plantlike", drawtype = "plantlike",
inventory_image = "vines_vine.png", inventory_image = "vines_vine.png",
@ -225,10 +241,11 @@ minetest.register_node("vines:vine_rotten", {
drop = "", drop = "",
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
buildable_to = true,
tile_images = { "vines_vine_rotten.png" }, tile_images = { "vines_vine_rotten.png" },
drawtype = "plantlike", drawtype = "plantlike",
inventory_image = "vines_vine_rotten.png", 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(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
@ -236,33 +253,54 @@ minetest.register_node("vines:vine_rotten", {
}, },
}) })
--ABM -- vine rotting
minetest.register_abm({ minetest.register_abm({
nodenames = {"vines:vine", "vines:side", "vines:willow"}, nodenames = {"vines:vine", "vines:side", "vines:willow"},
interval = 300, interval = vines.rot_interval,
chance = 8, chance = vines.rot_chance,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.find_node_near(pos, 5, "group:tree") == nil then 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}) minetest.add_node(pos, {name=node.name.."_rotten", param2 = walldir})
end end
end end
}) })
-- vine growth
minetest.register_abm({ minetest.register_abm({
nodenames = {"vines:vine", "vines:side", "vines:willow"}, nodenames = {"vines:vine", "vines:side", "vines:willow"},
interval = 300, interval = vines.growth_interval,
chance = 2, chance = vines.growth_chance,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
local p = {x=pos.x, y=pos.y-1, z=pos.z} local p = {x=pos.x, y=pos.y-1, z=pos.z}
local n = minetest.get_node(p) local n = minetest.get_node(p)
if n.name == "air" then if n.name == "air" then
walldir = node.param2 local walldir = node.param2
minetest.add_node(p, {name=node.name, param2 = walldir}) minetest.add_node(p, {name=node.name, param2 = walldir})
end end
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({ minetest.register_abm({
nodenames = {"vines:rope_end"}, nodenames = {"vines:rope_end"},
interval = 1, interval = 1,
@ -310,12 +348,10 @@ plantslib:spawn_on_surfaces({
spawn_delay = spawn_interval, spawn_delay = spawn_interval,
spawn_plants = {"vines:side"}, spawn_plants = {"vines:side"},
spawn_chance = 10, spawn_chance = 10,
spawn_surfaces = {"group:leafdecay"}, spawn_surfaces = jungle_leaves_list,
spawn_on_side = true, spawn_on_side = true,
near_nodes = {"default:water_source", "default:jungletree"}, near_nodes = {"default:jungletree"},
near_nodes_size = 10, near_nodes_size = 5,
near_nodes_vertical = 5,
near_nodes_count = 1,
plantlife_limit = -0.9, plantlife_limit = -0.9,
}) })

Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 447 B

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 521 B

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 190 B