From 89adc5fabc1a5bee15580a6c08c844778f4bf2d6 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sun, 7 Dec 2025 13:26:23 +0100 Subject: [PATCH] Register strippable trunks with the new register_strippable_trunk function --- default.lua | 7 +++- ethereal.lua | 21 +++++------ moretrees.lua | 102 +++++++++++++------------------------------------- 3 files changed, 41 insertions(+), 89 deletions(-) diff --git a/default.lua b/default.lua index b52e854..c56ff40 100644 --- a/default.lua +++ b/default.lua @@ -1,8 +1,11 @@ -- Register stripped trees local mod_name = "default" -local trunk_names = {"tree", "jungletree", "aspen_tree", "acacia_tree", "pine_tree"} -stripped_tree.register_trunk(mod_name, trunk_names) +stripped_tree.register_strippable_trunk("default:tree") +stripped_tree.register_strippable_trunk("default:jungletree") +stripped_tree.register_strippable_trunk("default:aspen_tree") +stripped_tree.register_strippable_trunk("default:acacia_tree") +stripped_tree.register_strippable_trunk("default:pine_tree") -- Register axes local axe_types = {"axe_wood", "axe_stone", "axe_bronze", "axe_steel", "axe_mese", "axe_diamond"} diff --git a/ethereal.lua b/ethereal.lua index 035cd3c..146f134 100644 --- a/ethereal.lua +++ b/ethereal.lua @@ -1,18 +1,15 @@ -- Register stripped trees local mod_name = "ethereal" -local trunk_names = { - "banana_trunk", - "birch_trunk", - "scorched_tree", - "yellow_trunk", - "willow_trunk", - "redwood_trunk", - "sakura_trunk", - "frost_tree", - "palm_trunk", -} -stripped_tree.register_trunk(mod_name, trunk_names) +stripped_tree.register_strippable_trunk("ethereal:banana_trunk") +stripped_tree.register_strippable_trunk("ethereal:birch_trunk") +stripped_tree.register_strippable_trunk("ethereal:scorched_tree") +stripped_tree.register_strippable_trunk("ethereal:yellow_trunk") +stripped_tree.register_strippable_trunk("ethereal:willow_trunk") +stripped_tree.register_strippable_trunk("ethereal:redwood_trunk") +stripped_tree.register_strippable_trunk("ethereal:sakura_trunk") +stripped_tree.register_strippable_trunk("ethereal:frost_tree") +stripped_tree.register_strippable_trunk("ethereal:palm_trunk") -- Register axes local axe_types = {"axe_crystal"} diff --git a/moretrees.lua b/moretrees.lua index 127872c..6aab98a 100644 --- a/moretrees.lua +++ b/moretrees.lua @@ -1,82 +1,34 @@ -- Register stripped trees local mod_name = "moretrees" -local trunk_names = { - "beech_trunk", - "apple_tree_trunk", - "oak_trunk", - "sequoia_trunk", - "birch_trunk", - "palm_trunk", - "date_palm_trunk", - "spruce_trunk", - "cedar_trunk", - "poplar_trunk", - "willow_trunk", - "rubber_tree_trunk", - "fir_trunk", - "jungletree_trunk", -} -stripped_tree.register_trunk(mod_name, trunk_names) +stripped_tree.register_strippable_trunk("moretrees:beech_trunk") +stripped_tree.register_strippable_trunk("moretrees:apple_tree_trunk") +stripped_tree.register_strippable_trunk("moretrees:oak_trunk") +stripped_tree.register_strippable_trunk("moretrees:sequoia_trunk") +stripped_tree.register_strippable_trunk("moretrees:birch_trunk") +stripped_tree.register_strippable_trunk("moretrees:palm_trunk") +stripped_tree.register_strippable_trunk("moretrees:date_palm_trunk") +stripped_tree.register_strippable_trunk("moretrees:spruce_trunk") +stripped_tree.register_strippable_trunk("moretrees:cedar_trunk") +stripped_tree.register_strippable_trunk("moretrees:poplar_trunk") +stripped_tree.register_strippable_trunk("moretrees:willow_trunk") +stripped_tree.register_strippable_trunk("moretrees:rubber_tree_trunk") +stripped_tree.register_strippable_trunk("moretrees:fir_trunk") +stripped_tree.register_strippable_trunk("moretrees:jungletree_trunk") -- Register tree variations using the same texture as default moretree trunks - -core.register_node( - ":" .. mod_name .. ":stripped_date_palm_mfruit_trunk", { - description = "Stripped date_palm_fruit_trunk", - tiles = { - "stripped_" .. mod_name .. "_date_palm_trunk_top.png", - "stripped_" .. mod_name .. "_date_palm_trunk_top.png", - "stripped_" .. mod_name .. "_date_palm_trunk.png", - }, - groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, not_in_creative_inventory = 1}, - sounds = default.node_sound_wood_defaults(), - paramtype2 = "facedir", - on_place = core.rotate_node, - } -) - -core.register_node( - ":" .. mod_name .. ":stripped_date_palm_ffruit_trunk", { - description = "Stripped date_palm_fruit_trunk", - tiles = { - "stripped_" .. mod_name .. "_date_palm_trunk_top.png", - "stripped_" .. mod_name .. "_date_palm_trunk_top.png", - "stripped_" .. mod_name .. "_date_palm_trunk.png", - }, - groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, not_in_creative_inventory = 1}, - sounds = default.node_sound_wood_defaults(), - paramtype2 = "facedir", - on_place = core.rotate_node, - } -) - -core.register_node( - ":" .. mod_name .. ":stripped_date_palm_fruit_trunk", { - description = "Stripped date_palm_fruit_trunk", - tiles = { - "stripped_" .. mod_name .. "_date_palm_trunk_top.png", - "stripped_" .. mod_name .. "_date_palm_trunk_top.png", - "stripped_" .. mod_name .. "_date_palm_trunk.png", - }, - groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, not_in_creative_inventory = 1}, - sounds = default.node_sound_wood_defaults(), - paramtype2 = "facedir", - on_place = core.rotate_node, - } -) - -core.register_node( - ":" .. mod_name .. ":stripped_rubber_tree_trunk_empty", { - description = "Stripped date_palm_fruit_trunk", - tiles = { - "stripped_" .. mod_name .. "_rubber_tree_trunk_top.png", - "stripped_" .. mod_name .. "_rubber_tree_trunk_top.png", - "stripped_" .. mod_name .. "_rubber_tree_trunk.png", - }, - groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, not_in_creative_inventory = 1}, - sounds = default.node_sound_wood_defaults(), - paramtype2 = "facedir", - on_place = core.rotate_node, +local palm_trunk_tiles = { + "stripped_" .. mod_name .. "_date_palm_trunk_top.png", + "stripped_" .. mod_name .. "_date_palm_trunk_top.png", + "stripped_" .. mod_name .. "_date_palm_trunk.png", +} +stripped_tree.register_strippable_trunk("moretrees:date_palm_mfruit_trunk", palm_trunk_tiles) +stripped_tree.register_strippable_trunk("moretrees:date_palm_ffruit_trunk", palm_trunk_tiles) +stripped_tree.register_strippable_trunk("moretrees:date_palm_fruit_trunk", palm_trunk_tiles) +stripped_tree.register_strippable_trunk( + "moretrees:rubber_tree_trunk_empty", { + "stripped_" .. mod_name .. "_rubber_tree_trunk_top.png", + "stripped_" .. mod_name .. "_rubber_tree_trunk_top.png", + "stripped_" .. mod_name .. "_rubber_tree_trunk.png", } )