diff --git a/README.md b/README.md index 9fc1018..3e0000e 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/default.lua b/default.lua index 873d542..b941fd7 100644 --- a/default.lua +++ b/default.lua @@ -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 diff --git a/ethereal.lua b/ethereal.lua index 1c117d6..0dcf8dc 100644 --- a/ethereal.lua +++ b/ethereal.lua @@ -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 diff --git a/functions.lua b/functions.lua index 9d2f039..a4d3593 100644 --- a/functions.lua +++ b/functions.lua @@ -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( diff --git a/init.lua b/init.lua index 4774bdb..500d135 100644 --- a/init.lua +++ b/init.lua @@ -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") diff --git a/moreores.lua b/moreores.lua index 58cc969..4ae1870 100644 --- a/moreores.lua +++ b/moreores.lua @@ -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 diff --git a/recipes.lua b/recipes.lua index f7d2630..782b426 100644 --- a/recipes.lua +++ b/recipes.lua @@ -19,30 +19,26 @@ core.register_craft( ) -- Register the chisel tool if it’s enabled in the config -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 +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 pos = pointed_thing.under - stripped_tree.maybe_strip_trunk(pos, user, itemstack, 65535 / 299) + stripped_tree.maybe_strip_trunk(pos, user, itemstack, 65535 / 299) - return itemstack - end, - } - ) + 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 diff --git a/settingtypes.txt b/settingtypes.txt index d5ae3b1..09570bd 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -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