diff options
-rw-r--r-- | depends.txt | 3 | ||||
-rw-r--r-- | init.lua | 63 | ||||
-rw-r--r-- | juices.lua | 25 | ||||
-rw-r--r-- | textures/freezing_icon.png | bin | 0 -> 175 bytes |
4 files changed, 82 insertions, 9 deletions
diff --git a/depends.txt b/depends.txt index 62c1b68..3919d3c 100644 --- a/depends.txt +++ b/depends.txt @@ -3,4 +3,5 @@ pipeworks? ethereal? mobs? farming? -vessels?
\ No newline at end of file +vessels? +unified_inventory?
\ No newline at end of file @@ -7,10 +7,22 @@ -- enable extra popsicle types provided there are both vessels and fruits/veggies available -- fruit + glass -> juice; juice @ freezer -> popsicle + empty glass +if minetest.get_modpath("unified_inventory") and unified_inventory.register_craft_type then + unified_inventory.register_craft_type("freezing", { + description = "Freezing", + icon = "freezing_icon.png", + width = 1, + height = 1, + uses_crafting_grid = false, + }) +end + if minetest.get_modpath("vessels") then dofile(minetest.get_modpath("freezer") .. "/juices.lua") end + + -- -- Formspecs -- @@ -130,7 +142,8 @@ local function freezer_node_timer(pos, elapsed) inv:add_item("dst", "bucket:bucket_empty") end end - + + -- an extra recipe involving liquid in a bucket, for good measure -- a cactus pulp bucket gives 2 hp, but freezing it gives 3 popsicles, each -- of them giving 1 hp, achieving 50% increase in efficiency through processing @@ -436,3 +449,51 @@ minetest.register_craft({ "default:ice" } }) + +if minetest.get_modpath("unified_inventory") and unified_inventory.register_craft then + unified_inventory.register_craft({ + type = "freezing", + output = "default:ice", + items = {"bucket:bucket_water"}, + }) + + + unified_inventory.register_craft({ + type = "freezing", + output = "default:ice", + items = {"bucket:bucket_river_water"}, + }) + + if minetest.get_modpath("ethereal") then + unified_inventory.register_craft({ + type = "freezing", + output = "freezer:cactus_popsicle 3", + items = {"ethereal:bucket_cactus"}, + }) + end + + if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" then + unified_inventory.register_craft({ + type = "freezing", + output = "freezer:milk_popsicle 3", + items = {"mobs:bucket_milk"}, + }) + end + + if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" and minetest.get_modpath("farming") then + unified_inventory.register_craft({ + type = "freezing", + output = "freezer:pelmeni_pack 3", + items = {"freezer:pelmeni_raw"}, + }) + end + + if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" and minetest.get_modpath("ethereal") then + unified_inventory.register_craft({ + type = "freezing", + output = "freezer:aspic 5", + items = {"freezer:meat_broth"}, + }) + end + +end
\ No newline at end of file @@ -17,14 +17,17 @@ -- clear the recipe for juice from farming redo for consistency's sake -minetest.clear_craft({ - output = "farming:pineapple_juice", - type = "shapeless", - recipe = {"vessels:drinking_glass", "farming:pineapple_ring", - "farming:pineapple_ring", "farming:pineapple_ring"} -}) -minetest.unregister_item("farming:pineapple_juice") +if minetest.get_modpath("farming") and farming.mod and farming.mod == "redo" then + minetest.clear_craft({ + output = "farming:pineapple_juice", + type = "shapeless", + recipe = {"vessels:drinking_glass", "farming:pineapple_ring", + "farming:pineapple_ring", "farming:pineapple_ring"} + }) + minetest.unregister_item("farming:pineapple_juice") + +end local juice_table = { orange_juice = { @@ -144,6 +147,14 @@ for juice_name, def in pairs(juice_table) do recipe = {"vessels:drinking_glass", def.found_in .. ":" .. def.obj_name}, }) + if minetest.get_modpath("unified_inventory") and unified_inventory.register_craft then + unified_inventory.register_craft({ + type = "freezing", + output = "freezer:" .. juice_name .. "_popsicle", + items = {"freezer:" .. juice_name}, + }) + end + end end diff --git a/textures/freezing_icon.png b/textures/freezing_icon.png Binary files differnew file mode 100644 index 0000000..099b9f2 --- /dev/null +++ b/textures/freezing_icon.png |