Compare commits
30 Commits
main
...
texture-re
| Author | SHA1 | Date | |
|---|---|---|---|
| 787a40378a | |||
| 0b5e21a74e | |||
| 8850f13ce0 | |||
| 17bdc7dcb2 | |||
| 5c0f544463 | |||
| 85f2a65819 | |||
| af5a16d615 | |||
| a4f537f625 | |||
| 8a2d735aa6 | |||
| 4b2ecbabfc | |||
| 53876759ff | |||
| 9fc1fbce0f | |||
| ebd6c93b54 | |||
| 88805b3220 | |||
| 990ddbfd62 | |||
| 8a0e861351 | |||
| 9fa0f17f63 | |||
| 87b6a5b070 | |||
| 89adc5fabc | |||
| bacd1320fd | |||
| e80e7555d0 | |||
| 163e22f742 | |||
| 5ad75d6189 | |||
| e73b28166e | |||
| 31b85ba7c4 | |||
| 57751d1b81 | |||
| 5029556ceb | |||
| 0184b84d19 | |||
| c9ac4229d9 | |||
| cbbedbc815 |
@@ -12,7 +12,7 @@ read_globals = {
|
||||
table = {fields = {"copy", "getn"}},
|
||||
|
||||
-- Builtin
|
||||
"minetest", "core", "vector", "ItemStack",
|
||||
"core", "vector", "ItemStack",
|
||||
"dump", "DIR_DELIM", "VoxelArea", "Settings",
|
||||
|
||||
-- MTG
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
local max_stack = tonumber(minetest.settings:get("default_stack_max")) or 99
|
||||
local S = core.get_translator(core.get_current_modname())
|
||||
|
||||
local max_stack = tonumber(core.settings:get("default_stack_max")) or 99
|
||||
|
||||
-- LuaFormatter off
|
||||
local machine_formspec = "" ..
|
||||
"size[8,9]" ..
|
||||
"label[0,0;Chiseling Machine]" ..
|
||||
"label[0,0;" .. core.formspec_escape(S("Chiseling Machine")) .. "]" ..
|
||||
"image[2,2;1,1;chisel.png]" ..
|
||||
"list[current_name;src;2,1;1,1;]" ..
|
||||
"list[current_name;dst;5,1;2,2;]" ..
|
||||
@@ -14,9 +16,9 @@ local machine_formspec = "" ..
|
||||
"listring[current_player;main]"
|
||||
-- LuaFormatter on
|
||||
|
||||
minetest.register_node(
|
||||
core.register_node(
|
||||
"stripped_tree:chiseling_machine", {
|
||||
description = "Chiseladora para troncos",
|
||||
description = S("Chiseling Machine"),
|
||||
tiles = {
|
||||
"chiseling_machine.png",
|
||||
"chiseling_machine.png",
|
||||
@@ -28,19 +30,26 @@ minetest.register_node(
|
||||
groups = {cracky = 1},
|
||||
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local meta = core.get_meta(pos)
|
||||
meta:set_string("formspec", machine_formspec)
|
||||
end,
|
||||
|
||||
on_construct = function(pos)
|
||||
local inv = minetest.get_meta(pos):get_inventory()
|
||||
local inv = core.get_meta(pos):get_inventory()
|
||||
inv:set_size("src", 1)
|
||||
inv:set_size("dst", 2)
|
||||
minetest.get_node_timer(pos):start(1.0)
|
||||
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 = minetest.get_meta(pos):get_inventory()
|
||||
local inv = core.get_meta(pos):get_inventory()
|
||||
local src_stack = inv:get_stack("src", 1)
|
||||
local dst_stack = inv:get_stack("dst", 1)
|
||||
if listname == "src" and not src_stack:is_empty() then
|
||||
@@ -48,7 +57,7 @@ minetest.register_node(
|
||||
local src_count = src_stack:get_count()
|
||||
local mod_name, node_name = unpack(src_name:split(":"))
|
||||
local stripped_name = mod_name .. ":stripped_" .. node_name
|
||||
local has_stripped = minetest.registered_nodes[stripped_name]
|
||||
local has_stripped = core.registered_nodes[stripped_name]
|
||||
local dst_count = dst_stack:get_count()
|
||||
if has_stripped and dst_count < max_stack then
|
||||
inv:add_item("dst", stripped_name .. " " .. src_count)
|
||||
@@ -69,7 +78,7 @@ minetest.register_node(
|
||||
}
|
||||
)
|
||||
|
||||
minetest.register_craft(
|
||||
core.register_craft(
|
||||
{
|
||||
output = "stripped_tree:chiseling_machine",
|
||||
recipe = {
|
||||
|
||||
65
default.lua
@@ -1,58 +1,19 @@
|
||||
-- Register tree bark
|
||||
minetest.register_craftitem(
|
||||
":default:tree_bark",
|
||||
{description = "Tree bark", inventory_image = "tree_bark.png", groups = {not_in_creative_inventory = 1}}
|
||||
)
|
||||
|
||||
-- Register bark as fuel
|
||||
minetest.register_craft({type = "fuel", recipe = "default:tree_bark", burntime = 15})
|
||||
|
||||
-- Register craft for string
|
||||
if minetest.get_modpath("farming") then
|
||||
minetest.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
|
||||
minetest.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 minetest.get_modpath("bonemeal") then
|
||||
minetest.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)
|
||||
|
||||
34
ethereal.lua
@@ -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)
|
||||
|
||||
144
functions.lua
@@ -1,102 +1,126 @@
|
||||
stripped_tree = {}
|
||||
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")
|
||||
stripped_tree.stripped_pairs = {}
|
||||
|
||||
-- Check if we are running on a creative server
|
||||
local creative_mode = minetest.settings:get_bool("creative_mode")
|
||||
function stripped_tree.has_stripped(pos)
|
||||
local node = core.get_node(pos).name
|
||||
|
||||
-- Function to verify that stripped tree trunk exists
|
||||
stripped_tree.has_stripped = function(pos)
|
||||
local node = minetest.get_node(pos).name or pos
|
||||
local mod_name, node_name = unpack(node:split(":"))
|
||||
local has_stripped = minetest.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, creative_mode)
|
||||
local old_node = minetest.get_node(pos)
|
||||
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]
|
||||
|
||||
minetest.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 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.
|
||||
if inv:room_for_item("main", "default:tree_bark") then
|
||||
inv:add_item("main", {name = "default:tree_bark"})
|
||||
else
|
||||
minetest.add_item(pos, "default:tree_bark")
|
||||
core.add_item(pos, "default:tree_bark")
|
||||
end
|
||||
end
|
||||
|
||||
return itemstack
|
||||
return tool
|
||||
end
|
||||
|
||||
-- Function to register nodes
|
||||
function stripped_tree.register_trunk(mod_name, trunk_names)
|
||||
for _, name in ipairs(trunk_names) do
|
||||
minetest.register_node(
|
||||
":" .. mod_name .. ":stripped_" .. name, {
|
||||
description = "Stripped " .. name,
|
||||
tiles = {
|
||||
"stripped_" .. mod_name .. "_" .. name .. "_top.png",
|
||||
"stripped_" .. mod_name .. "_" .. name .. "_top.png",
|
||||
"stripped_" .. mod_name .. "_" .. name .. ".png",
|
||||
-- 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 there’s 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 = trunk_name,
|
||||
recipe = {
|
||||
{"", "default:tree_bark", ""},
|
||||
{"default:tree_bark", stripped_name, "default:tree_bark"},
|
||||
{"", "default:tree_bark", ""},
|
||||
},
|
||||
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 = minetest.rotate_node,
|
||||
}
|
||||
)
|
||||
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = mod_name .. ":" .. name,
|
||||
recipe = {
|
||||
{"", "default:tree_bark", ""},
|
||||
{"default:tree_bark", mod_name .. ":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
|
||||
minetest.override_item(
|
||||
core.override_item(
|
||||
mod_n .. ":" .. axe_name, {
|
||||
on_place = 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 minetest.is_protected(pos, pname) then
|
||||
minetest.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)
|
||||
-- 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
|
||||
|
||||
75
init.lua
@@ -1,75 +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 = minetest.get_modpath("stripped_tree")
|
||||
local mpath = core.get_modpath("stripped_tree")
|
||||
|
||||
-- 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 minetest.get_modpath("moretrees") then dofile(mpath .. "/moretrees.lua") end
|
||||
|
||||
if minetest.get_modpath("ethereal") then dofile(mpath .. "/ethereal.lua") end
|
||||
|
||||
if minetest.get_modpath("moreores") then dofile(mpath .. "/moreores.lua") end
|
||||
|
||||
if stripped_tree.ENABLE_CHISEL then
|
||||
minetest.register_tool(
|
||||
"stripped_tree:chisel", {
|
||||
description = "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 minetest.is_protected(pos, pname) then
|
||||
minetest.record_protection_violation(pos, pname)
|
||||
return
|
||||
end
|
||||
|
||||
local node = minetest.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 = minetest.registered_nodes[mod_name .. ":" .. "stripped_" .. node_name]
|
||||
|
||||
if has_stripped then
|
||||
local stripped = mod_name .. ":" .. "stripped_" .. node_name
|
||||
minetest.swap_node(pos, {name = stripped})
|
||||
|
||||
if not minetest.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
|
||||
minetest.add_item(pos, "default:tree_bark")
|
||||
end
|
||||
|
||||
itemstack:add_wear(65535 / 299) -- 300 uses
|
||||
end
|
||||
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
}
|
||||
)
|
||||
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = "stripped_tree:chisel",
|
||||
recipe = {{"", "default:steel_ingot", ""}, {"", "screwdriver:screwdriver", ""}, {"", "", ""}},
|
||||
}
|
||||
)
|
||||
end
|
||||
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
|
||||
|
||||
5
locale/stripped_tree.hu.tr
Normal file
@@ -0,0 +1,5 @@
|
||||
# textdomain: stripped_tree
|
||||
Chiseling Machine=Kéregvéső Gép
|
||||
Stripped @1=Kérgezett @1
|
||||
Tree bark=Fakéreg
|
||||
Chisel for tree trunks=Kéregvéső
|
||||
5
locale/template.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
# textdomain: stripped_tree
|
||||
Chiseling Machine=
|
||||
Stripped @1=
|
||||
Tree bark=
|
||||
Chisel for tree trunks=
|
||||
2
mod.conf
@@ -1,4 +1,6 @@
|
||||
name = stripped_tree
|
||||
title = Stripped Trees
|
||||
description = Adds stripped tree trunks
|
||||
author = 1faco
|
||||
depends = default
|
||||
optional_depends = moretrees, ethereal, moreores
|
||||
|
||||
@@ -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)
|
||||
|
||||
128
moretrees.lua
@@ -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
|
||||
|
||||
minetest.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 = minetest.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",
|
||||
}
|
||||
)
|
||||
|
||||
minetest.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 = minetest.rotate_node,
|
||||
}
|
||||
)
|
||||
|
||||
minetest.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 = minetest.rotate_node,
|
||||
}
|
||||
)
|
||||
|
||||
minetest.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 = minetest.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
@@ -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 it’s 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
|
||||
@@ -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
|
||||
|
||||
BIN
textures/stripped_trees_new_default_acacia_tree.png
Normal file
|
After Width: | Height: | Size: 607 B |
BIN
textures/stripped_trees_new_default_acacia_tree_top.png
Normal file
|
After Width: | Height: | Size: 374 B |
BIN
textures/stripped_trees_new_default_aspen_tree.png
Normal file
|
After Width: | Height: | Size: 387 B |
BIN
textures/stripped_trees_new_default_aspen_tree_top.png
Normal file
|
After Width: | Height: | Size: 229 B |
BIN
textures/stripped_trees_new_default_jungletree.png
Normal file
|
After Width: | Height: | Size: 425 B |
BIN
textures/stripped_trees_new_default_jungletree_top.png
Normal file
|
After Width: | Height: | Size: 299 B |
BIN
textures/stripped_trees_new_default_pine_tree.png
Normal file
|
After Width: | Height: | Size: 562 B |
BIN
textures/stripped_trees_new_default_pine_tree_top.png
Normal file
|
After Width: | Height: | Size: 350 B |
BIN
textures/stripped_trees_new_default_tree.png
Normal file
|
After Width: | Height: | Size: 593 B |
BIN
textures/stripped_trees_new_default_tree_top.png
Normal file
|
After Width: | Height: | Size: 375 B |
BIN
textures/stripped_trees_new_ethereal_banana_trunk.png
Normal file
|
After Width: | Height: | Size: 405 B |
BIN
textures/stripped_trees_new_ethereal_banana_trunk_top.png
Normal file
|
After Width: | Height: | Size: 301 B |
BIN
textures/stripped_trees_new_ethereal_frost_tree.png
Normal file
|
After Width: | Height: | Size: 504 B |
BIN
textures/stripped_trees_new_ethereal_frost_tree_top.png
Normal file
|
After Width: | Height: | Size: 353 B |
BIN
textures/stripped_trees_new_ethereal_olive_trunk.png
Normal file
|
After Width: | Height: | Size: 499 B |
BIN
textures/stripped_trees_new_ethereal_olive_trunk_top.png
Normal file
|
After Width: | Height: | Size: 299 B |
BIN
textures/stripped_trees_new_ethereal_redwood_trunk.png
Normal file
|
After Width: | Height: | Size: 389 B |
BIN
textures/stripped_trees_new_ethereal_redwood_trunk_top.png
Normal file
|
After Width: | Height: | Size: 307 B |
BIN
textures/stripped_trees_new_ethereal_sakura_trunk.png
Normal file
|
After Width: | Height: | Size: 405 B |
BIN
textures/stripped_trees_new_ethereal_sakura_trunk_top.png
Normal file
|
After Width: | Height: | Size: 286 B |
BIN
textures/stripped_trees_new_ethereal_scorched_tree.png
Normal file
|
After Width: | Height: | Size: 516 B |
BIN
textures/stripped_trees_new_ethereal_scorched_tree_top.png
Normal file
|
After Width: | Height: | Size: 291 B |
BIN
textures/stripped_trees_new_ethereal_willow_trunk.png
Normal file
|
After Width: | Height: | Size: 285 B |
BIN
textures/stripped_trees_new_ethereal_willow_trunk_top.png
Normal file
|
After Width: | Height: | Size: 229 B |
BIN
textures/stripped_trees_new_ethereal_yellow_tree.png
Normal file
|
After Width: | Height: | Size: 595 B |
BIN
textures/stripped_trees_new_ethereal_yellow_tree_top.png
Normal file
|
After Width: | Height: | Size: 381 B |
BIN
textures/stripped_trees_new_everness_baobab_tree_side.png
Normal file
|
After Width: | Height: | Size: 442 B |
BIN
textures/stripped_trees_new_everness_baobab_tree_side_top.png
Normal file
|
After Width: | Height: | Size: 274 B |
BIN
textures/stripped_trees_new_everness_dry_tree.png
Normal file
|
After Width: | Height: | Size: 82 B |
BIN
textures/stripped_trees_new_everness_dry_tree_top.png
Normal file
|
After Width: | Height: | Size: 106 B |
BIN
textures/stripped_trees_new_everness_palm_tree_side.png
Normal file
|
After Width: | Height: | Size: 357 B |
BIN
textures/stripped_trees_new_everness_palm_tree_side_top.png
Normal file
|
After Width: | Height: | Size: 223 B |
BIN
textures/stripped_trees_new_everness_sequoia_tree_side.png
Normal file
|
After Width: | Height: | Size: 244 B |
BIN
textures/stripped_trees_new_everness_sequoia_tree_side_top.png
Normal file
|
After Width: | Height: | Size: 245 B |
BIN
textures/stripped_trees_new_everness_willow_tree_side.png
Normal file
|
After Width: | Height: | Size: 445 B |
BIN
textures/stripped_trees_new_everness_willow_tree_side_top.png
Normal file
|
After Width: | Height: | Size: 362 B |
BIN
textures/stripped_trees_new_moretrees_apple_tree_trunk.png
Normal file
|
After Width: | Height: | Size: 554 B |
BIN
textures/stripped_trees_new_moretrees_apple_tree_trunk_top.png
Normal file
|
After Width: | Height: | Size: 360 B |
BIN
textures/stripped_trees_new_moretrees_beech_trunk.png
Normal file
|
After Width: | Height: | Size: 619 B |
BIN
textures/stripped_trees_new_moretrees_beech_trunk_top.png
Normal file
|
After Width: | Height: | Size: 378 B |
BIN
textures/stripped_trees_new_moretrees_birch_trunk.png
Normal file
|
After Width: | Height: | Size: 615 B |
BIN
textures/stripped_trees_new_moretrees_birch_trunk_top.png
Normal file
|
After Width: | Height: | Size: 301 B |
BIN
textures/stripped_trees_new_moretrees_cedar_trunk.png
Normal file
|
After Width: | Height: | Size: 523 B |
BIN
textures/stripped_trees_new_moretrees_cedar_trunk_top.png
Normal file
|
After Width: | Height: | Size: 363 B |
BIN
textures/stripped_trees_new_moretrees_date_palm_trunk.png
Normal file
|
After Width: | Height: | Size: 576 B |
BIN
textures/stripped_trees_new_moretrees_date_palm_trunk_top.png
Normal file
|
After Width: | Height: | Size: 325 B |
BIN
textures/stripped_trees_new_moretrees_fir_trunk.png
Normal file
|
After Width: | Height: | Size: 587 B |
BIN
textures/stripped_trees_new_moretrees_fir_trunk_top.png
Normal file
|
After Width: | Height: | Size: 383 B |
BIN
textures/stripped_trees_new_moretrees_oak_trunk.png
Normal file
|
After Width: | Height: | Size: 567 B |
BIN
textures/stripped_trees_new_moretrees_oak_trunk_top.png
Normal file
|
After Width: | Height: | Size: 373 B |
BIN
textures/stripped_trees_new_moretrees_palm_trunk.png
Normal file
|
After Width: | Height: | Size: 488 B |
BIN
textures/stripped_trees_new_moretrees_palm_trunk_top.png
Normal file
|
After Width: | Height: | Size: 331 B |
BIN
textures/stripped_trees_new_moretrees_poplar_trunk.png
Normal file
|
After Width: | Height: | Size: 410 B |
BIN
textures/stripped_trees_new_moretrees_poplar_trunk_top.png
Normal file
|
After Width: | Height: | Size: 307 B |
BIN
textures/stripped_trees_new_moretrees_rubber_tree_trunk.png
Normal file
|
After Width: | Height: | Size: 445 B |
BIN
textures/stripped_trees_new_moretrees_rubber_tree_trunk_top.png
Normal file
|
After Width: | Height: | Size: 308 B |
BIN
textures/stripped_trees_new_moretrees_sequoia_trunk.png
Normal file
|
After Width: | Height: | Size: 380 B |
BIN
textures/stripped_trees_new_moretrees_sequoia_trunk_top.png
Normal file
|
After Width: | Height: | Size: 361 B |
BIN
textures/stripped_trees_new_moretrees_spruce_trunk.png
Normal file
|
After Width: | Height: | Size: 495 B |
BIN
textures/stripped_trees_new_moretrees_spruce_trunk_top.png
Normal file
|
After Width: | Height: | Size: 369 B |
BIN
textures/stripped_trees_new_moretrees_willow_trunk.png
Normal file
|
After Width: | Height: | Size: 430 B |
BIN
textures/stripped_trees_new_moretrees_willow_trunk_top.png
Normal file
|
After Width: | Height: | Size: 362 B |