Make chisel always available
This commit is contained in:
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
Adds stripped tree trunks to minetest.
|
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.
|
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.
|
||||||
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.
|
|
||||||
|
|
||||||
You can get string and paper from bark.
|
You can get string and paper from bark.
|
||||||
|
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ stripped_tree.register_strippable_trunk("default:pine_tree", "default:pine_wood"
|
|||||||
|
|
||||||
-- Register axes
|
-- Register axes
|
||||||
local axe_types = {"axe_wood", "axe_stone", "axe_bronze", "axe_steel", "axe_mese", "axe_diamond"}
|
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
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ stripped_tree.register_strippable_trunk("ethereal:palm_trunk", "ethereal:palm_wo
|
|||||||
|
|
||||||
-- Register axes
|
-- Register axes
|
||||||
local axe_types = {"axe_crystal"}
|
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
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
local S = core.get_translator(core.get_current_modname())
|
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
|
-- Function to verify that stripped tree trunk exists
|
||||||
stripped_tree.has_stripped = function(pos)
|
stripped_tree.has_stripped = function(pos)
|
||||||
local node = core.get_node(pos).name or 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
|
end
|
||||||
|
|
||||||
-- Function to override axes
|
-- 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)
|
function stripped_tree.register_axes(mod_n, axe_types)
|
||||||
for _, axe_name in ipairs(axe_types) do
|
for _, axe_name in ipairs(axe_types) do
|
||||||
core.override_item(
|
core.override_item(
|
||||||
|
|||||||
2
init.lua
2
init.lua
@@ -1,5 +1,5 @@
|
|||||||
-- Our own mod namespace
|
-- Our own mod namespace
|
||||||
stripped_tree = {}
|
stripped_tree = {axes_strip_trees = core.settings:get_bool("stripped_tree_strip_with_axe")}
|
||||||
|
|
||||||
-- Get our own path
|
-- Get our own path
|
||||||
local mpath = core.get_modpath("stripped_tree")
|
local mpath = core.get_modpath("stripped_tree")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- Register axes
|
-- Register axes
|
||||||
local axe_types = {"axe_mithril", "axe_silver"}
|
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
|
||||||
|
|||||||
10
recipes.lua
10
recipes.lua
@@ -19,8 +19,7 @@ core.register_craft(
|
|||||||
)
|
)
|
||||||
|
|
||||||
-- Register the chisel tool if it’s enabled in the config
|
-- Register the chisel tool if it’s enabled in the config
|
||||||
if stripped_tree.enable_chisel then
|
core.register_tool(
|
||||||
core.register_tool(
|
|
||||||
"stripped_tree:chisel", {
|
"stripped_tree:chisel", {
|
||||||
description = S("Chisel for tree trunks"),
|
description = S("Chisel for tree trunks"),
|
||||||
inventory_image = "chisel.png",
|
inventory_image = "chisel.png",
|
||||||
@@ -37,12 +36,9 @@ if stripped_tree.enable_chisel then
|
|||||||
return itemstack
|
return itemstack
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
core.register_craft(
|
core.register_craft({output = "stripped_tree:chisel", recipe = {{"default:steel_ingot"}, {"screwdriver:screwdriver"}}})
|
||||||
{output = "stripped_tree:chisel", recipe = {{"default:steel_ingot"}, {"screwdriver:screwdriver"}}}
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Recipes if the farming mod is loaded
|
-- Recipes if the farming mod is loaded
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
# Choose between using axes or chisels to get the stripped trees
|
# 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
|
||||||
|
|||||||
Reference in New Issue
Block a user