Make chisel always available

This commit is contained in:
2025-12-09 14:44:26 +01:00
parent 4b2ecbabfc
commit 8a2d735aa6
8 changed files with 26 additions and 32 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

@@ -9,4 +9,4 @@ stripped_tree.register_strippable_trunk("default:pine_tree", "default:pine_wood"
-- 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
if stripped_tree.axes_strip_trees then stripped_tree.register_axes(mod_name, axe_types) end

View File

@@ -13,4 +13,4 @@ stripped_tree.register_strippable_trunk("ethereal:palm_trunk", "ethereal:palm_wo
-- Register axes
local axe_types = {"axe_crystal"}
if not stripped_tree.enable_chisel then stripped_tree.register_axes(mod_name, axe_types) end
if stripped_tree.axes_strip_trees then stripped_tree.register_axes(mod_name, axe_types) end

View File

@@ -1,8 +1,5 @@
local S = core.get_translator(core.get_current_modname())
-- Select between chisel tool or axes.
stripped_tree.enable_chisel = core.settings:get_bool("stripped_tree_enable_chisel")
-- Function to verify that stripped tree trunk exists
stripped_tree.has_stripped = function(pos)
local node = core.get_node(pos).name or pos
@@ -98,7 +95,7 @@ function stripped_tree.maybe_strip_trunk(pos, player, tool, wear)
end
-- Function to override axes
if stripped_tree.enable_chisel ~= true then
if stripped_tree.axes_strip_trees then
function stripped_tree.register_axes(mod_n, axe_types)
for _, axe_name in ipairs(axe_types) do
core.override_item(

View File

@@ -1,5 +1,5 @@
-- Our own mod namespace
stripped_tree = {}
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")

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
if stripped_tree.axes_strip_trees then stripped_tree.register_axes("moreores", axe_types) end

View File

@@ -19,8 +19,7 @@ core.register_craft(
)
-- Register the chisel tool if its enabled in the config
if stripped_tree.enable_chisel then
core.register_tool(
core.register_tool(
"stripped_tree:chisel", {
description = S("Chisel for tree trunks"),
inventory_image = "chisel.png",
@@ -37,12 +36,9 @@ if stripped_tree.enable_chisel then
return itemstack
end,
}
)
)
core.register_craft(
{output = "stripped_tree:chisel", recipe = {{"default:steel_ingot"}, {"screwdriver:screwdriver"}}}
)
end
core.register_craft({output = "stripped_tree:chisel", recipe = {{"default:steel_ingot"}, {"screwdriver:screwdriver"}}})
-- Recipes if the farming mod is loaded

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