Adjust food categorizations and move some more tags to datagen

This commit is contained in:
Sollace 2024-04-02 11:27:38 +01:00
parent a87257de83
commit 4f613ebb91
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
36 changed files with 101 additions and 185 deletions

View file

@ -41,6 +41,7 @@ public interface UConventionalTags {
TagKey<Item> MUFFINS = item("muffins");
TagKey<Item> MANGOES = item("mangoes");
TagKey<Item> OATMEALS = item("oatmeals");
TagKey<Item> COOKIES = item("cookies");
TagKey<Item> FRUITS = item("fruits");
TagKey<Item> WORMS = item("worms");
@ -55,6 +56,8 @@ public interface UConventionalTags {
TagKey<Item> RAW_MEAT = item("raw_meat");
TagKey<Item> COOKED_MEAT = item("cooked_meat");
TagKey<Item> ROTTEN_MEAT = item("rotten_meat");
TagKey<Item> DESSERTS = item("desserts");
TagKey<Item> CANDY = item("candy");
TagKey<Item> CROPS_PEANUTS = item("crops/peanuts");
TagKey<Item> TOOL_KNIVES = item("tools/knives");

View file

@ -41,7 +41,10 @@ public interface UTags {
TagKey<Item> LOOT_BUG_RARE_DROPS = item("loot_bug_rare_drops");
TagKey<Item> LOOT_BUG_EPIC_DROPS = item("loot_bug_epic_drops");
TagKey<Item> SHELLS = item("food_types/shells");
TagKey<Item> SHELLS = item("shells");
TagKey<Item> SPECIAL_SHELLS = item("special_shells");
TagKey<Item> ROCK_STEWS = item("rock_stews");
TagKey<Item> BAKED_GOODS = item("baked_goods");
TagKey<Item> POLEARMS = item("polearms");
TagKey<Item> HORSE_SHOES = item("horse_shoes");

View file

@ -127,6 +127,9 @@ public class UItemTagProvider extends FabricTagProvider.ItemTagProvider {
Items.DIAMOND_PICKAXE, Items.DIAMOND_SHOVEL, Items.DIAMOND_AXE, Items.DIAMOND_SWORD, Items.DIAMOND_HOE,
UItems.DIAMOND_POLEARM
).forceAddTag(UTags.Items.BADGES).forceAddTag(ConventionalItemTags.GOLD_INGOTS);
getOrCreateTagBuilder(UTags.Items.SHELLS).add(Items.NAUTILUS_SHELL, UItems.CLAM_SHELL, UItems.SCALLOP_SHELL, UItems.TURRET_SHELL);
getOrCreateTagBuilder(UTags.Items.SPECIAL_SHELLS).add(UItems.SHELLY);
getOrCreateTagBuilder(UTags.Items.ROCK_STEWS).add(UItems.ROCK_STEW);
exportFarmersDelightItems();
}
@ -209,15 +212,31 @@ public class UItemTagProvider extends FabricTagProvider.ItemTagProvider {
getOrCreateTagBuilder(UConventionalTags.Items.SEEDS).add(Items.BEETROOT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.TORCHFLOWER_SEEDS, Items.WHEAT_SEEDS)
.add(UItems.OAT_SEEDS)
.forceAddTag(UTags.Items.APPLE_SEEDS);
getOrCreateTagBuilder(UConventionalTags.Items.COOKIES).add(Items.COOKIE, UItems.OATMEAL_COOKIE, UItems.CHOCOLATE_OATMEAL_COOKIE, UItems.PINECONE_COOKIE);
getOrCreateTagBuilder(UConventionalTags.Items.OATMEALS).add(UItems.OATMEAL);
getOrCreateTagBuilder(UConventionalTags.Items.GRAIN).add(Items.WHEAT, UItems.OATS);
getOrCreateTagBuilder(UConventionalTags.Items.NUTS).addOptionalTag(UConventionalTags.Items.CROPS_PEANUTS);
getOrCreateTagBuilder(UConventionalTags.Items.NUTS).add(UItems.BOWL_OF_NUTS)
.addOptionalTag(UConventionalTags.Items.CROPS_PEANUTS)
.forceAddTag(UConventionalTags.Items.ACORNS)
.addOptional(new Identifier("garnished", "nuts"))
.addOptional(new Identifier("garnished", "nut_mix"))
.addOptional(new Identifier("garnished", "neverable_delecacies"));
getOrCreateTagBuilder(UConventionalTags.Items.FRUITS)
.add(Items.MELON_SLICE, Items.SWEET_BERRIES, Items.GLOW_BERRIES, Items.CHORUS_FRUIT)
.add(UItems.JUICE, UItems.ZAP_APPLE, UItems.ZAP_BULB)
.forceAddTag(UConventionalTags.Items.MANGOES)
.forceAddTag(UConventionalTags.Items.PINEAPPLES)
.forceAddTag(UConventionalTags.Items.APPLES)
.forceAddTag(UConventionalTags.Items.BANANAS);
.forceAddTag(UConventionalTags.Items.BANANAS)
.addOptionalTag(new Identifier("garnished", "berries"));
getOrCreateTagBuilder(UConventionalTags.Items.DESSERTS).add(Items.CAKE, UItems.APPLE_PIE_SLICE).forceAddTag(UTags.Items.PIES);
getOrCreateTagBuilder(UConventionalTags.Items.CANDY).add(Items.SUGAR, UItems.ROCK_CANDY, UItems.CANDIED_APPLE);
getOrCreateTagBuilder(UTags.Items.BAKED_GOODS).add(
Items.BREAD, Items.COOKIE, Items.PUMPKIN_PIE,
UItems.MUFFIN, UItems.SCONE, UItems.COOKED_ZAP_APPLE, UItems.TOAST, UItems.BURNED_TOAST, UItems.JAM_TOAST, UItems.IMPORTED_OATS,
UItems.HAY_FRIES, UItems.CRISPY_HAY_FRIES, UItems.HORSE_SHOE_FRIES)
.forceAddTag(UConventionalTags.Items.OATMEALS)
.forceAddTag(UConventionalTags.Items.COOKIES);
}
private void exportFarmersDelightItems() {
@ -235,5 +254,46 @@ public class UItemTagProvider extends FabricTagProvider.ItemTagProvider {
.addOptional(new Identifier("farmersdelight", "fish_stew"))
.addOptional(new Identifier("farmersdelight", "baked_cod_stew"))
.addOptional(new Identifier("farmersdelight", "grilled_salmon"));
getOrCreateTagBuilder(UConventionalTags.Items.RAW_MEAT)
.addOptional(new Identifier("farmersdelight", "ham"));
getOrCreateTagBuilder(UConventionalTags.Items.COOKED_MEAT)
.addOptional(new Identifier("farmersdelight", "chicken_soup"))
.addOptional(new Identifier("farmersdelight", "bacon_and_eggs"))
.addOptional(new Identifier("farmersdelight", "pasta_with_meatballs"))
.addOptional(new Identifier("farmersdelight", "beef_stew"))
.addOptional(new Identifier("farmersdelight", "bone_broth"))
.addOptional(new Identifier("farmersdelight", "mutton_wrap"))
.addOptional(new Identifier("farmersdelight", "bacon_sandwich"))
.addOptional(new Identifier("farmersdelight", "hamburger"))
.addOptional(new Identifier("farmersdelight", "chicken_sandwich"))
.addOptional(new Identifier("farmersdelight", "barbecue_stick"))
.addOptional(new Identifier("farmersdelight", "smoked_ham"))
.addOptional(new Identifier("farmersdelight", "honey_glazed_ham"))
.addOptional(new Identifier("farmersdelight", "honey_glazed_ham_block"))
.addOptional(new Identifier("farmersdelight", "roast_chicken"))
.addOptional(new Identifier("farmersdelight", "roast_chicken_block"))
.addOptional(new Identifier("farmersdelight", "steak_and_potatoes"))
.addOptional(new Identifier("farmersdelight", "roasted_mutton_chops"))
.addOptional(new Identifier("farmersdelight", "pasta_with_mutton_chop"));
getOrCreateTagBuilder(UConventionalTags.Items.FRUITS)
.addOptional(new Identifier("farmersdelight", "pumpkin_slice"))
.addOptional(new Identifier("farmersdelight", "tomato"))
.addOptional(new Identifier("farmersdelight", "melon_juice"))
.addOptional(new Identifier("farmersdelight", "fruit_salad"));
getOrCreateTagBuilder(UConventionalTags.Items.DESSERTS)
.addOptional(new Identifier("farmersdelight", "sweet_berry_cheesecake"))
.addOptional(new Identifier("farmersdelight", "sweet_berry_cheesecake_slice"))
.addOptional(new Identifier("farmersdelight", "chocolate_pie_slice"))
.addOptional(new Identifier("farmersdelight", "cake_slice"))
.addOptional(new Identifier("farmersdelight", "apple_pie_slice"))
.addOptional(new Identifier("farmersdelight", "glow_berry_custard"));
getOrCreateTagBuilder(UConventionalTags.Items.COOKIES)
.addOptional(new Identifier("farmersdelight", "sweet_berry_cookie"))
.addOptional(new Identifier("farmersdelight", "honey_cookie"));
getOrCreateTagBuilder(UTags.Items.BAKED_GOODS)
.addOptional(new Identifier("farmersdelight", "wheat_dough"))
.addOptional(new Identifier("farmersdelight", "raw_pasta"))
.addOptional(new Identifier("farmersdelight", "pie_crust"))
.addOptional(new Identifier("farmersdelight", "egg_sandwich"));
}
}

View file

@ -2,10 +2,13 @@ package com.minelittlepony.unicopia.diet;
import java.util.function.Function;
import com.minelittlepony.unicopia.Debug;
import com.minelittlepony.unicopia.Unicopia;
import com.mojang.serialization.Codec;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.util.Identifier;
@ -28,6 +31,7 @@ public interface FoodGroupKey {
});
Function<TagKey<Item>, FoodGroupKey> TAG_LOOKUP = Util.memoize(tag -> {
return new FoodGroupKey() {
private boolean check;
@Override
public Identifier id() {
return tag.id();
@ -35,6 +39,13 @@ public interface FoodGroupKey {
@Override
public boolean contains(ItemStack stack) {
if (Debug.CHECK_GAME_VALUES && !check) {
check = true;
if (Registries.ITEM.getEntryList(tag).isEmpty()) {
Unicopia.LOGGER.info("Tag is empty: " + tag.id());
}
}
return stack.isIn(tag);
}
};

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/baked_goods" ],
"tags": [ "unicopia:baked_goods" ],
"food_component": {
"hunger": 1,
"saturation": 1

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/bat_ponys_delight" ],
"tags": [ "c:mangoes" ],
"food_component": {
"hunger": 1,
"saturation": 0.1

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/candy" ],
"tags": [ "c:candy" ],
"food_component": {
"hunger": 1,
"saturation": 1

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/desserts" ],
"tags": [ "c:desserts" ],
"food_component": {
"hunger": 1,
"saturation": 1

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/fruit" ],
"tags": [ "c:fruits" ],
"food_component": {
"hunger": 1,
"saturation": 1

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/cooked_meat" ],
"tags": [ "c:cooked_meat" ],
"food_component": {
"hunger": 12,
"saturation": 1.2

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/raw_meat" ],
"tags": [ "c:raw_meat" ],
"food_component": {
"hunger": 1,
"saturation": 1

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/nuts_and_seeds" ],
"tags": [ "c:grain", "c:nuts", "c:seeds" ],
"food_component": {
"hunger": 2,
"saturation": 2.5

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/pinecone" ],
"tags": [ "c:pinecones" ],
"food_component": {
"hunger": 1,
"saturation": 0.1

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/rocks" ],
"tags": [ "c:rocks", "unicopia:rock_stews" ],
"food_component": {
"hunger": 1,
"saturation": 0.1

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/cooked_sea_vegitable" ],
"tags": [ "unicopia:food_types/cooked_sea_vegitable", "c:coral_blocks" ],
"food_component": {
"hunger": 0,
"saturation": 0

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/raw_sea_vegitable" ],
"tags": [ "unicopia:food_types/raw_sea_vegitable", "c:corals", "c:coral_fans" ],
"food_component": {
"hunger": 0,
"saturation": 0

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/shells", "unicopia:food_types/shelly" ],
"tags": [ "unicopia:shells" ],
"food_component": {
"hunger": 0,
"saturation": 0

View file

@ -1,5 +1,5 @@
{
"tags": [ "unicopia:food_types/shells", "unicopia:food_types/shelly" ],
"tags": [ "unicopia:special_shells" ],
"food_component": {
"hunger": 0,
"saturation": 0

View file

@ -1,32 +0,0 @@
{
"replace": false,
"values": [
"minecraft:bread",
"minecraft:cookie",
"unicopia:muffin",
"unicopia:scone",
"#c:grain",
"unicopia:cooked_zap_apple",
"minecraft:pumpkin_pie",
"#unicopia:pies",
"unicopia:apple_pie_slice",
"unicopia:toast",
"unicopia:burned_toast",
"unicopia:jam_toast",
"unicopia:imported_oats",
"unicopia:oatmeal",
"unicopia:hay_fries",
"unicopia:crispy_hay_fries",
"unicopia:horse_shoe_fries",
"unicopia:oatmeal_cookie",
"unicopia:chocolate_oatmeal_cookie",
"unicopia:pinecone_cookie",
"unicopia:bowl_of_nuts",
{ "id": "farmersdelight:wheat_dough", "required": false },
{ "id": "farmersdelight:raw_pasta", "required": false },
{ "id": "farmersdelight:pie_crust", "required": false },
{ "id": "farmersdelight:sweet_berry_cookie", "required": false },
{ "id": "farmersdelight:honey_cookie", "required": false },
{ "id": "farmersdelight:egg_sandwich", "required": false }
]
}

View file

@ -1,8 +0,0 @@
{
"replace": false,
"values": [
"unicopia:mango",
{ "id": "#c:mango", "required": false },
{ "id": "#c:mangoes", "required": false }
]
}

View file

@ -1,10 +0,0 @@
{
"replace": false,
"values": [
"unicopia:rock_candy",
"unicopia:candied_apple",
"minecraft:sugar",
{ "id": "bakersdelight:sweet_berry_cheesecake_slice", "required": false },
{ "id": "bakersdelight:cake_slice", "required": false }
]
}

View file

@ -1,24 +0,0 @@
{
"replace": false,
"values": [
"#c:cooked_meat",
{ "id": "farmersdelight:chicken_soup", "required": false },
{ "id": "farmersdelight:bacon_and_eggs", "required": false },
{ "id": "farmersdelight:pasta_with_meatballs", "required": false },
{ "id": "farmersdelight:beef_stew", "required": false },
{ "id": "farmersdelight:bone_broth", "required": false },
{ "id": "farmersdelight:mutton_wrap", "required": false },
{ "id": "farmersdelight:bacon_sandwich", "required": false },
{ "id": "farmersdelight:hamburger", "required": false },
{ "id": "farmersdelight:chicken_sandwich", "required": false },
{ "id": "farmersdelight:barbecue_stick", "required": false },
{ "id": "farmersdelight:smoked_ham", "required": false },
{ "id": "farmersdelight:honey_glazed_ham", "required": false },
{ "id": "farmersdelight:honey_glazed_ham_block", "required": false },
{ "id": "farmersdelight:roast_chicken", "required": false },
{ "id": "farmersdelight:roast_chicken_block", "required": false },
{ "id": "farmersdelight:steak_and_potatoes", "required": false },
{ "id": "farmersdelight:roasted_mutton_chops", "required": false },
{ "id": "farmersdelight:pasta_with_mutton_chop", "required": false }
]
}

View file

@ -2,7 +2,6 @@
"replace": false,
"values": [
"minecraft:dried_kelp_block",
"minecraft:glow_lichen",
"#c:coral_blocks"
"minecraft:glow_lichen"
]
}

View file

@ -1,12 +0,0 @@
{
"replace": false,
"values": [
"minecraft:cake",
{ "id": "farmersdelight:sweet_berry_cheesecake", "required": false },
{ "id": "farmersdelight:sweet_berry_cheesecake_slice", "required": false },
{ "id": "farmersdelight:chocolate_pie_slice", "required": false },
{ "id": "farmersdelight:cake_slice", "required": false },
{ "id": "farmersdelight:apple_pie_slice", "required": false },
{ "id": "farmersdelight:glow_berry_custard", "required": false }
]
}

View file

@ -1,19 +0,0 @@
{
"replace": false,
"values": [
"#c:fruits",
"unicopia:zap_apple",
"unicopia:zap_bulb",
"unicopia:rotten_apple",
"minecraft:melon_slice",
"minecraft:sweet_berries",
"minecraft:glow_berries",
"minecraft:chorus_fruit",
"unicopia:juice",
{ "id": "farmersdelight:pumpkin_slice", "required": false },
{ "id": "farmersdelight:tomato", "required": false },
{ "id": "farmersdelight:melon_juice", "required": false },
{ "id": "farmersdelight:fruit_salad", "required": false },
{ "id": "#garnished:berries", "required": false }
]
}

View file

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"#unicopia:container_with_love"
]
}

View file

@ -1,11 +0,0 @@
{
"replace": false,
"values": [
"#c:seeds",
"#c:acorns",
"#c:nuts",
{ "id": "#garnished:nuts", "required": false },
{ "id": "#garnished:nut_mix", "required": false },
{ "id": "#garnished:neverable_delecacies", "required": false }
]
}

View file

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"#c:pinecones"
]
}

View file

@ -1,7 +0,0 @@
{
"replace": false,
"values": [
"#c:raw_meat",
{ "id": "farmersdelight:ham", "required": false }
]
}

View file

@ -5,9 +5,6 @@
"minecraft:dried_kelp",
"minecraft:seagrass",
"minecraft:sea_pickle",
"#c:corals",
"#c:coral_fans",
{ "id": "farmersdelight:melon_popsicle", "required": false },
{ "id": "farmersdelight:kelp_roll", "required": false },
{ "id": "farmersdelight:kelp_roll_slice", "required": false }
]

View file

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"unicopia:rock_stew"
]
}

View file

@ -1,11 +0,0 @@
{
"replace": false,
"values": [
"minecraft:nautilus_shell",
"unicopia:clam_shell",
"unicopia:scallop_shell",
"unicopia:turret_shell",
"minecraft:seagrass",
"minecraft:sea_pickle"
]
}

View file

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"unicopia:shelly"
]
}

View file

@ -13,7 +13,7 @@
"unicopia:hive",
"unicopia:dark_oak_stable_door",
"#c:cooked_meat",
"#unicopia:food_types/raw_meat",
"#c:raw_meat",
"#c:raw_insect",
"#c:rotten_meat",
"#unicopia:container_with_love"

View file

@ -52,6 +52,7 @@
"unicopia:imported_oats",
"unicopia:oatmeal",
"unicopia:oatmeal_cookie",
"unicopia:chocolate_oatmeal_cookie",
"unicopia:daffodil_daisy_sandwich",
"unicopia:hay_burger",
"unicopia:hay_fries",
@ -61,6 +62,7 @@
"unicopia:baited_fishing_rod",
"unicopia:worm_block",
"unicopia:muffin",
"unicopia:scone",
"unicopia:acorn",
"unicopia:pinecone",
"unicopia:pinecone_cookie",

View file

@ -2,9 +2,8 @@
"replace": false,
"values": [
"unicopia:pearl_necklace",
"minecraft:nautilus_shell",
"#unicopia:food_types/shells",
"#unicopia:food_types/shelly",
"#unicopia:shells",
"#unicopia:special_shells",
"#unicopia:food_types/raw_sea_vegitable",
"#unicopia:food_types/cooked_sea_vegitable"
]