diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UModelProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UModelProvider.java index 64bbc4be..1c58e4f7 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UModelProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UModelProvider.java @@ -57,7 +57,7 @@ public class UModelProvider extends FabricModelProvider { public void generateItemModels(ItemModelGenerator itemModelGenerator) { ItemModels.register(itemModelGenerator, UItems.ACORN, UItems.APPLE_PIE_HOOF, UItems.APPLE_PIE_SLICE, UItems.APPLE_PIE, - UItems.BANANA, UItems.BOTCHED_GEM, UItems.BROKEN_SUNGLASSES, UItems.BURNED_JUICE, UItems.BURNED_TOAST, + UItems.BANANA, UItems.BOTCHED_GEM, UItems.BOWL_OF_NUTS, UItems.BROKEN_SUNGLASSES, UItems.BURNED_JUICE, UItems.BURNED_TOAST, UItems.CARAPACE, UItems.CLAM_SHELL, UItems.COOKED_ZAP_APPLE, UItems.CLOUD_LUMP, UItems.CRISPY_HAY_FRIES, UItems.CRYSTAL_HEART, UItems.CRYSTAL_SHARD, UItems.DAFFODIL_DAISY_SANDWICH, UItems.DRAGON_BREATH_SCROLL, UItems.EMPTY_JAR, @@ -69,8 +69,8 @@ public class UModelProvider extends FabricModelProvider { UItems.JAM_TOAST, UItems.JUICE, UItems.LIGHTNING_JAR, UItems.MANGO, UItems.MUFFIN, - UItems.OATMEAL, - UItems.PEBBLES, UItems.PEGASUS_FEATHER, UItems.PINECONE, UItems.PINEAPPLE_CROWN, + UItems.OATMEAL, UItems.OATMEAL_COOKIE, + UItems.PEBBLES, UItems.PEGASUS_FEATHER, UItems.PINECONE, UItems.PINECONE_COOKIE, UItems.PINEAPPLE_CROWN, UItems.RAIN_CLOUD_JAR, UItems.ROCK_STEW, UItems.ROCK, UItems.ROTTEN_APPLE, UItems.SALT_CUBE, UItems.SCALLOP_SHELL, UItems.SHELLY, UItems.SOUR_APPLE_SEEDS, UItems.SOUR_APPLE, UItems.SPELLBOOK, UItems.STORM_CLOUD_JAR, UItems.SWEET_APPLE_SEEDS, UItems.SWEET_APPLE, diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UBlockAdditionsLootTableProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UBlockAdditionsLootTableProvider.java index 9788e234..4663bd66 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UBlockAdditionsLootTableProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UBlockAdditionsLootTableProvider.java @@ -11,6 +11,7 @@ import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.data.server.loottable.BlockLootTableGenerator; import net.minecraft.enchantment.Enchantments; +import net.minecraft.item.ItemConvertible; import net.minecraft.loot.LootPool; import net.minecraft.loot.LootTable; import net.minecraft.loot.condition.LootCondition; @@ -54,18 +55,29 @@ public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvid addVanillaDrop(Blocks.PODZOL, block -> wormDrops(block, 4, 0.06F, 0.062222223F, 0.065F, 0.077777776F, 0.2F)); addVanillaDrop(Blocks.DIAMOND_ORE, this::crystalShardDrops); addVanillaDrop(Blocks.DEEPSLATE_DIAMOND_ORE, this::crystalShardDrops); + addVanillaDrop(Blocks.OAK_LEAVES, block -> chanceDropWithShears(block, UItems.ACORN, GEMSTONES_FORTUNE_CHANCE)); + addVanillaDrop(Blocks.SPRUCE_LEAVES, block -> chanceDropWithShears(block, UItems.PINECONE, GEMSTONES_FORTUNE_CHANCE)); } private void addVanillaDrop(Block block, Function lootTableFunction) { lootTables.put(new Identifier("unicopiamc", block.getLootTableId().getPath()), lootTableFunction.apply(block)); } + public LootTable.Builder chanceDropWithShears(Block block, ItemConvertible drop, float...chance) { + return LootTable.builder() + .pool(LootPool.builder() + .rolls(ConstantLootNumberProvider.create(1)) + .conditionally(WITHOUT_SILK_TOUCH.and(WITH_SHEARS)) + .with(chanceDrops(block, drop, 1, chance)) + ); + } + public LootTable.Builder wormDrops(Block block, int max, float...chance) { return LootTable.builder() .pool(LootPool.builder() .rolls(ConstantLootNumberProvider.create(1)) .conditionally(WITHOUT_SILK_TOUCH) - .with(wheatwormDrops(block, max, chance)) + .with(chanceDrops(block, UItems.WHEAT_WORMS, max, chance)) ); } @@ -75,7 +87,7 @@ public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvid .rolls(ConstantLootNumberProvider.create(1)) .conditionally(WITHOUT_SILK_TOUCH) .with(gemstoneDrops(block, 0.1F)) - .with(wheatwormDrops(block, max, chance)) + .with(chanceDrops(block, UItems.WHEAT_WORMS, max, chance)) ); } @@ -111,16 +123,14 @@ public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvid .conditionally(TableBonusLootCondition.builder(Enchantments.FORTUNE, GEMSTONES_FORTUNE_CHANCE)); } - public LootPoolEntry.Builder wheatwormDrops(Block block, int max, float...chance) { - return applyExplosionDecay(block, ItemEntry.builder(UItems.WHEAT_WORMS) + public LootPoolEntry.Builder chanceDrops(Block block, ItemConvertible drop, int max, float...chance) { + return applyExplosionDecay(block, ItemEntry.builder(drop) .apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(1, max))) ) .conditionally(TableBonusLootCondition.builder(Enchantments.FORTUNE, chance)); } - public static LootTable.Builder dropsWithGemfinding(Block drop, LootPoolEntry.Builder child) { return BlockLootTableGenerator.drops(drop, WITHOUT_SILK_TOUCH_AND_GEM_FINDER, child); } - } diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/URecipeProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/URecipeProvider.java index ed82fb66..57340e26 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/URecipeProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/URecipeProvider.java @@ -315,6 +315,17 @@ public class URecipeProvider extends FabricRecipeProvider { .input(UItems.ROCK, 3).criterion(hasItem(UItems.ROCK), conditionsFromItem(UItems.ROCK)) .input(Items.BOWL) .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.BOWL_OF_NUTS) + .input(UItems.ACORN, 3).criterion(hasItem(UItems.ACORN), conditionsFromItem(UItems.ACORN)) + .input(Items.BOWL) + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.OATMEAL_COOKIE) + .input(UItems.OATS, 3).criterion(hasItem(UItems.OATS), conditionsFromItem(UItems.OATS)) + .offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.PINECONE_COOKIE) + .input(UItems.PINECONE).criterion(hasItem(UItems.PINECONE), conditionsFromItem(UItems.PINECONE)) + .input(Items.WHEAT, 2) + .offerTo(exporter); ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.ROCK_CANDY, 3) .input(Items.SUGAR, 6).criterion(hasItem(Items.SUGAR), conditionsFromItem(Items.SUGAR)) .input(UItems.PEBBLES, 3) diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItems.java b/src/main/java/com/minelittlepony/unicopia/item/UItems.java index 1f036829..ce60d14b 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItems.java @@ -75,6 +75,10 @@ public interface UItems { Item IMPORTED_OATS = register("imported_oats", new Item(new Item.Settings().food(UFoodComponents.IMPORTED_OATS)), ItemGroups.FOOD_AND_DRINK); Item OATMEAL = register("oatmeal", new OatmealItem(new Item.Settings().recipeRemainder(Items.BOWL).maxCount(1).food(UFoodComponents.OATMEAL)), ItemGroups.FOOD_AND_DRINK); + Item OATMEAL_COOKIE = register("oatmeal_cookie", new Item(new Item.Settings().food(FoodComponents.COOKIE)), ItemGroups.FOOD_AND_DRINK); + Item PINECONE_COOKIE = register("pinecone_cookie", new Item(new Item.Settings().food(FoodComponents.COOKIE)), ItemGroups.FOOD_AND_DRINK); + Item BOWL_OF_NUTS = register("bowl_of_nuts", new StewItem(new Item.Settings().food(FoodComponents.BAKED_POTATO).recipeRemainder(Items.BOWL)), ItemGroups.FOOD_AND_DRINK); + Item DAFFODIL_DAISY_SANDWICH = register("daffodil_daisy_sandwich", new Item(new Item.Settings().food(UFoodComponents.DAFODIL_DAISY_SANDWICH)), ItemGroups.FOOD_AND_DRINK); Item HAY_BURGER = register("hay_burger", new Item(new Item.Settings().maxCount(1).food(UFoodComponents.HAY_BURGER)), ItemGroups.FOOD_AND_DRINK); Item HAY_FRIES = register("hay_fries", new Item(new Item.Settings().maxCount(16).food(UFoodComponents.HAY_FRIES)), ItemGroups.FOOD_AND_DRINK); diff --git a/src/main/resources/assets/unicopia/lang/en_us.json b/src/main/resources/assets/unicopia/lang/en_us.json index 0941798f..8558c7b3 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -146,6 +146,9 @@ "item.unicopia.horse_shoe_fries": "Horse Shoe Fries", "item.unicopia.wheat_worms": "Wheat Worms", "item.unicopia.muffin": "Muffin", + "item.unicopia.oatmeal_cookie": "Oatmeal Cookie", + "item.unicopia.pinecone_cookie": "Pinecone Cookie", + "item.unicopia.bowl_of_nuts": "Bowl of Nuts", "item.unicopia.pegasus_amulet": "Wings of Icarus", "item.unicopia.pegasus_amulet.lore": "Grants temporary flight to whoever wears it", diff --git a/src/main/resources/assets/unicopia/textures/item/bowl_of_nuts.png b/src/main/resources/assets/unicopia/textures/item/bowl_of_nuts.png new file mode 100644 index 00000000..8e684446 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/bowl_of_nuts.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/oatmeal_cookie.png b/src/main/resources/assets/unicopia/textures/item/oatmeal_cookie.png new file mode 100644 index 00000000..daa46c80 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/oatmeal_cookie.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/pinecone_cookie.png b/src/main/resources/assets/unicopia/textures/item/pinecone_cookie.png new file mode 100644 index 00000000..79fb1ed7 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/pinecone_cookie.png differ diff --git a/src/main/resources/data/unicopia/tags/items/food_types/baked_goods.json b/src/main/resources/data/unicopia/tags/items/food_types/baked_goods.json index 02828b2e..b28e7389 100644 --- a/src/main/resources/data/unicopia/tags/items/food_types/baked_goods.json +++ b/src/main/resources/data/unicopia/tags/items/food_types/baked_goods.json @@ -17,6 +17,9 @@ "unicopia:hay_fries", "unicopia:crispy_hay_fries", "unicopia:horse_shoe_fries", + "unicopia: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 }, diff --git a/src/main/resources/data/unicopia/tags/items/groups/earth_pony.json b/src/main/resources/data/unicopia/tags/items/groups/earth_pony.json index d88b92b7..e3ec6fc3 100644 --- a/src/main/resources/data/unicopia/tags/items/groups/earth_pony.json +++ b/src/main/resources/data/unicopia/tags/items/groups/earth_pony.json @@ -51,6 +51,7 @@ "unicopia:oats", "unicopia:imported_oats", "unicopia:oatmeal", + "unicopia:oatmeal_cookie", "unicopia:daffodil_daisy_sandwich", "unicopia:hay_burger", "unicopia:hay_fries", @@ -61,6 +62,8 @@ "unicopia:muffin", "unicopia:acorn", "unicopia:pinecone", + "unicopia:pinecone_cookie", + "unicopia:bowl_of_nuts", "unicopia:crystal_shard", "unicopia:pebbles", "unicopia:rock",