summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--technic/machines/register/centrifuge_recipes.lua4
-rw-r--r--technic/machines/register/extractor_recipes.lua4
-rw-r--r--technic/machines/register/grindings.lua64
-rw-r--r--technic/machines/register/init.lua3
4 files changed, 67 insertions, 8 deletions
diff --git a/technic/machines/register/centrifuge_recipes.lua b/technic/machines/register/centrifuge_recipes.lua
index 32a0de2..05642f5 100644
--- a/technic/machines/register/centrifuge_recipes.lua
+++ b/technic/machines/register/centrifuge_recipes.lua
@@ -10,14 +10,10 @@ function technic.register_separating_recipe(data)
technic.register_recipe("separating", data)
end
-local rubber_tree_planks = minetest.get_modpath("moretrees") and "moretrees:rubber_tree_planks" or "default:wood"
-
local recipes = {
{ "technic:bronze_dust 4", "technic:copper_dust 3", "technic:tin_dust" },
{ "technic:stainless_steel_dust 4", "technic:wrought_iron_dust 3", "technic:chromium_dust" },
{ "technic:brass_dust 3", "technic:copper_dust 2", "technic:zinc_dust" },
- { "moretrees:rubber_tree_trunk_empty", rubber_tree_planks.." 4", "technic:raw_latex" },
- { "moretrees:rubber_tree_trunk", rubber_tree_planks.." 4", "technic:raw_latex" },
}
local function uranium_dust(p)
diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua
index dffabb1..772770c 100644
--- a/technic/machines/register/extractor_recipes.lua
+++ b/technic/machines/register/extractor_recipes.lua
@@ -11,8 +11,6 @@ end
local recipes = {
-- Rubber
{"technic:raw_latex", "technic:rubber 3"},
- {"moretrees:rubber_tree_trunk_empty", "technic:rubber"},
- {"moretrees:rubber_tree_trunk", "technic:rubber"},
}
for _, data in pairs(recipes) do
@@ -38,8 +36,6 @@ if minetest.get_modpath("dye") then
{"flowers:viola", "dye:violet 4"},
{"bushes:blackberry", unifieddyes and "unifieddyes:magenta_s50 4" or "dye:violet 4"},
{"bushes:blueberry", unifieddyes and "unifieddyes:magenta_s50 4" or "dye:magenta 4"},
- -- https://en.wikipedia.org/wiki/Catechu ancient brown dye from the wood of acacia trees
- {"moretrees:acacia_trunk", "dye:brown 8"},
}
for _, data in ipairs(dye_recipes) do
diff --git a/technic/machines/register/grindings.lua b/technic/machines/register/grindings.lua
new file mode 100644
index 0000000..38d5ce9
--- /dev/null
+++ b/technic/machines/register/grindings.lua
@@ -0,0 +1,64 @@
+local S = technic.getter
+local moretrees = minetest.get_modpath("moretrees")
+local mesecons_materials = minetest.get_modpath("mesecons_materials")
+local dye = minetest.get_modpath("dye")
+
+-- sawdust, the finest wood/tree grinding
+local sawdust = "technic:sawdust"
+minetest.register_craftitem(sawdust, {
+ description = S("Sawdust"),
+ inventory_image = "technic_sawdust.png",
+ on_place_on_ground = minetest.craftitem_place_item,
+})
+minetest.register_craft({ type = "fuel", recipe = sawdust, burntime = 6 })
+technic.register_compressor_recipe({ input = {sawdust .. " 4"}, output = "default:wood" })
+
+-- tree/wood grindings
+local function register_tree_grinding(name, tree, wood, extract, grinding_color)
+ local lname = string.lower(name)
+ lname = string.gsub(lname, ' ', '_')
+ local grindings_name = "technic:"..lname.."_grindings"
+ local inventory_image = "technic_"..lname.."_grindings.png"
+ if grinding_color then
+ inventory_image = inventory_image .. "^[colorize:" .. grinding_color
+ end
+ minetest.register_craftitem(grindings_name, {
+ description = S("%s Grinding"):format(S(name)),
+ inventory_image = inventory_image,
+ on_place_on_ground = minetest.craftitem_place_item,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = grindings_name,
+ burntime = 8,
+ })
+ technic.register_grinder_recipe({ input = { tree }, output = grindings_name .. " 4" })
+ technic.register_grinder_recipe({ input = { grindings_name }, output = sawdust .. " 4" })
+ if wood then
+ technic.register_grinder_recipe({ input = { wood }, output = grindings_name })
+ end
+ if extract then
+ technic.register_extractor_recipe({ input = { grindings_name .. " 4" }, output = extract})
+ technic.register_separating_recipe({
+ input = { grindings_name .. " 4" },
+ output = { sawdust .. " 4", extract }
+ })
+ end
+end
+
+local rubber_tree_planks = moretrees and "moretrees:rubber_tree_planks"
+local default_extract = dye and "dye:brown 2"
+
+local grinding_recipes = {
+ {"Common Tree", "group:tree", "group:wood", default_extract },
+ {"Rubber Tree", "moretrees:rubber_tree_trunk", rubber_tree_planks, "technic:raw_latex"}
+}
+
+for _, data in pairs(grinding_recipes) do
+ register_tree_grinding(unpack(data))
+end
+
+if moretrees and dye then
+ -- https://en.wikipedia.org/wiki/Catechu ancient brown dye from the wood of acacia trees
+ register_tree_grinding("Acacia", "moretrees:acacia_trunk", "moretrees:acacia_planks", "dye:brown 8")
+end
diff --git a/technic/machines/register/init.lua b/technic/machines/register/init.lua
index 3cf373d..1667d75 100644
--- a/technic/machines/register/init.lua
+++ b/technic/machines/register/init.lua
@@ -21,6 +21,9 @@ dofile(path.."/extractor_recipes.lua")
dofile(path.."/compressor_recipes.lua")
dofile(path.."/centrifuge_recipes.lua")
+-- Multi-Machine Recipes
+dofile(path.."/grindings.lua")
+
-- Machines
dofile(path.."/alloy_furnace.lua")
dofile(path.."/electric_furnace.lua")