-- =================================================================== local S if minetest.get_modpath ("intllib") then S = intllib.Getter() else S = function (s) return s end end local add_item_groups = ocutil.add_item_groups local define_item = unified_foods.define_item local item_eat = unified_foods.item_eat local mra = minetest.registered_aliases local mri = minetest.registered_items local reg_alias = ocutil.safe_register_alias local reg_craft = minetest.register_craft local reg_item = ocutil.safe_register_item local vessel_to_empty = unified_foods.vessel_to_empty local item_groups local needitem local obj, obj1, obj2 local use_rep -- =================================================================== local obj_glass = "default:glass" local obj_flute = "group:glass_flute" -- =================================================================== unified_foods.register_juice = function (lcname, n_ext, args) local satiate, heal, poison, msg, color if type (args) == "string" then satiate = args elseif type (args) == "table" then satiate = args.satiate heal = args.heal poison = args.poison msg = args.msg color = args.color else satiate = 1 end local ucname = ocutil.first_to_upper (lcname) local lcpair = lcname .. "_juice" local image = "ufoods_glass_" .. lcpair .. ".png" local item_name = "food:" .. lcpair local groups = {} groups ["food_" .. lcpair] = 1 if color ~= nil then image = "ufoods_glass_milk.png^[colorize:" .. color .. ":255^ufoods_glass_empty.png" else image = "ufoods_glass_" .. lcpair .. ".png" if ocutil.mod_image_missing (unified_foods.modname, image) then image = "ufoods_glass_generic_juice.png" end end image = image .. "^[opacity:128" needitem = define_item (item_name, { description = ucname .. " Juice" , image = image , satiate = satiate , replace = "food:glass" , heal = heal , poison = poison , msg = msg , } , groups, n_ext) reg_craft ({ type = "shapeless" , output = needitem , recipe = { "group:food_juicer" , "group:food_" .. lcname , "group:food_glass" , } , replacements = { { "group:food_juicer", "food:juicer" } , } }) reg_alias (lcpair , needitem) reg_alias (lcname .. "juice" , needitem) return needitem end local register_juice = unified_foods.register_juice -- =================================================================== needitem = reg_juice ("apple", { "mtfoods:apple_juice" }, { satiate = 2 , color = "#FFC929" , }) reg_alias ("mtfoods:apple_juice" , needitem) -- =================================================================== needitem = reg_juice ("onion", {}, { satiate = 2 , color = "#CED7B2" , }) -- =================================================================== needitem = reg_juice ("orange", { "mtfoods:orange_juice" }, { satiate = 2 , color = "#fcc510" , }) reg_alias ("oj" , needitem) reg_alias ("mtfoods:orange_juice" , needitem) -- =================================================================== needitem = reg_juice ("potato", {}, { satiate = 2 , color = "#a87d5d" , }) -- =================================================================== ocutil.add_item_groups ("default:nyancat" , { food_rainbow=1 }) ocutil.add_item_groups ("default:nyancat_rainbow" , { food_rainbow=1 }) needitem = reg_juice ("rainbow", {}, 1) -- =================================================================== needitem = define_item ("food:apple_cider", { description = "Apple Cider in Bottle" , inventory_image = "mtfoods_apple_cider.png" , satiate = 2 , } , { food_apple_cider=1 } , { "mtfoods:apple_cider" }) reg_craft ({ output = needitem , recipe = { { "" , "default:steel_ingot" , "" } , { obj_glass , "group:food_apple_juice" , obj_glass } , { obj_glass , "group:food_apple_juice" , obj_glass } , } }) reg_alias ("mtfoods:apple_cider", needitem) -- =================================================================== -- End of file.