removed trunk bases and snow leaves
>disabled leaves with snow(;ine 203 to enable again) >removed trunk bases(the code is still there and they are still included in the schematics)
This commit is contained in:
parent
9ae9d948cf
commit
6b03f72268
75
init.lua
75
init.lua
@ -199,6 +199,10 @@ minetest.override_item("default:aspen_leaves", {
|
||||
|
||||
|
||||
--leaves
|
||||
|
||||
local snowy_leaves = false
|
||||
|
||||
if snowy_leaves then
|
||||
minetest.register_node("nodebox_trees:leaves_with_snow", {
|
||||
description = "Leaves With Snow",
|
||||
drawtype = "mesh",
|
||||
@ -229,6 +233,42 @@ minetest.register_node("nodebox_trees:pine_needles_with_snow", {
|
||||
groups = {snappy=1, oddly_breakable_by_hand=1, leaves=1}
|
||||
})
|
||||
|
||||
--replace leaves with leaves_with_snow
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp)
|
||||
if maxp.y < -1 or maxp.y > 31000 then
|
||||
return
|
||||
end
|
||||
local needles = minetest.find_nodes_in_area(minp, maxp,
|
||||
{"default:pine_needles"})
|
||||
for n = 1, #needles do
|
||||
local pos = {x=needles[n].x, y=needles[n].y, z=needles[n].z}
|
||||
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "default:snow" then
|
||||
minetest.set_node(pos, {name="nodebox_trees:pine_needles_with_snow"})
|
||||
end
|
||||
end
|
||||
|
||||
local leaves = minetest.find_nodes_in_area(minp, maxp,
|
||||
{"default:leaves"})
|
||||
for n = 1, #leaves do
|
||||
local pos = {x=leaves[n].x, y=leaves[n].y, z=leaves[n].z}
|
||||
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "default:snow" then
|
||||
minetest.set_node(pos, {name="nodebox_trees:leaves_with_snow"})
|
||||
end
|
||||
end
|
||||
|
||||
local bush = minetest.find_nodes_in_area(minp, maxp,
|
||||
{"default:bush_leaves"})
|
||||
for n = 1, #bush do
|
||||
local pos = {x=bush[n].x, y=bush[n].y, z=bush[n].z}
|
||||
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "default:snow" then
|
||||
minetest.set_node(pos, {name="nodebox_trees:bush_leaves_with_snow"})
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
--trunk overrides
|
||||
|
||||
minetest.override_item("default:acacia_tree", {
|
||||
@ -333,7 +373,7 @@ minetest.override_item("default:jungletree", {
|
||||
})
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
minetest.register_node("nodebox_trees:trunk_base", {
|
||||
description = "Tree (base)",
|
||||
tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
|
||||
@ -379,6 +419,7 @@ minetest.register_node("nodebox_trees:pine_trunk_base", {
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_place = minetest.rotate_node
|
||||
})
|
||||
]]
|
||||
|
||||
--original trunks
|
||||
|
||||
@ -432,39 +473,7 @@ minetest.register_node("nodebox_trees:acacia_tree", {
|
||||
on_place = minetest.rotate_node,
|
||||
})
|
||||
|
||||
--replace leaves with leaves_with_snow
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp)
|
||||
if maxp.y < -1 or maxp.y > 31000 then
|
||||
return
|
||||
end
|
||||
local needles = minetest.find_nodes_in_area(minp, maxp,
|
||||
{"default:pine_needles"})
|
||||
for n = 1, #needles do
|
||||
local pos = {x=needles[n].x, y=needles[n].y, z=needles[n].z}
|
||||
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "default:snow" then
|
||||
minetest.set_node(pos, {name="nodebox_trees:pine_needles_with_snow"})
|
||||
end
|
||||
end
|
||||
|
||||
local leaves = minetest.find_nodes_in_area(minp, maxp,
|
||||
{"default:leaves"})
|
||||
for n = 1, #leaves do
|
||||
local pos = {x=leaves[n].x, y=leaves[n].y, z=leaves[n].z}
|
||||
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "default:snow" then
|
||||
minetest.set_node(pos, {name="nodebox_trees:leaves_with_snow"})
|
||||
end
|
||||
end
|
||||
|
||||
local bush = minetest.find_nodes_in_area(minp, maxp,
|
||||
{"default:bush_leaves"})
|
||||
for n = 1, #bush do
|
||||
local pos = {x=bush[n].x, y=bush[n].y, z=bush[n].z}
|
||||
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "default:snow" then
|
||||
minetest.set_node(pos, {name="nodebox_trees:bush_leaves_with_snow"})
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
--mapgen
|
||||
|
||||
|
@ -60,6 +60,7 @@ minetest.clear_registered_decorations()
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
schematic = minetest.get_modpath("nodebox_trees") .. "/schematics/tree1.mts",
|
||||
replacements = {["nodebox_trees:trunk_base"] = "default:tree",},
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
@ -79,6 +80,7 @@ minetest.clear_registered_decorations()
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
schematic = minetest.get_modpath("nodebox_trees") .. "/schematics/tree2.mts",
|
||||
replacements = {["nodebox_trees:trunk_base"] = "default:tree",},
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
@ -98,6 +100,7 @@ minetest.clear_registered_decorations()
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
schematic = minetest.get_modpath("nodebox_trees") .. "/schematics/tree3.mts",
|
||||
replacements = {["nodebox_trees:trunk_base"] = "default:tree",},
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
@ -117,6 +120,7 @@ minetest.clear_registered_decorations()
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
schematic = minetest.get_modpath("nodebox_trees") .. "/schematics/tree4.mts",
|
||||
replacements = {["nodebox_trees:trunk_base"] = "default:tree",},
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
@ -251,6 +255,7 @@ minetest.clear_registered_decorations()
|
||||
y_min = 2,
|
||||
y_max = 31000,
|
||||
schematic = minetest.get_modpath("nodebox_trees") .. "/schematics/pine1.mts",
|
||||
replacements = {["nodebox_trees:pine_trunk_base"] = "default:pine_tree",},
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
@ -270,6 +275,7 @@ minetest.clear_registered_decorations()
|
||||
y_min = 2,
|
||||
y_max = 31000,
|
||||
schematic = minetest.get_modpath("nodebox_trees") .. "/schematics/pine2.mts",
|
||||
replacements = {["nodebox_trees:pine_trunk_base"] = "default:pine_tree",},
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
@ -289,6 +295,7 @@ minetest.clear_registered_decorations()
|
||||
y_min = 2,
|
||||
y_max = 31000,
|
||||
schematic = minetest.get_modpath("nodebox_trees") .. "/schematics/pine3.mts",
|
||||
replacements = {["nodebox_trees:pine_trunk_base"] = "default:pine_tree",},
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
@ -308,6 +315,7 @@ minetest.clear_registered_decorations()
|
||||
y_min = 2,
|
||||
y_max = 31000,
|
||||
schematic = minetest.get_modpath("nodebox_trees") .. "/schematics/pine4.mts",
|
||||
replacements = {["nodebox_trees:pine_trunk_base"] = "default:pine_tree",},
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user