summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--technic/machines/register/compressor_recipes.lua23
-rw-r--r--technic/machines/register/extractor_recipes.lua29
-rw-r--r--technic/machines/register/grinder_recipes.lua18
-rw-r--r--technic/machines/register/init.lua3
-rw-r--r--technic/machines/register/recipe_defusing.lua76
5 files changed, 86 insertions, 63 deletions
diff --git a/technic/machines/register/compressor_recipes.lua b/technic/machines/register/compressor_recipes.lua
index 6952e07..f4852d3 100644
--- a/technic/machines/register/compressor_recipes.lua
+++ b/technic/machines/register/compressor_recipes.lua
@@ -64,29 +64,6 @@ end
table.insert(recipes, {"vessels:steel_bottle", "technic:lox"})
--- defuse the default sandstone recipe, since we have the compressor to take over in a
--- more realistic manner. It also uses groups instead of proper sand, which is even more
--- important, given there are many types of sand and sandstone.
--- minetest.clear_craft({
--- output = "default:sandstone",
--- recipe = {
--- {'group:sand', 'group:sand'},
--- {'group:sand', 'group:sand'}
--- },
--- })
---
--- -- provide an alternative recipe for sandstone, which demands the default sand in particular
--- -- the compressing recipe offered by technic is still offering superior performance
--- minetest.register_craft({
--- output = "default:sandstone",
--- recipe = {
--- {'default:sand', 'default:sand'},
--- {'default:sand', 'default:sand'}
--- },
--- })
--- UPD: the above changes were made obsolete by default game development
-
-
for _, data in pairs(recipes) do
technic.register_compressor_recipe({input = {data[1]}, output = data[2]})
end
diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua
index 3e82e01..366e2ae 100644
--- a/technic/machines/register/extractor_recipes.lua
+++ b/technic/machines/register/extractor_recipes.lua
@@ -101,35 +101,6 @@ if minetest.get_modpath("dye") then
end
- -- When the recipe for 4 default:sand out of 1 default:sandstone is defused in the
- -- grinder recipes, some dyed wool becomes broken. This is a known bug and it's in
- -- the game itself. However, by re-declaring the recipes for corrupted wool+dye
- -- combinations here, we can alleviate this situation. Or so it seeems.
- -- The following code snippet is abridged from wool mod in the minetest_game:
-
- if minetest.get_modpath("wool") then
-
- local dyes = {
- {"violet", "Violet", "excolor_violet"},
- {"brown", "Brown", "unicolor_dark_orange"},
- {"pink", "Pink", "unicolor_light_red"},
- {"dark_grey", "Dark Grey", "unicolor_darkgrey"},
- {"dark_green", "Dark Green", "unicolor_dark_green"},
- }
-
- for i = 1, #dyes do
- local name, desc, craft_color_group = unpack(dyes[i])
- minetest.register_craft{
- type = "shapeless",
- output = "wool:" .. name,
- recipe = {"group:dye," .. craft_color_group, "group:wool"},
- }
- end
-
- end
-
- -- end of remedial dye workaround
-
minetest.register_craft({
type = "shapeless",
diff --git a/technic/machines/register/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua
index 84fbeb7..69603ca 100644
--- a/technic/machines/register/grinder_recipes.lua
+++ b/technic/machines/register/grinder_recipes.lua
@@ -3,6 +3,7 @@ local S = technic.getter
technic.register_recipe_type("grinding", { description = S("Grinding") })
+
function technic.register_grinder_recipe(data)
data.time = data.time or 3
technic.register_recipe("grinding", data)
@@ -36,8 +37,12 @@ local recipes = {
-- Other
{"default:cobble", "default:gravel"},
{"default:gravel", "default:sand"},
- {"default:sandstone", "default:sand 2"}, -- reverse recipe can be found in the compressor
- {"technic:stone_dust", "default:silver_sand"}
+ {"technic:stone_dust", "default:silver_sand"},
+
+ -- sands: reverse recipes can be found in the compressor
+ {"default:sandstone", "default:sand 2"},
+ {"default:silver_sandstone","default:silver_sand 2"},
+ {"default:desert_sandstone","default:desert_sand 2"},
}
if minetest.get_modpath("ethereal") then
@@ -61,15 +66,6 @@ if minetest.get_modpath("moreblocks") then
end
--- defuse the sandstone -> 4 sand recipe to avoid infinite sand bugs (also consult the inverse compressor recipe)
--- this snippet, when executed, also corrupts some dye+wool combinations. A remedial
--- workaround is included in extractor recipes, since it's where we work with dyes.
-minetest.clear_craft({
- recipe = {
- {"default:sandstone"}
- }
-})
-
if minetest.get_modpath("farming") then
table.insert(recipes, {"farming:seed_wheat", "farming:flour 1"})
table.insert(recipes, {"farming:seed_barley", "farming:flour 1"})
diff --git a/technic/machines/register/init.lua b/technic/machines/register/init.lua
index 3356fe5..73b76f8 100644
--- a/technic/machines/register/init.lua
+++ b/technic/machines/register/init.lua
@@ -10,6 +10,9 @@ dofile(path.."/battery_box.lua")
dofile(path.."/solar_array.lua")
dofile(path.."/generator.lua")
+-- Defusing recipes to avoid weird loops and multiplication
+dofile(path.."/recipe_defusing.lua")
+
-- API for machines
dofile(path.."/recipes.lua")
dofile(path.."/machine_base.lua")
diff --git a/technic/machines/register/recipe_defusing.lua b/technic/machines/register/recipe_defusing.lua
new file mode 100644
index 0000000..7059d87
--- /dev/null
+++ b/technic/machines/register/recipe_defusing.lua
@@ -0,0 +1,76 @@
+
+-- defuse reverse recipes to avoid multiplication of matter
+-- the reverse functions are delegated to grinder
+
+minetest.clear_craft({
+ output = "default:sand",
+ recipe = {
+ {"default:sandstone"}
+ }
+})
+
+minetest.clear_craft({
+ output = "default:desert_sand",
+ recipe = {
+ {"default:desert_sandstone"}
+ }
+})
+
+minetest.clear_craft({
+ output = "default:silver_sand",
+ recipe = {
+ {"default:silver_sandstone"}
+ }
+})
+
+
+if minetest.get_modpath("ethereal") and ethereal.xcraft == true then
+
+ -- X pattern craft recipes (5x 'a' in X pattern gives 5 of 'b')
+ local cheat = {
+ {"default:dirt", "default:sand", 5},
+ {"ethereal:dry_dirt", "default:desert_sand", 5},
+ }
+
+ for n = 1, #cheat do
+
+ minetest.register_craft({
+ output = cheat[n][2] .. " " .. cheat[n][3],
+ recipe = {
+ {cheat[n][1], "", cheat[n][1]},
+ {"", cheat[n][1], ""},
+ {cheat[n][1], "", cheat[n][1]},
+ }
+ })
+ end
+
+end
+
+-- When the recipe for 4 default:sand out of 1 default:sandstone is defused in the
+-- grinder recipes, some dyed wool becomes broken. This is a known bug and it's in
+-- the game itself. However, by re-declaring the recipes for corrupted wool+dye
+-- combinations here, we can alleviate this situation. Or so it seeems.
+-- The following code snippet is abridged from wool mod in the minetest_game:
+
+if minetest.get_modpath("wool") then
+
+local dyes = {
+ {"violet", "Violet", "excolor_violet"},
+ {"brown", "Brown", "unicolor_dark_orange"},
+ {"pink", "Pink", "unicolor_light_red"},
+ {"dark_grey", "Dark Grey", "unicolor_darkgrey"},
+ {"dark_green", "Dark Green", "unicolor_dark_green"},
+}
+
+for i = 1, #dyes do
+ local name, desc, craft_color_group = unpack(dyes[i])
+ minetest.register_craft{
+ type = "shapeless",
+ output = "wool:" .. name,
+ recipe = {"group:dye," .. craft_color_group, "group:wool"},
+ }
+end
+
+end
+
+-- end of remedial dye workaround \ No newline at end of file