diff --git a/Bucket_Game-branches/distinguish_meats-vs-211114a.patch b/Bucket_Game-branches/distinguish_meats-vs-211114a.patch index 1e53879..ccd8795 100644 --- a/Bucket_Game-branches/distinguish_meats-vs-211114a.patch +++ b/Bucket_Game-branches/distinguish_meats-vs-211114a.patch @@ -195,6 +195,7 @@ diff -ru Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ image = "animal_materials_egg_big.png", stack_max=5 }) +Only in Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs: animal_materials_overrides.lua diff -ru Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/depends.txt Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/depends.txt --- Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/depends.txt 2021-11-19 08:58:50.603998895 -0500 +++ Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/depends.txt 2021-11-19 08:59:12.507999446 -0500 @@ -283,23 +284,27 @@ diff -ru Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ type = "cooking" , diff -ru Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/init.lua Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/init.lua --- Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/init.lua 2021-11-19 10:08:28.704104114 -0500 -+++ Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/init.lua 2021-11-19 10:17:43.868118095 -0500 -@@ -74,8 +74,22 @@ ++++ Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/init.lua 2021-11-19 11:27:37.788223712 -0500 +@@ -73,11 +73,30 @@ + dofile (mp .. "/globals.lua" ) dofile (mp .. "/util.lua" ) ++ ++local enable_animal_materials = lua_exists("animal_materials") -- This is an object as opposed to a mob -if lua_exists ("animal_materials" ) then - dofile (mp .. "/animal_materials.lua" ) +if not minetest.get_modpath("animalmaterials") then + -- ^ another way is: if not minetest.registered_items["animalmaterials:meat_raw"] then -+ if lua_exists ("animal_materials" ) then ++ if enable_animal_materials then + dofile (mp .. "/animal_materials.lua" ) + end +else + -- Someone added the animalmaterials mod in this case, + -- so only create aliases: -+ if lua_exists ("animal_materials" ) then -+ -- ^ check for the main file only, since OldCoder may ++ if enable_animal_materials then ++ -- ^ Only consider the presence of themain file ++ -- (animal_materials.lua), since OldCoder may + -- have added that condition further up in order to + -- exclude the animal_materials namespace in + -- differently-packaged copies of bucket_game. @@ -308,7 +313,11 @@ diff -ru Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ + end end ++dofile (mp .. "/animal_materials_overrides.lua" ) ++ -- This is an object as opposed to a mob + if lua_exists ("vombie_flame" ) then + dofile (mp .. "/vombie_flame.lua" ) diff -ru Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/LICENSE Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/LICENSE --- Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/LICENSE 2021-11-19 10:08:28.836104117 -0500 +++ Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/LICENSE 2021-11-18 18:58:21.410728915 -0500 @@ -382,8 +391,8 @@ diff -ru Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ diff -ru Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ostrich.lua Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ostrich.lua --- Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ostrich.lua 2021-11-18 10:37:47.357972555 -0500 -+++ Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ostrich.lua 2021-11-18 16:14:55.810481977 -0500 -@@ -55,25 +55,30 @@ ++++ Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ostrich.lua 2021-11-19 12:22:10.444306129 -0500 +@@ -55,25 +55,37 @@ -- =================================================================== @@ -414,17 +423,25 @@ diff -ru Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ local obj_name_cooked = obj_name .. "_cooked" -local obj_name_raw = obj_name .. "_raw" ++ +-- local obj_name_raw = obj_name .. "_raw" -+-- ^ formerly codermobs:ostrich_raw (dup of animal_materials, see alias below) -+local obj_name_raw = ":animal_materials:meat_ostrich" ++-- ^ formerly codermobs:ostrich_raw (It is a dup of the one in ++-- animal_materials.lua or animalmaterials/init.lua. ++-- See the alias further down.) ++local global_obj_name_raw = "animal_materials:meat_ostrich" ++local obj_name_raw = ":" .. global_obj_name_raw ++if not minetest.get_modpath("animalmaterials") then ++ obj_name_raw = ":animalmaterials:meat_ostrich" ++end local obj_name_egg = obj_name .. "_egg" local obj_name_egg_entity = obj_name_egg .. "_entity" -@@ -319,22 +324,33 @@ +@@ -319,22 +331,36 @@ -- =================================================================== -- Raw bird. -+if not minetest.registered_items[obj_name_raw] then ++if not minetest.registered_items[global_obj_name_raw] then ++ minetest.log("warning", "ostrich.lua is registering a new "..global_obj_name_raw) + minetest.register_craftitem (obj_name_raw, { + description = "Raw " .. ucname , + inventory_image = msname_raw_img , @@ -461,10 +478,21 @@ diff -ru Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ +-- - raw craftitems are in the animalmaterials namespace, +-- - cooked versions are in the cooking namespace +-- - but cooking doesn't have ostrich ++ ++-- minetest.log("action", "ostrich.lua is registering a new "..obj_name_cooked) + minetest.register_craftitem (obj_name_cooked, { description = "Cooked " .. ucname , inventory_image = msname_cooked_img , +@@ -343,7 +369,7 @@ + + minetest.register_craft ({ + type = "cooking" , +- recipe = obj_name_raw , ++ recipe = global_obj_name_raw, + output = obj_name_cooked , + }) + Only in Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs: projects diff -ru Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/rat_better.lua Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/rat_better.lua --- Bucket_Game-base/distinguish_meats-vs-211114a/mods/codermobs/codermobs/rat_better.lua 2021-11-17 12:50:29.763997228 -0500 diff --git a/Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/animal_materials_overrides.lua b/Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/animal_materials_overrides.lua new file mode 100644 index 0000000..1c130a6 --- /dev/null +++ b/Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/animal_materials_overrides.lua @@ -0,0 +1,60 @@ + +-- Poikilos' distinguish_meats-vs-211114a patch adds this file. +-- The purpose of this file is to add recipes that are not in +-- the cooking mod in the animalmaterials modpack, nor probably. +-- anywhere else. +-- Any meats without a specific cooked version (craftitem) can +-- go here, but only use register_mystery_meat if the item would +-- look like a leg roast after cooked. +-- If the cooking mod is not present, more such cooking recipes +-- are added as well. + +local register_mystery_meat = function (meat_name) + -- This function ensures that the item can be cooked to + -- a generic meat that looks like a leg roast. + -- Therefore, only call this for raw craftitems that look + -- like that visually and don't have a specifically + -- related cooked meat craftitem. + -- This function only works when there is a cooking recipe + -- to produced generic cooked meat from group:food_meat_raw + -- (The recipe is already present in bucket_game 211114a + -- or earlier). + minetest.override_item(meat_name, { + groups = { meat=1, eatable=1, food_meat_raw = 1 }, + }) + return true +end + +local am_namespace = "animal_materials" + +if minetest.get_modpath("animalmaterials") then + am_namespace = "animalmaterials" +end + +register_mystery_meat(am_namespace..":meat_lamb") + +-- register_mystery_meat(am_namespace..":meat_ostrich") +-- ^ commented since ostrich.lua registers a specific +-- meat & recipe + +-- if not minetest.get_modpath("cooking") then +-- ^ commented for reason below: +-- Add the groups even if cooking is present, because +-- bucket_game uses the food_meat_raw group for more +-- recipes other than cooking recipes: +register_mystery_meat(am_namespace..":meat_beef") +register_mystery_meat(am_namespace..":meat_venison") +-- end + +-- Note that the following recipes not in animalmaterials:cooking are +-- also not done in this file (reason in parenthesis): +-- - egg, egg_big +-- (since recipes for them have to be registered in +-- the mod that defines the fried eggs--or in a mod that +-- depends on that mod--and there is no large fried egg though +-- distinguish_meats-vs-211114a adds a texture for it (a +-- different texture file than the patch's cooked ostrich egg)). +-- - fish_clownfish, fish_bluewhite +-- (since recipes for them have to be registered in the mod that +-- defines codersea:cookedfish--or in a mod that depends on that +-- mod) diff --git a/Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/init.lua b/Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/init.lua index 5f52f08..459dcf2 100644 --- a/Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/init.lua +++ b/Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/init.lua @@ -73,17 +73,20 @@ local textu_exists = codermobs.textu_exists dofile (mp .. "/globals.lua" ) dofile (mp .. "/util.lua" ) + +local enable_animal_materials = lua_exists("animal_materials") -- This is an object as opposed to a mob if not minetest.get_modpath("animalmaterials") then -- ^ another way is: if not minetest.registered_items["animalmaterials:meat_raw"] then - if lua_exists ("animal_materials" ) then + if enable_animal_materials then dofile (mp .. "/animal_materials.lua" ) end else -- Someone added the animalmaterials mod in this case, -- so only create aliases: - if lua_exists ("animal_materials" ) then - -- ^ check for the main file only, since OldCoder may + if enable_animal_materials then + -- ^ Only consider the presence of themain file + -- (animal_materials.lua), since OldCoder may -- have added that condition further up in order to -- exclude the animal_materials namespace in -- differently-packaged copies of bucket_game. @@ -92,6 +95,8 @@ else end end +dofile (mp .. "/animal_materials_overrides.lua" ) + -- This is an object as opposed to a mob if lua_exists ("vombie_flame" ) then dofile (mp .. "/vombie_flame.lua" ) diff --git a/Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ostrich.lua b/Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ostrich.lua index 259fa98..cf7eb6b 100644 --- a/Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ostrich.lua +++ b/Bucket_Game-branches/distinguish_meats-vs-211114a/mods/codermobs/codermobs/ostrich.lua @@ -76,9 +76,16 @@ local msname_egg_fried_img = msname_egg_fried .. ".png" local msname_egg_img = msname_egg .. ".png" local obj_name_cooked = obj_name .. "_cooked" + -- local obj_name_raw = obj_name .. "_raw" --- ^ formerly codermobs:ostrich_raw (dup of animal_materials, see alias below) -local obj_name_raw = ":animal_materials:meat_ostrich" +-- ^ formerly codermobs:ostrich_raw (It is a dup of the one in +-- animal_materials.lua or animalmaterials/init.lua. +-- See the alias further down.) +local global_obj_name_raw = "animal_materials:meat_ostrich" +local obj_name_raw = ":" .. global_obj_name_raw +if not minetest.get_modpath("animalmaterials") then + obj_name_raw = ":animalmaterials:meat_ostrich" +end local obj_name_egg = obj_name .. "_egg" local obj_name_egg_entity = obj_name_egg .. "_entity" @@ -324,7 +331,8 @@ minetest.register_craft ({ -- =================================================================== -- Raw bird. -if not minetest.registered_items[obj_name_raw] then +if not minetest.registered_items[global_obj_name_raw] then + minetest.log("warning", "ostrich.lua is registering a new "..global_obj_name_raw) minetest.register_craftitem (obj_name_raw, { description = "Raw " .. ucname , inventory_image = msname_raw_img , @@ -351,6 +359,8 @@ minetest.register_alias("codermobs:ostrich_raw", "animal_materials:meat_ostrich" -- - cooked versions are in the cooking namespace -- - but cooking doesn't have ostrich +-- minetest.log("action", "ostrich.lua is registering a new "..obj_name_cooked) + minetest.register_craftitem (obj_name_cooked, { description = "Cooked " .. ucname , inventory_image = msname_cooked_img , @@ -359,7 +369,7 @@ minetest.register_craftitem (obj_name_cooked, { minetest.register_craft ({ type = "cooking" , - recipe = obj_name_raw , + recipe = global_obj_name_raw, output = obj_name_cooked , })