Register everything under our own namespace
This commit is contained in:
@@ -7,6 +7,13 @@ stripped_tree.register_strippable_trunk("default:aspen_tree", "default:aspen_woo
|
||||
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"}
|
||||
stripped_tree.register_axes(mod_name, axe_types)
|
||||
|
||||
11
ethereal.lua
11
ethereal.lua
@@ -11,6 +11,17 @@ stripped_tree.register_strippable_trunk("ethereal:sakura_trunk", "ethereal:sakur
|
||||
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"}
|
||||
stripped_tree.register_axes(mod_name, axe_types)
|
||||
|
||||
@@ -41,14 +41,9 @@ function stripped_tree.register_strippable_trunk(trunk_name, plank_name, strippe
|
||||
if stripped_tree.stripped_pairs[trunk_name] then return end
|
||||
|
||||
local mod_name, trunk_node = unpack(trunk_name:split(":"))
|
||||
local stripped_name = ":" .. mod_name .. ":stripped_" .. trunk_node
|
||||
local stripped_ingredient_name = stripped_name
|
||||
local stripped_name = "stripped_tree:" .. mod_name .. "_stripped_" .. trunk_node
|
||||
|
||||
-- The leading colon of the stripped name is only required for node registration. For recipe ingredients it must not
|
||||
-- be there.
|
||||
if stripped_ingredient_name:sub(1, 1) == ":" then stripped_ingredient_name = stripped_ingredient_name:sub(2) end
|
||||
|
||||
stripped_tree.stripped_pairs[trunk_name] = stripped_ingredient_name
|
||||
stripped_tree.stripped_pairs[trunk_name] = stripped_name
|
||||
|
||||
local trunk_def = core.registered_nodes[trunk_name]
|
||||
local stripped_def = table.copy(trunk_def)
|
||||
@@ -74,7 +69,7 @@ function stripped_tree.register_strippable_trunk(trunk_name, plank_name, strippe
|
||||
}
|
||||
)
|
||||
|
||||
if plank_name then core.register_craft({output = plank_name .. " 4", recipe = {{stripped_ingredient_name}}}) end
|
||||
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
|
||||
|
||||
@@ -36,3 +36,23 @@ stripped_tree.register_strippable_trunk(
|
||||
"stripped_moretrees_rubber_tree_trunk.png",
|
||||
}
|
||||
)
|
||||
|
||||
-- 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")
|
||||
|
||||
21
recipes.lua
21
recipes.lua
@@ -1,19 +1,20 @@
|
||||
local S = core.get_translator(core.get_current_modname())
|
||||
|
||||
-- Register tree bark
|
||||
core.register_craftitem(":default:tree_bark", {description = S("Tree bark"), inventory_image = "tree_bark.png"})
|
||||
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 = "default:tree_bark", burntime = 15})
|
||||
core.register_craft({type = "fuel", recipe = "stripped_tree:tree_bark", burntime = 15})
|
||||
|
||||
-- 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"},
|
||||
{"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"}},
|
||||
}
|
||||
@@ -49,9 +50,9 @@ if core.get_modpath("farming") then
|
||||
{
|
||||
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"},
|
||||
{"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"},
|
||||
},
|
||||
}
|
||||
)
|
||||
@@ -65,8 +66,8 @@ if core.get_modpath("bonemeal") then
|
||||
{
|
||||
output = "bonemeal:mulch 4",
|
||||
recipe = {
|
||||
{"default:tree_bark", "default:tree_bark", "default:tree_bark"},
|
||||
{"default:tree_bark", "default:tree_bark", "default: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"},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user