Compare commits

30 Commits

Author SHA1 Message Date
787a40378a Recreate textures using the original trunk tops
Some checks are pending
build / build (push) Waiting to run
2025-12-16 19:04:34 +01:00
0b5e21a74e Make it possible to pick up items when a chisel is held in hand 2025-12-16 11:26:12 +01:00
8850f13ce0 Make sure we call nodes’ on_rightclick handler when holding an axe 2025-12-16 11:26:12 +01:00
17bdc7dcb2 Register everything under our own namespace 2025-12-16 11:26:12 +01:00
5c0f544463 Store trunk/stripped trunk pairs in a global table 2025-12-16 11:26:11 +01:00
85f2a65819 Replace the bucket of water with an empty bucket in the paper recipe 2025-12-09 21:42:30 +01:00
af5a16d615 Make the chiseling machine undiggable if its inventory is not empty 2025-12-09 21:42:30 +01:00
a4f537f625 Make the register_axes function always available
It’s still a no-op if the required setting is disabled, but it removes some strain from the Lua interpreter by being
unconditionally available.
2025-12-09 21:42:30 +01:00
8a2d735aa6 Make chisel always available 2025-12-09 21:42:29 +01:00
4b2ecbabfc Move the mod’s namespace table to init.lua 2025-12-09 19:13:25 +01:00
53876759ff Add Hungarian translation 2025-12-09 19:13:25 +01:00
9fc1fbce0f Make strings translatable 2025-12-09 19:13:25 +01:00
ebd6c93b54 Use the same function when stripping with a chisel or an axe 2025-12-09 19:13:25 +01:00
88805b3220 Use is_creative_enabled to check for creative mode 2025-12-09 19:13:24 +01:00
990ddbfd62 Use stripped_tree.has_stripped with the chisel tool 2025-12-09 19:13:24 +01:00
8a0e861351 Use stripped_tree.swap_node with the chisel tool 2025-12-09 19:13:24 +01:00
9fa0f17f63 Make it possible to craft planks from stripped trunks 2025-12-09 15:03:30 +01:00
87b6a5b070 Make stripped logs identical to unstripped ones except the name and tiles 2025-12-09 15:03:30 +01:00
89adc5fabc Register strippable trunks with the new register_strippable_trunk function 2025-12-09 15:03:30 +01:00
bacd1320fd Move the trunk registration process to a separate function 2025-12-09 15:03:30 +01:00
e80e7555d0 Move our own recipes into a separate file 2025-12-09 15:03:30 +01:00
163e22f742 Rename ENABLE_CHISEL to enable_chisel 2025-12-09 15:03:30 +01:00
5ad75d6189 Add tree bark to the creative inventory 2025-12-09 15:03:30 +01:00
e73b28166e Make recipe definitions more compact 2025-12-09 15:03:29 +01:00
31b85ba7c4 Use core instead of minetest
`core` is the preferred object to use, existing since Minetest 0.4 or something; `minetest` is just a backwards
compatibility alias for it.
2025-12-09 15:03:29 +01:00
57751d1b81 Add title and description to mod.conf 2025-12-09 15:03:29 +01:00
5029556ceb Change the name of the chiseling machine to English 2025-12-09 15:03:29 +01:00
0184b84d19 Pass the current tool to the stripped_tree.swap_node function 2025-12-09 15:03:29 +01:00
c9ac4229d9 Fix a bug that prevents log stripping with an axe 2025-12-09 15:03:29 +01:00
cbbedbc815 Rename the creative_mode parameter of swap_node to avoid global shadowing
Some checks are pending
build / build (push) Waiting to run
build / build (pull_request) Waiting to run
2025-12-09 15:03:29 +01:00
73 changed files with 277 additions and 286 deletions

View File

@@ -2,9 +2,8 @@
Adds stripped tree trunks to minetest.
You can choose between use axes or chisel to get the stripped trees, chisel is enabled by default but you can disable it using the `stripped_tree_enable_chisel` game setting.
If you are using a chisel just left click on the trunk. if you are using axes you get the stripped log with right click.
Stripping is done with the Chisel tool (`stripped_tree:chisel`). If the setting `stripped_tree_strip_with_axe` is
enabled, axes can also be used as their secondary use.
You can get string and paper from bark.

View File

