1
0
mirror of https://github.com/mt-mods/moretrees.git synced 2024-11-15 23:10:20 +01:00

at least boot into minetest

This commit is contained in:
wsor4035 2024-03-22 21:57:57 -04:00
parent 670f7f4e61
commit 0c3fbcffe0
6 changed files with 59 additions and 52 deletions

View File

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

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 }, groups = { fleshy=3, dig_immediate=3, flammable=2, moretrees_coconut=coco_group },
inventory_image = tile.."^[transformR180", inventory_image = tile.."^[transformR180",
wield_image = tile.."^[transformR180", wield_image = tile.."^[transformR180",
sounds = default.node_sound_defaults(), sounds = xcompat.sounds.node_sound_default(),
drop = drop, drop = drop,
selection_box = { selection_box = {
type = "fixed", 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 }, groups = { fleshy=3, dig_immediate=3, flammable=2, moretrees_dates=1 },
inventory_image = "moretrees_dates_"..suffix..".png^[transformR0", inventory_image = "moretrees_dates_"..suffix..".png^[transformR0",
wield_image = "moretrees_dates_"..suffix..".png^[transformR90", wield_image = "moretrees_dates_"..suffix..".png^[transformR90",
sounds = default.node_sound_defaults(), sounds = xcompat.sounds.node_sound_default(),
drop = dropfn, drop = dropfn,
selection_box = { selection_box = {
type = "fixed", type = "fixed",

View File

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

View File

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

View File

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