From 04e4ab0c843ee0e38849d71bc2161fbca3483d03 Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Thu, 23 May 2024 22:56:54 -0400 Subject: [PATCH] translate leaves and bugfix jungle nodes near --- biome_defs.lua | 6 +++--- init.lua | 8 ++++---- node_defs.lua | 8 ++++---- tree_models.lua | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/biome_defs.lua b/biome_defs.lua index 07a3471..7e4b505 100644 --- a/biome_defs.lua +++ b/biome_defs.lua @@ -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"}, } diff --git a/init.lua b/init.lua index d370ed9..d4e9fc1 100644 --- a/init.lua +++ b/init.lua @@ -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" }) @@ -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"}) @@ -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"}) @@ -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"}) diff --git a/node_defs.lua b/node_defs.lua index 70f0e98..c061c23 100644 --- a/node_defs.lua +++ b/node_defs.lua @@ -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) @@ -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) @@ -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 @@ -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") diff --git a/tree_models.lua b/tree_models.lua index 1db353c..7824ea6 100644 --- a/tree_models.lua +++ b/tree_models.lua @@ -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,