Skip to content

Commit

Permalink
translate leaves and bugfix jungle nodes near
Browse files Browse the repository at this point in the history
  • Loading branch information
wsor4035 committed May 24, 2024
1 parent 04f12ec commit 04e4ab0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions biome_defs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ moretrees.jungletree_biome = {
seed_diff = 329,
min_elevation = 1,
near_nodes = minetest.get_modpath("default") and {"default:jungletree"} or nil,
near_nodes_size = 6,
near_nodes_vertical = 2,
near_nodes_count = 1,
near_nodes_size = minetest.get_modpath("default") and 6 or nil,
near_nodes_vertical = minetest.get_modpath("default") and 2 or nil,
near_nodes_count = minetest.get_modpath("default") and 1 or nil,
plantlife_limit = -0.9,
biomes = {"rainforest", "rainforest_swamp"},
}
Expand Down
8 changes: 4 additions & 4 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if minetest.get_modpath("default") then
description = "Wooden Planks"
})

minetest.override_item("default:leaves", {
minetest.override_item(xcompat.materials.apple_leaves, {
description = "Leaves"
})

Expand Down Expand Up @@ -315,7 +315,7 @@ function moretrees.grow_jungletree(pos)
minetest.swap_node(pos, {name = "air"})
local leaves = minetest.find_nodes_in_area(
{x = pos.x-1, y = pos.y, z = pos.z-1}, {x = pos.x+1, y = pos.y+10, z = pos.z+1},
"default:leaves"
xcompat.materials.apple_leaves
)
for leaf in ipairs(leaves) do
minetest.swap_node(leaves[leaf], {name = "air"})
Expand Down Expand Up @@ -346,7 +346,7 @@ function moretrees.grow_fir(pos)
local leaves = minetest.find_nodes_in_area(
{x = pos.x, y = pos.y, z = pos.z},
{x = pos.x, y = pos.y+5, z = pos.z},
"default:leaves"
xcompat.materials.apple_leaves
)
for leaf in ipairs(leaves) do
minetest.swap_node(leaves[leaf], {name = "air"})
Expand Down Expand Up @@ -377,7 +377,7 @@ function moretrees.grow_fir_snow(pos)
local leaves = minetest.find_nodes_in_area(
{x = pos.x, y = pos.y, z = pos.z},
{x = pos.x, y = pos.y+5, z = pos.z},
"default:leaves"
xcompat.materials.apple_leaves
)
for leaf in ipairs(leaves) do
minetest.swap_node(leaves[leaf], {name = "air"})
Expand Down
8 changes: 4 additions & 4 deletions node_defs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ end
-- redefine default leaves to handle plantlike and/or leaf decay options

if minetest.get_modpath("default") and moretrees.plantlike_leaves then
minetest.override_item("default:leaves", {
minetest.override_item(xcompat.materials.apple_leaves, {
inventory_image = minetest.inventorycube("default_leaves.png"),
drawtype = "plantlike",
visual_scale = math.sqrt(2)
Expand All @@ -234,7 +234,7 @@ end
-- redefine default jungle leaves for same

if minetest.get_modpath("default") and moretrees.plantlike_leaves then
minetest.override_item("default:jungleleaves", {
minetest.override_item(xcompat.materials.jungle_leaves, {
inventory_image = minetest.inventorycube("default_jungleleaves.png"),
drawtype = "plantlike",
visual_scale = math.sqrt(2)
Expand Down Expand Up @@ -647,7 +647,7 @@ if minetest.get_modpath("default") then

default.register_leafdecay({
trunks = { "default:jungletree", "moretrees:jungletree_trunk" },
leaves = { "default:jungleleaves", "moretrees:jungletree_leaves_yellow", "moretrees:jungletree_leaves_red" },
leaves = { xcompat.materials.jungle_leaves, "moretrees:jungletree_leaves_yellow", "moretrees:jungletree_leaves_red" },
radius = moretrees.leafdecay_radius,
})
end
Expand Down Expand Up @@ -763,7 +763,7 @@ minetest.register_alias("conifers:sapling", "moretrees:fir_sapling")
minetest.register_alias("moretrees:jungletree_sapling", "default:junglesapling")
minetest.register_alias("moretrees:jungletree_trunk_sideways", "moreblocks:horizontal_jungle_tree")
minetest.register_alias("moretrees:jungletree_planks", "default:junglewood")
minetest.register_alias("moretrees:jungletree_leaves_green", "default:jungleleaves")
minetest.register_alias("moretrees:jungletree_leaves_green", xcompat.materials.jungle_leaves)

minetest.register_alias("moretrees:acacia_trunk", "default:acacia_tree")
minetest.register_alias("moretrees:acacia_planks", "default:acacia_wood")
Expand Down
2 changes: 1 addition & 1 deletion tree_models.lua
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ moretrees.jungletree_model={
rules_a=nil,
rules_b=nil,
trunk="moretrees:jungletree_trunk",
leaves="default:jungleleaves",
leaves=xcompat.materials.jungle_leaves,
leaves2=nil,
leaves2_chance=nil,
angle=45,
Expand Down

0 comments on commit 04e4ab0

Please sign in to comment.