better fix for tree/wood grindings

closes pandorabox-io/pandorabox.io#376
This commit is contained in:
OgelGames 2019-12-16 23:31:19 +11:00
parent a8f60af451
commit eb6a9b5149

View File

@ -17,6 +17,7 @@ local function register_tree_grinding(name, tree, wood, extract, grinding_color)
local lname = string.lower(name) local lname = string.lower(name)
lname = string.gsub(lname, ' ', '_') lname = string.gsub(lname, ' ', '_')
local grindings_name = "technic:"..lname.."_grindings" local grindings_name = "technic:"..lname.."_grindings"
if not minetest.registered_craftitems[grindings_name] then
local inventory_image = "technic_"..lname.."_grindings.png" local inventory_image = "technic_"..lname.."_grindings.png"
if grinding_color then if grinding_color then
inventory_image = inventory_image .. "^[colorize:" .. grinding_color inventory_image = inventory_image .. "^[colorize:" .. grinding_color
@ -30,6 +31,7 @@ local function register_tree_grinding(name, tree, wood, extract, grinding_color)
recipe = grindings_name, recipe = grindings_name,
burntime = 8, burntime = 8,
}) })
end
technic.register_grinder_recipe({ input = { tree }, output = grindings_name .. " 4" }) technic.register_grinder_recipe({ input = { tree }, output = grindings_name .. " 4" })
technic.register_grinder_recipe({ input = { grindings_name }, output = sawdust .. " 4" }) technic.register_grinder_recipe({ input = { grindings_name }, output = sawdust .. " 4" })
if wood then if wood then
@ -47,22 +49,32 @@ end
local rubber_tree_planks = moretrees and "moretrees:rubber_tree_planks" local rubber_tree_planks = moretrees and "moretrees:rubber_tree_planks"
local default_extract = dye and "dye:brown 2" local default_extract = dye and "dye:brown 2"
-- see: https://github.com/h-v-smacker/technic/blob/master/technic/machines/register/grindings.lua -- https://en.wikipedia.org/wiki/Catechu ancient brown dye from the wood of acacia trees
local grinding_recipes = { local acacia_extract = dye and "dye:brown 8"
{"Common Tree", "group:tree", "group:wood", default_extract },
{"Tree", "default:tree", "default:wood", default_extract },
{"Aspen", "default:aspen_tree", "default:aspen_wood", default_extract },
{"Jungletree", "default:jungletree", "default:junglewood", default_extract },
{"Pine", "default:pine_tree", "default:pine_wood", default_extract },
{"Rubber Tree", "moretrees:rubber_tree_trunk", rubber_tree_planks, "technic:raw_latex"},
{"Rubber Tree", "moretrees:rubber_tree_trunk_empty", nil, "technic:raw_latex"}
}
for _, data in pairs(grinding_recipes) do register_tree_grinding("Common Tree", "group:tree", "group:wood", default_extract)
register_tree_grinding(unpack(data)) register_tree_grinding("Common Tree", "default:tree", "default:wood", default_extract)
end register_tree_grinding("Common Tree", "default:aspen_tree", "default:aspen_wood", default_extract)
register_tree_grinding("Common Tree", "default:jungletree", "default:junglewood", default_extract)
register_tree_grinding("Common Tree", "default:pine_tree", "default: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_empty", nil, "technic:raw_latex")
if moretrees and dye then if moretrees then
-- https://en.wikipedia.org/wiki/Catechu ancient brown dye from the wood of acacia trees register_tree_grinding("Common Tree", "moretrees:beech_tree_trunk", "moretrees:beech_tree_planks", default_extract)
register_tree_grinding("Acacia", "moretrees:acacia_trunk", "moretrees:acacia_planks", "dye:brown 8") register_tree_grinding("Common Tree", "moretrees:apple_tree_trunk", "moretrees:apple_tree_planks", default_extract)
register_tree_grinding("Common Tree", "moretrees:oak_tree_trunk", "moretrees:oak_tree_planks", default_extract)
register_tree_grinding("Common Tree", "moretrees:giant_sequoia_trunk", "moretrees:giant_sequoia_planks", default_extract)
register_tree_grinding("Common Tree", "moretrees:birch_tree_trunk", "moretrees:birch_tree_planks", default_extract)
register_tree_grinding("Common Tree", "moretrees:palm_tree_trunk", "moretrees:palm_tree_planks", default_extract)
register_tree_grinding("Common Tree", "moretrees:date_palm_tree_trunk", "moretrees:date_palm_tree_planks", default_extract)
register_tree_grinding("Common Tree", "moretrees:spruce_tree_trunk", "moretrees:spruce_tree_planks", default_extract)
register_tree_grinding("Common Tree", "moretrees:ceder_tree_trunk", "moretrees:ceder_tree_planks", default_extract)
register_tree_grinding("Common Tree", "moretrees:poplar_tree_trunk", "moretrees:poplar_tree_planks", default_extract)
register_tree_grinding("Common Tree", "moretrees:wollow_tree_trunk", "moretrees:wollow_tree_planks", default_extract)
register_tree_grinding("Common Tree", "moretrees:douglas_fir_trunk", "moretrees:douglas_fir_planks", default_extract)
register_tree_grinding("Acacia", "moretrees:acacia_trunk", "moretrees:acacia_planks", acacia_extract)
else
register_tree_grinding("Acacia", "default:acacia_tree", "default:acacia_wood", acacia_extract)
end end