@@ -41,6 +41,13 @@ core.register_node(
core.get_node_timer(pos):start(1.0)
end,
can_dig = function(pos)
local meta = core.get_meta(pos)
local inv = meta:get_inventory()
return inv:is_empty("dst") and inv:is_empty("src")
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
local inv = core.get_meta(pos):get_inventory()
local src_stack = inv:get_stack("src", 1)

View File

@@ -1,58 +1,19 @@
-- Register tree bark
core.register_craftitem(
":default:tree_bark",
{description = "Tree bark", inventory_image = "tree_bark.png", groups = {not_in_creative_inventory = 1}}
)
-- Register bark as fuel
core.register_craft({type = "fuel", recipe = "default:tree_bark", burntime = 15})
-- Register craft for string
if core.get_modpath("farming") then
core.register_craft(
{
output = "farming:string 4",
recipe = {
{"default:tree_bark", "default:tree_bark", "default:tree_bark"},
{"default:tree_bark", "default:tree_bark", "default:tree_bark"},
{"default:tree_bark", "default:tree_bark", "default:tree_bark"},
},
}
)
end
-- Register craft for paper
core.register_craft(
{
output = "default:paper 8",
recipe = {
{"default:tree_bark", "default:tree_bark", "default:tree_bark"},
{"default:tree_bark", "bucket:bucket_water", "default:tree_bark"},
{"default:tree_bark", "default:tree_bark", "default:tree_bark"},
},
}
)
-- Register craft for mulch
if core.get_modpath("bonemeal") then
core.register_craft(
{
output = "bonemeal:mulch 4",
recipe = {
{"default:tree_bark", "default:tree_bark", "default:tree_bark"},
{"default:tree_bark", "default:tree_bark", "default:tree_bark"},
{"", "", ""},
},
}
)
end
-- 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", "default:wood")
stripped_tree.register_strippable_trunk("default:jungletree", "default:junglewood")
stripped_tree.register_strippable_trunk("default:aspen_tree", "default:aspen_wood")
stripped_tree.register_strippable_trunk("default:acacia_tree", "default:acacia_wood")
stripped_tree.register_strippable_trunk("default:pine_tree", "default:pine_wood")
-- Register aliases for legacy node names
core.register_alias("default:stripped_tree", "stripped_tree:default_stripped_tree")
core.register_alias("default:stripped_jungletree", "stripped_tree:default_stripped_jungletree")
core.register_alias("default:stripped_aspen_tree", "stripped_tree:default_stripped_aspen_tree")
core.register_alias("default:stripped_acacia_tree", "stripped_tree:default_stripped_acacia_tree")
core.register_alias("default:stripped_pine_tree", "stripped_tree:default_stripped_pine_tree")
-- Register axes
local axe_types = {"axe_wood", "axe_stone", "axe_bronze", "axe_steel", "axe_mese", "axe_diamond"}
if not stripped_tree.ENABLE_CHISEL then stripped_tree.register_axes(mod_name, axe_types) end
stripped_tree.register_axes(mod_name, axe_types)

View File

@@ -1,19 +1,27 @@
-- 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", "ethereal:banana_wood")
stripped_tree.register_strippable_trunk("ethereal:birch_trunk", "ethereal:birch_wood")
stripped_tree.register_strippable_trunk("ethereal:scorched_tree", "ethereal:scorched_wood")
stripped_tree.register_strippable_trunk("ethereal:yellow_trunk", "ethereal:yellow_wood")
stripped_tree.register_strippable_trunk("ethereal:willow_trunk", "ethereal:willow_wood")
stripped_tree.register_strippable_trunk("ethereal:redwood_trunk", "ethereal:redwood_wood")
stripped_tree.register_strippable_trunk("ethereal:sakura_trunk", "ethereal:sakura_wood")
stripped_tree.register_strippable_trunk("ethereal:frost_tree", "ethereal:frost_wood")
stripped_tree.register_strippable_trunk("ethereal:palm_trunk", "ethereal:palm_wood")
-- Register aliases for legacy node names
core.register_alias("ethereal:stripped_banana_trunk", "stripped_tree:ethereal_stripped_banana_trunk")
core.register_alias("ethereal:stripped_birch_trunk", "stripped_tree:ethereal_stripped_birch_trunk")
core.register_alias("ethereal:stripped_scorched_tree", "stripped_tree:ethereal_stripped_scorched_tree")
core.register_alias("ethereal:stripped_yellow_trunk", "stripped_tree:ethereal_stripped_yellow_trunk")
core.register_alias("ethereal:stripped_willow_trunk", "stripped_tree:ethereal_stripped_willow_trunk")
core.register_alias("ethereal:stripped_redwood_trunk", "stripped_tree:ethereal_stripped_redwood_trunk")
core.register_alias("ethereal:stripped_sakura_trunk", "stripped_tree:ethereal_stripped_sakura_trunk")
core.register_alias("ethereal:stripped_frost_tree", "stripped_tree:ethereal_stripped_frost_tree")
core.register_alias("ethereal:stripped_palm_trunk", "stripped_tree:ethereal_stripped_palm_trunk")
-- Register axes
local axe_types = {"axe_crystal"}
if not stripped_tree.ENABLE_CHISEL then stripped_tree.register_axes(mod_name, axe_types) end
stripped_tree.register_axes(mod_name, axe_types)

View File

@@ -1,32 +1,27 @@
local S = core.get_translator(core.get_current_modname())
stripped_tree = {}
stripped_tree.stripped_pairs = {}
-- Select between chisel tool or axes.
stripped_tree.ENABLE_CHISEL = core.settings:get_bool("stripped_tree_enable_chisel")
function stripped_tree.has_stripped(pos)
local node = core.get_node(pos).name
-- Check if we are running on a creative server
local creative_mode = core.settings:get_bool("creative_mode")
-- Function to verify that stripped tree trunk exists
stripped_tree.has_stripped = function(pos)
local node = core.get_node(pos).name or pos
local mod_name, node_name = unpack(node:split(":"))
local has_stripped = core.registered_nodes[mod_name .. ":" .. "stripped_" .. node_name]
return has_stripped
return stripped_tree.stripped_pairs[node]
end
-- Function to swap nodes
stripped_tree.swap_node = function(pos, user, in_creative_mode, tool)
local old_node = core.get_node(pos).name
local mod_name, node_name = unpack(old_node:split(":"))
local stripped = mod_name .. ":" .. "stripped_" .. node_name
--
-- The third parameter is a placeholder for backwards compatibility
stripped_tree.swap_node = function(pos, user, _, tool)
local old_node = core.get_node(pos)
local stripped_name = stripped_tree.stripped_pairs[old_node.name]
core.swap_node(pos, {name = stripped, param2 = old_node.param2})
-- TODO: Maybe we could log an error here
if not stripped_name then return end
core.swap_node(pos, {name = stripped_name, param2 = old_node.param2})
-- itemstack:add_wear(65535 / 299) this is not useful at moment.
if not in_creative_mode then
if not core.is_creative_enabled(user:get_player_name()) then
local inv = user:get_inventory()
-- If the player has room in their inventory for a bark, give them one; otherwise, drop the bark to the ground.
@@ -40,46 +35,70 @@ stripped_tree.swap_node = function(pos, user, in_creative_mode, tool)
return tool
end
-- Function to register nodes
function stripped_tree.register_trunk(mod_name, trunk_names)
for _, name in ipairs(trunk_names) do
core.register_node(
":" .. mod_name .. ":stripped_" .. name, {
description = S("Stripped @1", name),
tiles = {
"stripped_" .. mod_name .. "_" .. name .. "_top.png",
"stripped_" .. mod_name .. "_" .. name .. "_top.png",
"stripped_" .. mod_name .. "_" .. name .. ".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,
-- Function to register a single strippable trunk
function stripped_tree.register_strippable_trunk(trunk_name, plank_name, stripped_tiles)
-- If we have already registered this trunk theres no need to do anything
if stripped_tree.stripped_pairs[trunk_name] then return end
local mod_name, trunk_node = unpack(trunk_name:split(":"))
local stripped_name = "stripped_tree:" .. mod_name .. "_stripped_" .. trunk_node
stripped_tree.stripped_pairs[trunk_name] = stripped_name
local trunk_def = core.registered_nodes[trunk_name]
local stripped_def = table.copy(trunk_def)
stripped_def.description = S("Stripped @1", trunk_def.description)
stripped_def.groups = table.copy(trunk_def.groups)
stripped_def.groups.not_in_creative_inventory = 1
stripped_def.tiles = stripped_tiles or {
mod_name .. "_" .. trunk_node .. "_top.png^stripped_trees_new_" .. mod_name .. "_" .. trunk_node .. "_top.png",
mod_name .. "_" .. trunk_node .. "_top.png^stripped_trees_new_" .. mod_name .. "_" .. trunk_node .. "_top.png",
"stripped_trees_new_" .. mod_name .. "_" .. trunk_node .. ".png",
}
)
core.register_node(stripped_name, stripped_def)
core.register_craft(
{
output = mod_name .. ":" .. name,
output = trunk_name,
recipe = {
{"", "default:tree_bark", ""},
{"default:tree_bark", mod_name .. ":stripped_" .. name, "default:tree_bark"},
{"default:tree_bark", stripped_name, "default:tree_bark"},
{"", "default:tree_bark", ""},
},
}
)
if plank_name then core.register_craft({output = plank_name .. " 4", recipe = {{stripped_name}}}) end
end
-- Compatibility function from the previous version, able to register multiple stripped tree nodes at once
function stripped_tree.register_trunk(mod_name, trunk_names)
for _, name in ipairs(trunk_names) do stripped_tree.register_strippable_trunk(mod_name .. ":" .. name) end
end
function stripped_tree.maybe_strip_trunk(pos, player, tool, wear)
local player_name = player:get_player_name()
if core.is_protected(pos, player_name) then
core.record_protection_violation(pos, player_name)
return
end
wear = wear and tonumber(wear)
if stripped_tree.has_stripped(pos) then
stripped_tree.swap_node(pos, player, nil, tool)
if not core.is_creative_enabled(player_name) and wear and wear ~= 0 then tool:add_wear(wear) end
end
end
-- Function to override axes
if stripped_tree.ENABLE_CHISEL ~= true then
function stripped_tree.register_axes(mod_n, axe_types)
function stripped_tree.register_axes(mod_n, axe_types)
if stripped_tree.axes_strip_trees ~= true then return end
for _, axe_name in ipairs(axe_types) do
core.override_item(
mod_n .. ":" .. axe_name, {
@@ -87,19 +106,21 @@ if stripped_tree.ENABLE_CHISEL ~= true then
if pointed_thing.type ~= "node" then return end
local pos = pointed_thing.under
local pname = user:get_player_name()
if core.is_protected(pos, pname) then
core.record_protection_violation(pos, pname)
return
end
-- TODO: Add wear to the axe, but it should depend on the material maybe?
stripped_tree.maybe_strip_trunk(pos, user, itemstack)
if stripped_tree.has_stripped(pos) then
stripped_tree.swap_node(pos, user, creative_mode, itemstack)
-- Taken from VoxelGarden
local node = core.get_node_or_nil(pos)
if not node then return end
local node_def = core.registered_nodes[node.name]
if node_def and node_def.on_rightclick then
return node_def.on_rightclick(pos, node, user, itemstack, pointed_thing)
end
end,
}
)
end
end
end

View File

@@ -1,77 +1,20 @@
-- Our own mod namespace
stripped_tree = {axes_strip_trees = core.settings:get_bool("stripped_tree_strip_with_axe")}
-- Get our own path
local mpath = core.get_modpath("stripped_tree")
local S = core.get_translator(core.get_current_modname())
-- Load functions
dofile(mpath .. "/functions.lua")
-- Load our own recipes
dofile(mpath .. "/recipes.lua")
-- Load default (AKA the Minetest game)
dofile(mpath .. "/default.lua")
dofile(mpath .. "/chiseling_machine.lua")
-- Load optional dependencies
if core.get_modpath("moretrees") then dofile(mpath .. "/moretrees.lua") end
if core.get_modpath("ethereal") then dofile(mpath .. "/ethereal.lua") end
if core.get_modpath("moreores") then dofile(mpath .. "/moreores.lua") end
if stripped_tree.ENABLE_CHISEL then
core.register_tool(
"stripped_tree:chisel", {
description = S("Chisel for tree trunks"),
inventory_image = "chisel.png",
wield_image = "chisel.png",
sound = {breaks = "default_tool_breaks"},
stack_max = 1,
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type ~= "node" then return end
local pos = pointed_thing.under
local pname = user:get_player_name()
if core.is_protected(pos, pname) then
core.record_protection_violation(pos, pname)
return
end
local node = core.get_node(pos).name
local mod_name, node_name = unpack(node:split(":"))
-- Before concatenating check for nil
if not mod_name then return end
if not node_name then return end
local has_stripped = core.registered_nodes[mod_name .. ":" .. "stripped_" .. node_name]
if has_stripped then
local stripped = mod_name .. ":" .. "stripped_" .. node_name
core.swap_node(pos, {name = stripped})
if not core.settings:get_bool("creative_mode") then
local inv = user:get_inventory()
-- Check for room in inv, if not, drop item
if inv:room_for_item("main", "default:tree_bark") then
inv:add_item("main", {name = "default:tree_bark"})
else
core.add_item(pos, "default:tree_bark")
end
itemstack:add_wear(65535 / 299) -- 300 uses
end
return itemstack
end
end,
}
)
core.register_craft(
{
output = "stripped_tree:chisel",
recipe = {{"", "default:steel_ingot", ""}, {"", "screwdriver:screwdriver", ""}, {"", "", ""}},
}
)
end

View File

@@ -1,5 +0,0 @@
# textdomain: stripped_tree
Chiseling Machine=Cinceladora para troncos
Stripped @1=@1 cincelado
Tree bark=Corteza de árbol
Chisel for tree trunks=Cincel de tronco

View File

@@ -1,4 +1,4 @@
-- Register axes
local axe_types = {"axe_mithril", "axe_silver"}
if not stripped_tree.ENABLE_CHISEL then stripped_tree.register_axes("moreores", axe_types) end
stripped_tree.register_axes("moreores", axe_types)

View File

@@ -1,82 +1,58 @@
-- 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", "moretrees:beech_planks")
stripped_tree.register_strippable_trunk("moretrees:apple_tree_trunk", "moretrees:apple_tree_planks")
stripped_tree.register_strippable_trunk("moretrees:oak_trunk", "moretrees:oak_planks")
stripped_tree.register_strippable_trunk("moretrees:sequoia_trunk", "moretrees:sequoia_planks")
stripped_tree.register_strippable_trunk("moretrees:birch_trunk", "moretrees:birch_planks")
stripped_tree.register_strippable_trunk("moretrees:palm_trunk", "moretrees:palm_planks")
stripped_tree.register_strippable_trunk("moretrees:date_palm_trunk", "moretrees:date_palm_planks")
stripped_tree.register_strippable_trunk("moretrees:spruce_trunk", "moretrees:spruce_planks")
stripped_tree.register_strippable_trunk("moretrees:cedar_trunk", "moretrees:cedar_planks")
stripped_tree.register_strippable_trunk("moretrees:poplar_trunk", "moretrees:poplar_planks")
stripped_tree.register_strippable_trunk("moretrees:willow_trunk", "moretrees:willow_planks")
stripped_tree.register_strippable_trunk("moretrees:rubber_tree_trunk", "moretrees:rubber_tree_planks")
stripped_tree.register_strippable_trunk("moretrees:fir_trunk", "moretrees:fir_planks")
stripped_tree.register_strippable_trunk("moretrees:jungletree_trunk", "default:junglewood")
-- 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,
local date_palm_trunk_tiles = {
"stripped_moretrees_date_palm_trunk_top.png",
"stripped_moretrees_date_palm_trunk_top.png",
"stripped_moretrees_date_palm_trunk.png",
}
stripped_tree.register_strippable_trunk(
"moretrees:date_palm_mfruit_trunk", "moretrees:date_palm_planks", date_palm_trunk_tiles
)
stripped_tree.register_strippable_trunk(
"moretrees:date_palm_ffruit_trunk", "moretrees:date_palm_planks", date_palm_trunk_tiles
)
stripped_tree.register_strippable_trunk(
"moretrees:date_palm_fruit_trunk", "moretrees:date_palm_planks", date_palm_trunk_tiles
)
stripped_tree.register_strippable_trunk(
"moretrees:rubber_tree_trunk_empty", "moretrees:rubber_tree_planks", {
"stripped_moretrees_rubber_tree_trunk_top.png",
"stripped_moretrees_rubber_tree_trunk_top.png",
"stripped_moretrees_rubber_tree_trunk.png",
}
)
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,
}
)
-- Register aliases for legacy node names
core.register_alias("moretrees:stripped_beech_trunk", "stripped_tree:moretrees_stripped_beech_trunk")
core.register_alias("moretrees:stripped_apple_tree_trunk", "stripped_tree:moretrees_stripped_apple_tree_trunk")
core.register_alias("moretrees:stripped_oak_trunk", "stripped_tree:moretrees_stripped_oak_trunk")
core.register_alias("moretrees:stripped_sequoia_trunk", "stripped_tree:moretrees_stripped_sequoia_trunk")
core.register_alias("moretrees:stripped_birch_trunk", "stripped_tree:moretrees_stripped_birch_trunk")
core.register_alias("moretrees:stripped_palm_trunk", "stripped_tree:moretrees_stripped_palm_trunk")
core.register_alias("moretrees:stripped_date_palm_trunk", "stripped_tree:moretrees_stripped_date_palm_trunk")
core.register_alias("moretrees:stripped_spruce_trunk", "stripped_tree:moretrees_stripped_spruce_trunk")
core.register_alias("moretrees:stripped_cedar_trunk", "stripped_tree:moretrees_stripped_cedar_trunk")
core.register_alias("moretrees:stripped_poplar_trunk", "stripped_tree:moretrees_stripped_poplar_trunk")
core.register_alias("moretrees:stripped_willow_trunk", "stripped_tree:moretrees_stripped_willow_trunk")
core.register_alias("moretrees:stripped_rubber_tree_trunk", "stripped_tree:moretrees_stripped_rubber_tree_trunk")
core.register_alias("moretrees:stripped_fir_trunk", "stripped_tree:moretrees_stripped_fir_trunk")
core.register_alias("moretrees:stripped_jungletree_trunk", "stripped_tree:moretrees_stripped_jungletree_trunk")
core.register_alias("moretrees:stripped_date_palm_mfruit_trunk", "stripped_tree:moretrees_stripped_date_palm_mfruit_trunk")
core.register_alias("moretrees:stripped_date_palm_ffruit_trunk", "stripped_tree:moretrees_stripped_date_palm_ffruit_trunk")
core.register_alias("moretrees:stripped_date_palm_fruit_trunk", "stripped_tree:moretrees_stripped_date_palm_fruit_trunk")
core.register_alias("moretrees:stripped_rubber_tree_trunk_empty", "stripped_tree:moretrees_stripped_rubber_tree_trunk_empty")

79
recipes.lua Normal file
View File

@@ -0,0 +1,79 @@
local S = core.get_translator(core.get_current_modname())
-- Register tree bark
core.register_craftitem("stripped_tree:tree_bark", {description = S("Tree bark"), inventory_image = "tree_bark.png"})
core.register_alias("default:tree_bark", "stripped_tree:tree_bark")
-- Register bark as fuel
core.register_craft({type = "fuel", recipe = "stripped_tree:tree_bark", burntime = 15})
-- Register craft for paper
core.register_craft(
{
output = "default:paper 8",
recipe = {
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
{"stripped_tree:tree_bark", "bucket:bucket_water", "stripped_tree:tree_bark"},
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
},
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}},
}
)
-- Register the chisel tool if its enabled in the config
core.register_tool(
"stripped_tree:chisel", {
description = S("Chisel for tree trunks"),
inventory_image = "chisel.png",
wield_image = "chisel.png",
sound = {breaks = "default_tool_breaks"},
stack_max = 1,
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type == "object" then
pointed_thing.ref:punch(user, 1.0, { full_punch_interval=1.0}, nil)
return user:get_wielded_item()
end
if pointed_thing.type ~= "node" then return end
local pos = pointed_thing.under
stripped_tree.maybe_strip_trunk(pos, user, itemstack, 65535 / 299)
return itemstack
end,
}
)
core.register_craft({output = "stripped_tree:chisel", recipe = {{"default:steel_ingot"}, {"screwdriver:screwdriver"}}})
-- Recipes if the farming mod is loaded
-- Register craft for string
if core.get_modpath("farming") then
core.register_craft(
{
output = "farming:string 4",
recipe = {
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
},
}
)
end
-- Recipes if the bonemeal mod is loaded
-- Register craft for mulch
if core.get_modpath("bonemeal") then
core.register_craft(
{
output = "bonemeal:mulch 4",
recipe = {
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
},
}
)
end

View File

@@ -1,2 +1,4 @@
# Choose between using axes or chisels to get the stripped trees
stripped_tree_enable_chisel (Enable Chisel) bool true
stripped_tree_enable_chisel (Enable Chisel [deprecated]) bool true
# If axes should be able to strip trees
stripped_tree_strip_with_axe (Strip trees with axes) bool false

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B