1
0
mirror of https://github.com/mt-mods/moretrees.git synced 2024-11-15 23:10:20 +01:00
This commit is contained in:
wsor4035 2024-03-23 02:08:28 +00:00 committed by GitHub
commit 7a9b889a39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 62 additions and 55 deletions

View File

@ -21,8 +21,8 @@ read_globals = {
string = {fields = {"split"}},
table = {fields = {"copy", "getn"}},
"biome_lib",
"stairsplus",
"stairs",
"doors",
"xcompat",
}

View File

@ -9,7 +9,7 @@ moretrees.beech_biome = {
}
moretrees.palm_biome = {
surface = "default:sand",
surface = xcompat.materials.sand,
avoid_nodes = moretrees.avoidnodes,
avoid_radius = 5,
seed_diff = 330,
@ -25,7 +25,7 @@ moretrees.palm_biome = {
}
moretrees.date_palm_biome = {
surface = "default:desert_sand",
surface = xcompat.materials.desert_sand,
avoid_nodes = moretrees.avoidnodes,
avoid_radius = 10,
seed_diff = 339,
@ -42,7 +42,7 @@ moretrees.date_palm_biome = {
}
moretrees.date_palm_biome_2 = {
surface = "default:desert_sand",
surface = xcompat.materials.desert_sand,
avoid_nodes = moretrees.avoidnodes,
avoid_radius = 10,
seed_diff = 340,

View File

@ -181,7 +181,7 @@ for _,suffix in ipairs({"_0", "_1", "_2", "_3", ""}) do
groups = { fleshy=3, dig_immediate=3, flammable=2, moretrees_coconut=coco_group },
inventory_image = tile.."^[transformR180",
wield_image = tile.."^[transformR180",
sounds = default.node_sound_defaults(),
sounds = xcompat.sounds.node_sound_default(),
drop = drop,
selection_box = {
type = "fixed",

View File

@ -727,7 +727,7 @@ for _,suffix in ipairs({"f0", "f1", "f2", "f3", "f4", "m0", "fn", "n"}) do
groups = { fleshy=3, dig_immediate=3, flammable=2, moretrees_dates=1 },
inventory_image = "moretrees_dates_"..suffix..".png^[transformR0",
wield_image = "moretrees_dates_"..suffix..".png^[transformR90",
sounds = default.node_sound_defaults(),
sounds = xcompat.sounds.node_sound_default(),
drop = dropfn,
selection_box = {
type = "fixed",

View File

@ -15,29 +15,31 @@
moretrees = {}
minetest.override_item("default:sapling", {
description = "Sapling"
})
if minetest.get_modpath("default") then
minetest.override_item("default:sapling", {
description = "Sapling"
})
minetest.override_item("default:tree", {
description = "Tree"
})
minetest.override_item("default:tree", {
description = "Tree"
})
minetest.override_item("default:wood", {
description = "Wooden Planks"
})
minetest.override_item("default:wood", {
description = "Wooden Planks"
})
minetest.override_item("default:leaves", {
description = "Leaves"
})
minetest.override_item("default:leaves", {
description = "Leaves"
})
minetest.override_item("default:fence_wood", {
description = "Wooden Fence"
})
minetest.override_item("default:fence_wood", {
description = "Wooden Fence"
})
minetest.override_item("default:fence_rail_wood", {
description = "Wooden Fence Rail"
})
minetest.override_item("default:fence_rail_wood", {
description = "Wooden Fence Rail"
})
end
if minetest.get_modpath("doors") then
minetest.override_item("doors:gate_wood_closed", {

View File

@ -1,4 +1,4 @@
name = moretrees
depends = default, vessels
optional_depends = doors, stairs, moreblocks, farming
depends = xcompat
optional_depends = doors, stairs, moreblocks, farming, default, vessels
min_minetest_version = 5.2.0

View File

@ -280,7 +280,7 @@ for i in ipairs(moretrees.treelist) do
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
sounds = xcompat.sounds.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
})
@ -289,7 +289,7 @@ for i in ipairs(moretrees.treelist) do
tiles = {"moretrees_"..treename.."_wood.png"},
is_ground_content = false,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
sounds = xcompat.sounds.node_sound_wood_defaults(),
})
local moretrees_leaves_inventory_image = nil
@ -311,7 +311,7 @@ for i in ipairs(moretrees.treelist) do
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = 1},
sounds = default.node_sound_leaves_defaults(),
sounds = xcompat.sounds.node_sound_leaves_defaults(),
drop = {
max_items = 1,
@ -365,7 +365,7 @@ for i in ipairs(moretrees.treelist) do
},
moretrees.treedesc[treename].trunk_stair,
moretrees.treedesc[treename].trunk_slab,
default.node_sound_wood_defaults()
xcompat.sounds.node_sound_wood_defaults()
)
stairs.register_stair_and_slab(
@ -375,13 +375,13 @@ for i in ipairs(moretrees.treelist) do
{ "moretrees_"..treename.."_wood.png" },
moretrees.treedesc[treename].planks_stair,
moretrees.treedesc[treename].planks_slab,
default.node_sound_wood_defaults()
xcompat.sounds.node_sound_wood_defaults()
)
end
end
if moretrees.enable_fences then
if minetest.get_modpath("default") and moretrees.enable_fences then
local planks_name = "moretrees:" .. treename .. "_planks"
local planks_tile = "moretrees_" .. treename .. "_wood.png"
default.register_fence("moretrees:" .. treename .. "_fence", {
@ -393,7 +393,7 @@ for i in ipairs(moretrees.treelist) do
"^default_fence_overlay.png^[makealpha:255,126,126",
material = planks_name,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults()
sounds = xcompat.sounds.node_sound_wood_defaults()
})
default.register_fence_rail("moretrees:" .. treename .. "_fence_rail", {
description = moretrees.treedesc[treename].fence_rail,
@ -404,7 +404,7 @@ for i in ipairs(moretrees.treelist) do
"^default_fence_rail_overlay.png^[makealpha:255,126,126",
material = planks_name,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults()
sounds = xcompat.sounds.node_sound_wood_defaults()
})
if minetest.global_exists("doors") then
doors.register_fencegate("moretrees:" .. treename .. "_gate", {
@ -438,7 +438,7 @@ for i in ipairs(moretrees.treelist) do
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = regular_groups,
sounds = default.node_sound_defaults(),
sounds = xcompat.sounds.node_sound_default(),
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"moretrees:" ..treename.. "_sapling",
@ -497,7 +497,7 @@ for i in ipairs(moretrees.treelist) do
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = ongen_groups,
sounds = default.node_sound_defaults(),
sounds = xcompat.sounds.node_sound_default(),
drop = "moretrees:"..treename.."_sapling",
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
@ -549,7 +549,7 @@ for i in ipairs(moretrees.treelist) do
fixed = selbox
},
groups = {fleshy=3,dig_immediate=3,flammable=2, attached_node=1, leafdecay = 1, leafdecay_drop = 1},
sounds = default.node_sound_defaults(),
sounds = xcompat.sounds.node_sound_default(),
after_place_node = function(pos, placer)
if placer:is_player() then
minetest.set_node(pos, {name = "moretrees:"..fruit, param2 = 1})
@ -560,7 +560,8 @@ for i in ipairs(moretrees.treelist) do
if treename ~= "jungletree"
and treename ~= "poplar_small"
and treename ~= "pine" then
and treename ~= "pine"
and minetest.get_modpath("default") then
default.register_leafdecay({
trunks = { "moretrees:"..treename.."_trunk" },
leaves = { "moretrees:"..treename.."_leaves", fruitname },
@ -632,22 +633,24 @@ for color = 1, #jungleleaves do
{items = {"moretrees:jungletree_leaves_"..jungleleaves[color]} }
}
},
sounds = default.node_sound_leaves_defaults(),
sounds = xcompat.sounds.node_sound_leaves_defaults(),
})
end
-- To get Moretrees to generate its own jungle trees among the default mapgen
-- we need our own copy of that node, which moretrees will match against.
local jungle_tree = table.copy(minetest.registered_nodes["default:jungletree"])
jungle_tree.drop = "default:jungletree"
minetest.register_node("moretrees:jungletree_trunk", jungle_tree)
if minetest.get_modpath("default") then
local jungle_tree = table.copy(minetest.registered_nodes["default:jungletree"])
jungle_tree.drop = "default:jungletree"
minetest.register_node("moretrees:jungletree_trunk", jungle_tree)
default.register_leafdecay({
trunks = { "default:jungletree", "moretrees:jungletree_trunk" },
leaves = { "default:jungleleaves", "moretrees:jungletree_leaves_yellow", "moretrees:jungletree_leaves_red" },
radius = moretrees.leafdecay_radius,
})
default.register_leafdecay({
trunks = { "default:jungletree", "moretrees:jungletree_trunk" },
leaves = { "default:jungleleaves", "moretrees:jungletree_leaves_yellow", "moretrees:jungletree_leaves_red" },
radius = moretrees.leafdecay_radius,
})
end
-- Extra needles for firs
@ -674,17 +677,19 @@ minetest.register_node("moretrees:fir_leaves_bright", {
{items = {'moretrees:fir_leaves_bright'} }
}
},
sounds = default.node_sound_leaves_defaults()
sounds = xcompat.sounds.node_sound_leaves_defaults()
})
default.register_leafdecay({
trunks = { "moretrees:fir_trunk" },
leaves = { "moretrees:fir_leaves", "moretrees:fir_leaves_bright" },
radius = moretrees.leafdecay_radius,
})
if minetest.get_modpath("default") then
default.register_leafdecay({
trunks = { "moretrees:fir_trunk" },
leaves = { "moretrees:fir_leaves", "moretrees:fir_leaves_bright" },
radius = moretrees.leafdecay_radius,
})
end
if moretrees.enable_redefine_apple then
if minetest.get_modpath("default") and moretrees.enable_redefine_apple then
local appledef = table.copy(minetest.registered_nodes["default:apple"])
appledef.groups.attached_node = 1
minetest.register_node(":default:apple", appledef)
@ -712,7 +717,7 @@ minetest.register_node("moretrees:rubber_tree_trunk_empty", {
"moretrees_rubber_tree_trunk_empty.png"
},
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
sounds = xcompat.sounds.node_sound_wood_defaults(),
paramtype2 = "facedir",
is_ground_content = false,
on_place = minetest.rotate_node,