Skip to content

Commit

Permalink
Rewrite recipe code and add group support (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
OgelGames authored Jan 14, 2024
1 parent e77a671 commit a280a14
Show file tree
Hide file tree
Showing 5 changed files with 190 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ read_globals = {
"craftguide", "i3", "mtt",
"vizlib", "mcl_sounds", "mcl_vars",
"mcl_worlds", "mcl_buckets", "mcl_formspec",
"mcl_craftguide","exchangeclone",
"mcl_craftguide",

-- Only used in technic/machines/MV/lighting.lua (disabled)
"isprotect", "homedecor_expect_infinite_stacks",
Expand Down
24 changes: 5 additions & 19 deletions technic/machines/register/grindings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,15 @@ local function register_tree_grinding(name, tree, wood, extract, grinding_color)
end
end

local rubber_tree_planks = moretrees and "moretrees:rubber_tree_planks"
local rubber_planks = moretrees and "moretrees:rubber_tree_planks"
local default_extract = dye and "dye:brown 2"

-- https://en.wikipedia.org/wiki/Catechu ancient brown dye from the wood of acacia trees
local acacia_extract = dye and "dye:brown 8"

-- technic recipes don't support groups yet :/
--register_tree_grinding("Common Tree", "group:tree", "group:wood", default_extract)

-- Specific recipes for acacia and rubber trees
register_tree_grinding("Acacia", mat.acacia_tree, mat.acacia_wood, acacia_extract)
register_tree_grinding("Common Tree", mat.tree, mat.wood, default_extract)
register_tree_grinding("Common Tree", mat.aspen_tree, mat.aspen_wood, default_extract)
register_tree_grinding("Common Tree", mat.jungletree, mat.junglewood, default_extract)
register_tree_grinding("Common Tree", mat.pine_tree, mat.pine_wood, default_extract)
register_tree_grinding("Rubber Tree", "moretrees:rubber_tree_trunk", rubber_tree_planks, "technic:raw_latex")
register_tree_grinding("Rubber Tree", "moretrees:rubber_tree_trunk", rubber_planks, "technic:raw_latex 2")
register_tree_grinding("Rubber Tree", "moretrees:rubber_tree_trunk_empty", nil, "technic:raw_latex")

if moretrees then
local trees = {
"beech", "apple_tree", "oak", "sequoia", "birch", "palm",
"date_palm", "spruce", "cedar", "poplar", "willow", "fir"
}
for _,tree in pairs(trees) do
register_tree_grinding("Common Tree", "moretrees:"..tree.."_trunk", "moretrees:"..tree.."_planks", default_extract)
end
end
-- Group recipe for all other trees
register_tree_grinding("Common Tree", "group:tree", "group:wood", default_extract)
Loading

0 comments on commit a280a14

Please sign in to comment.