Skip to content

Commit

Permalink
Clean-up and miscellanea
Browse files Browse the repository at this point in the history
Fixed issue with taking items from cauldron campfires in Survival Mode
Updated item group events, including support for Farmer's Delight
Updated many translations
Coffee berries have been renamed to coffee cherries
Java emblem banner pattern has been renamed to java banner pattern
  • Loading branch information
Chikorita-Lover committed Sep 10, 2024
1 parent d8c8390 commit 2ec6c07
Show file tree
Hide file tree
Showing 17 changed files with 459 additions and 266 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// 1.21 2024-09-07T13:34:20.4716276 Caffeinated/Block Loot Tables
548d115eeb79b74d3fbe03951bdc179110ed6f8a data\caffeinated\loot_table\blocks\ground_coffee_cauldron.json
8b8e67a4f2fbd3f51a69d1359cceb2704429f4c3 data\caffeinated\loot_table\blocks\coffee_berry_crate.json
d481f7802dfc0e83cd271518b47e73b256a24d2f data\caffeinated\loot_table\blocks\flowering_coffee_shrub.json
548d115eeb79b74d3fbe03951bdc179110ed6f8a data\caffeinated\loot_table\blocks\coffee_cauldron.json
2181144c1ab146492f9cae41e26a4ad585b0c46b data\caffeinated\loot_table\blocks\ground_coffee_block.json
55664479b7d3ad31e070226a65db432f03d97236 data\caffeinated\loot_table\blocks\potted_coffee_shrub.json
3bec24cd54986eea9c228540df648ca7b01c86fc data\caffeinated\loot_table\blocks\coffee_bean_block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// 1.21 2024-09-07T13:34:20.4704644 Caffeinated/Advancements
bcaa279e3e0ad8280ebfe57370201ce6290340a1 data\caffeinated\advancement\husbandry\brew_coffee.json
3a0446170026d8aa5bbef46b956c9373eb0a91c8 data\caffeinated\advancement\husbandry\bake_tiramisu.json
a13c94beba4187f9b1b7021707a912e58beac70d data\caffeinated\advancement\husbandry\brew_all_coffee.json
29 changes: 29 additions & 0 deletions src/main/generated/.cache/c189bb4c92920ea572e0709157481155fe15e5dc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// 1.21 2024-09-07T13:34:20.4716276 Caffeinated/Recipes
c773cd5c995b67602b5f054f551a8f5d6f33d139 data\caffeinated\advancement\recipes\misc\coffee_beans.json
c9b5cb066d0fab702915da1774fdd48fcbc57229 data\caffeinated\advancement\recipes\misc\coffee_beans_from_smoking.json
6061a7a2ef7b2febcca08d801ffce55d131fda2b data\caffeinated\recipe\tiramisu_from_slices.json
9e061efc3626a119413e61ca86a53990ab4f8a8a data\caffeinated\advancement\recipes\misc\ground_coffee_from_coffee_beans.json
b8e94b6ab3e5b643e335a6036992426d7e3ed11c data\caffeinated\advancement\recipes\building_blocks\coffee_bean_block.json
861e142a5a287eba94cf46a7d37342304f9ad285 data\caffeinated\recipe\ground_coffee_block.json
afc5ab486779e47ce326b86ef93037905639d03a data\caffeinated\recipe\coffee_beans_from_smoking.json
51cbbbc43481615db699ce0878398bb475466f96 data\caffeinated\advancement\recipes\building_blocks\ground_coffee_block.json
31f69cf23ef6a168c6d98a8fef731d470bcbb187 data\caffeinated\recipe\coffee_berries.json
081e951942029c81b7edec2c02074e4b47d00d3d data\caffeinated\recipe\ground_coffee_from_coffee_beans.json
5dc445d11ac1091b47d0393e020f2644f701cd29 data\caffeinated\recipe\coffee_berry_crate.json
ba81552d4ee1d9d568b84f786de61e415fdb157e data\caffeinated\recipe\latte_coffee_bottle.json
b3d10b49b978d96c244fb776e1292f0b3f9c272b data\caffeinated\recipe\brown_dye_from_ground_coffee.json
920e03fa0683e9b42e081c15bd1af0c69feb51eb data\caffeinated\recipe\coffee_beans.json
0ce1e6e9d0c954f2ea67d39a1a43bf358a1a8991 data\caffeinated\advancement\recipes\misc\brown_dye_from_ground_coffee.json
05ce2e487120bb80ae830054a41d88227ff06701 data\caffeinated\advancement\recipes\misc\coffee_beans_from_campfire_cooking.json
400dd2329e8ff95d83dae40af8db1c9fc5296ce4 data\caffeinated\recipe\coffee_bean_block.json
a3089cb10cc080957830e10d1b276e6fb8e2845c data\caffeinated\advancement\recipes\food\tiramisu_from_slices.json
42e097d611b5534f387afce66da821f0349faf9f data\caffeinated\recipe\coffee_bottle.json
72418a991f973fb5cf728affdcbfde7d5818b251 data\caffeinated\advancement\recipes\food\coffee_bottle.json
1410b08380530f562102b9d54fde26a7163b2256 data\caffeinated\advancement\recipes\food\latte_coffee_bottle.json
145d4111298037135c323e1347f67b3871daaa3e data\caffeinated\recipe\java_banner_pattern.json
fd6bc1e87eab4e2bccc5d198e5bca2730df804db data\caffeinated\recipe\coffee_beans_from_campfire_cooking.json
514280f7d04586c23693c1dae8cf30241a810a24 data\caffeinated\advancement\recipes\building_blocks\coffee_berry_crate.json
e1d9fbf68af558ba9d59fc35535075266be4d5fe data\caffeinated\recipe\tiramisu.json
d4cb036e5e2675e9ddf086c9a38c979f07b2648e data\caffeinated\advancement\recipes\food\tiramisu.json
c2ed0c8fa9984d704ee6bba4d60cf985da40fee8 data\caffeinated\advancement\recipes\food\coffee_berries.json
a9a4364e33318712c4a3e4ef39fa828117e28314 data\caffeinated\advancement\recipes\misc\java_banner_pattern.json
39 changes: 39 additions & 0 deletions src/main/generated/.cache/f97ece2f3a543d4dbc8c984a7bcdf2d64b8f7bed
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// 1.21 2024-09-07T13:34:20.4675794 Caffeinated/Model Definitions
da4528a3cfafc1ab21e5814b64029c10ec357178 assets\caffeinated\blockstates\ground_coffee_block.json
26f35f3a03b0d53578efd2c555721b08353d75f0 assets\caffeinated\blockstates\coffee_cauldron.json
b1a481861132973fe035c9b9ce7613e15938034c assets\caffeinated\models\block\coffee_berry_crate.json
e8f1792493d7219e1da4ac39e45bf903a349e3f5 assets\caffeinated\models\block\ground_coffee_cauldron_full.json
cd360bb185f465f81672c32ac31312f77270e5f4 assets\caffeinated\models\block\coffee_cauldron_level2.json
5f0ad0fc380a095ead21e3a00bdbbdcd648548e3 assets\caffeinated\models\item\latte_coffee_bottle.json
57311e73aae426dff5d3b58c69ec071360f952d3 assets\caffeinated\models\block\ground_coffee_cauldron_level1.json
13297d4a51cb3b1369630338ba5f7b439b4af3fc assets\caffeinated\models\block\cauldron_campfire_filled.json
cd254ba40cfd07d6c01d66a963e5ec83ed478aef assets\caffeinated\blockstates\coffee_berry_crate.json
ace2f8060adedf59471fa9728ad427b7c2abb51e assets\caffeinated\blockstates\soul_cauldron_campfire.json
cdbc1b9ed3c8b04b24b80402af15eb777423817d assets\caffeinated\models\block\ground_coffee_cauldron_level2.json
1297909cbb77803c3f1a796d29fa088c9aeae546 assets\caffeinated\blockstates\coffee_shrub.json
34202786f9a57de99cd6cc7be5013c91a1b9690a assets\caffeinated\models\item\tiramisu_slice.json
86a7f801b70c8f877d0e3d52a8bce349a9232c4f assets\caffeinated\models\block\ground_coffee_block.json
37d547b30cad973f0223896df68f15c5eea49d4b assets\caffeinated\models\item\ground_coffee_block.json
2e82d1add55c94e56c5b85172449dc9ff539882d assets\caffeinated\models\block\coffee_cauldron_full.json
63ec6c618a3a23eab4cab9c52d7d3250de9b516e assets\caffeinated\models\item\civet_spawn_egg.json
fe9155058173a06c1325878e72a8f42b0acfb9d7 assets\caffeinated\models\block\coffee_shrub_stage1.json
2078aae9dd460adbf0bf14e46615e32012f351e8 assets\caffeinated\blockstates\ground_coffee_cauldron.json
865a21f6601205d70079dbcc9d2bc9d375fbbc73 assets\caffeinated\models\block\coffee_bean_block.json
16db00fbb67b98528c1a99e61640adc411cc4cff assets\caffeinated\models\item\tiramisu.json
8ba76990b97aa664bf34e5e2b94761ebdc7a8c04 assets\caffeinated\models\block\coffee_cauldron_level1.json
3ef771d34d7bc76165d6a5f7053ea5ff27bc44dd assets\caffeinated\blockstates\coffee_bean_block.json
821f41182077e0ce6bc7918aee907e45a9dd7d73 assets\caffeinated\models\block\soul_cauldron_campfire.json
2ee0688f44b78a48941720e3223b7bf3a9133161 assets\caffeinated\blockstates\potted_coffee_shrub.json
358965a77d8a9ace29f9981a460163089349eda2 assets\caffeinated\models\item\coffee_berry_crate.json
196754b26a9f9cac1bf6b81563cef5344f998868 assets\caffeinated\blockstates\tiramisu.json
ee814f36f99a123b06cf2e7bcb08415b97595925 assets\caffeinated\models\block\potted_coffee_shrub.json
50804beb94c1a58c883df514333ff7d2c2807a42 assets\caffeinated\models\item\coffee_bean_block.json
6bc7bd9e663e1a1e43a79ef46957b15c4682a3a6 assets\caffeinated\models\block\coffee_shrub_stage0.json
0dab1d0bc7608970cc968c8f8569497fae0b2295 assets\caffeinated\models\item\ground_coffee.json
ffcb5afccb3a6b30399f263654799949096594da assets\caffeinated\blockstates\cauldron_campfire.json
58f78eb6198fba07304fece9e3c7bb6247a13229 assets\caffeinated\models\item\coffee_bottle.json
e4c8f2b75d3ecafc48e0a48ec6940b6dac0eb258 assets\caffeinated\models\item\coffee_beans.json
6568f0e38ffcef7753bd7c0ae1bfdd66fafc6795 assets\caffeinated\models\block\cauldron_campfire.json
66ab3c0788a1452c84c9c06f8ffe0bf7828a9620 assets\caffeinated\models\item\java_banner_pattern.json
1564a118add7b691cd3d6b1b6d06641507f0a7e2 assets\caffeinated\models\item\coffee_berries.json
f231ba05786d3928e6a0fce4139f5e1c5b106036 assets\caffeinated\models\block\soul_cauldron_campfire_filled.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"has_the_recipe": {
"conditions": {
"recipe": "caffeinated:coffee_berries_from_crate"
"recipe": "caffeinated:coffee_berries"
},
"trigger": "minecraft:recipe_unlocked"
}
Expand All @@ -34,7 +34,7 @@
],
"rewards": {
"recipes": [
"caffeinated:coffee_berries_from_crate"
"caffeinated:coffee_berries"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ public ItemActionResult onUseWithItem(ItemStack stack, BlockState state, World w
BlockEntity blockEntity = world.getBlockEntity(pos);
if (blockEntity instanceof CauldronCampfireBlockEntity cauldronCampfire) {
Item item = stack.getItem();
Item item2 = cauldronCampfire.getStack(0).getItem();
Item ingredient = cauldronCampfire.getStack(0).getItem();
boolean bl = !state.get(FILLED) && cauldronCampfire.isBaseIngredient(stack);
boolean bl2 = !cauldronCampfire.hasReagent() && cauldronCampfire.canBrewTogether(cauldronCampfire.getStack(0), stack);
boolean bl3 = state.get(FILLED) && (!item2.hasRecipeRemainder() || stack.isOf(item2.getRecipeRemainder()));
boolean bl3 = state.get(FILLED) && (!ingredient.hasRecipeRemainder() || stack.isOf(ingredient.getRecipeRemainder()));
if (!bl && !bl2 && !bl3) {
return ItemActionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
}
Expand All @@ -144,11 +144,11 @@ public ItemActionResult onUseWithItem(ItemStack stack, BlockState state, World w
player.setStackInHand(hand, ItemUsage.exchangeStack(stack, player, item.getRecipeRemainder(stack)));
world.emitGameEvent(null, GameEvent.BLOCK_CHANGE, pos);
} else {
ItemStack stack2 = item2.getDefaultStack();
if (stack2.isOf(item2.getRecipeRemainder())) {
player.setStackInHand(hand, ItemUsage.exchangeStack(stack, player, stack2));
ItemStack ingredientStack = ingredient.getDefaultStack();
if (stack.isOf(ingredient.getRecipeRemainder())) {
player.setStackInHand(hand, ItemUsage.exchangeStack(stack, player, ingredientStack));
} else {
player.giveItemStack(stack2);
player.giveItemStack(ingredientStack);
}
cauldronCampfire.clear();
cauldronCampfire.dropExperienceForRecipesUsed((ServerPlayerEntity) player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import net.chikorita_lover.caffeinated.recipe.CoffeeBrewingRecipeJsonBuilder;
import net.chikorita_lover.caffeinated.registry.CaffeinatedBlocks;
import net.chikorita_lover.caffeinated.registry.CaffeinatedItems;
import net.chikorita_lover.caffeinated.registry.tag.CaffeinatedItemTags;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
import net.fabricmc.fabric.api.resource.conditions.v1.ResourceConditions;
import net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags;
import net.minecraft.data.server.recipe.CookingRecipeJsonBuilder;
import net.minecraft.data.server.recipe.RecipeExporter;
import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder;
Expand All @@ -33,7 +35,8 @@ public void generate(RecipeExporter exporter) {

offer2x2CompactingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, CaffeinatedBlocks.COFFEE_BEAN_BLOCK, CaffeinatedItems.COFFEE_BEANS);
offer2x2CompactingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, CaffeinatedBlocks.GROUND_COFFEE_BLOCK, CaffeinatedItems.GROUND_COFFEE);
offerReversibleCompactingRecipes(farmersDelightExporter, RecipeCategory.FOOD, CaffeinatedItems.COFFEE_BERRIES, RecipeCategory.DECORATIONS, CaffeinatedBlocks.COFFEE_BERRY_CRATE);
ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, CaffeinatedItems.COFFEE_BERRIES, 9).input(CaffeinatedBlocks.COFFEE_BERRY_CRATE).criterion(hasItem(CaffeinatedBlocks.COFFEE_BERRY_CRATE), conditionsFromItem(CaffeinatedBlocks.COFFEE_BERRY_CRATE)).offerTo(farmersDelightExporter, Caffeinated.of(getItemPath(CaffeinatedItems.COFFEE_BERRIES)));
ShapedRecipeJsonBuilder.create(RecipeCategory.BUILDING_BLOCKS, CaffeinatedBlocks.COFFEE_BERRY_CRATE).input('#', CaffeinatedItems.COFFEE_BERRIES).pattern("###").pattern("###").pattern("###").criterion(hasItem(CaffeinatedItems.COFFEE_BERRIES), conditionsFromItem(CaffeinatedItems.COFFEE_BERRIES)).offerTo(farmersDelightExporter, Caffeinated.of(getItemPath(CaffeinatedBlocks.COFFEE_BERRY_CRATE)));

ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, CaffeinatedItems.GROUND_COFFEE).input('#', CaffeinatedItems.COFFEE_BEANS).pattern("###").group("ground_coffee").criterion(hasItem(CaffeinatedItems.COFFEE_BEANS), conditionsFromItem(CaffeinatedItems.COFFEE_BEANS)).offerTo(exporter, Caffeinated.of("ground_coffee_from_coffee_beans"));
ShapelessRecipeJsonBuilder.create(RecipeCategory.MISC, Items.BROWN_DYE).input(CaffeinatedItems.GROUND_COFFEE).group("brown_dye").criterion("has_ground_coffee", conditionsFromItem(CaffeinatedItems.GROUND_COFFEE)).offerTo(exporter, Caffeinated.of("brown_dye_from_ground_coffee"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;

import java.util.Set;

Expand All @@ -23,36 +24,51 @@ public static void register() {
Registry.register(Registries.ITEM_GROUP, CAFFEINATED, FabricItemGroup.builder().displayName(Text.translatable("itemGroup.caffeinated.caffeinated")).icon(CaffeinatedItems.BLACK_COFFEE_BOTTLE::getDefaultStack).build());

ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register(entries -> {
entries.addBefore(Items.NETHER_WART, CaffeinatedItems.COFFEE_BERRIES);
entries.addBefore(Items.GLOW_BERRIES, CaffeinatedItems.COFFEE_BERRIES);
entries.addBefore(Blocks.BEE_NEST, CaffeinatedBlocks.COFFEE_BEAN_BLOCK, CaffeinatedBlocks.GROUND_COFFEE_BLOCK);
});
ItemGroupEvents.modifyEntriesEvent(ItemGroups.FOOD_AND_DRINK).register(entries -> {
entries.addBefore(Items.CHORUS_FRUIT, CaffeinatedItems.COFFEE_BERRIES);
entries.addBefore(Items.ROTTEN_FLESH, CaffeinatedItems.BLACK_COFFEE_BOTTLE, CaffeinatedItems.LATTE_COFFEE_BOTTLE, CaffeinatedBlocks.TIRAMISU, CaffeinatedItems.TIRAMISU_SLICE);
entries.addBefore(Items.SWEET_BERRIES, CaffeinatedItems.COFFEE_BERRIES);
entries.addBefore(Items.ROTTEN_FLESH, CaffeinatedBlocks.TIRAMISU);
entries.addBefore(Items.OMINOUS_BOTTLE, CaffeinatedItems.BLACK_COFFEE_BOTTLE, CaffeinatedItems.LATTE_COFFEE_BOTTLE);
});
ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(entries -> {
entries.addAfter(Items.WHEAT, CaffeinatedItems.COFFEE_BEANS);
entries.addBefore(Items.NETHER_WART, CaffeinatedItems.GROUND_COFFEE);
entries.addAfter(Items.PIGLIN_BANNER_PATTERN, CaffeinatedItems.JAVA_BANNER_PATTERN);
entries.addAfter(Items.WHEAT, CaffeinatedItems.COFFEE_BEANS, CaffeinatedItems.GROUND_COFFEE);
entries.addBefore(Items.PIGLIN_BANNER_PATTERN, CaffeinatedItems.JAVA_BANNER_PATTERN);
});
ItemGroupEvents.modifyEntriesEvent(ItemGroups.SPAWN_EGGS).register(entries -> {
entries.addAfter(Items.CHICKEN_SPAWN_EGG, CaffeinatedItems.CIVET_SPAWN_EGG);
});
ItemGroupEvents.modifyEntriesEvent(CAFFEINATED).register(entries -> {
ItemGroup.StackVisibility visibility = ItemGroup.StackVisibility.PARENT_TAB_ONLY;
entries.add(CaffeinatedItems.COFFEE_BERRIES, visibility);
entries.add(CaffeinatedItems.COFFEE_BEANS, visibility);
entries.add(CaffeinatedItems.GROUND_COFFEE, visibility);
entries.add(CaffeinatedBlocks.COFFEE_BEAN_BLOCK, visibility);
entries.add(CaffeinatedBlocks.GROUND_COFFEE_BLOCK, visibility);
registerCampfiresCauldron(entries, visibility);
entries.add(Items.GLASS_BOTTLE, visibility);
entries.add(CaffeinatedItems.BLACK_COFFEE_BOTTLE, visibility);
entries.add(CaffeinatedItems.LATTE_COFFEE_BOTTLE, visibility);
entries.add(CaffeinatedBlocks.TIRAMISU, visibility);
entries.add(CaffeinatedItems.TIRAMISU_SLICE, visibility);
entries.add(CaffeinatedItems.JAVA_BANNER_PATTERN, visibility);
entries.add(CaffeinatedItems.CIVET_SPAWN_EGG, visibility);
ItemGroup.StackVisibility parentTabOnly = ItemGroup.StackVisibility.PARENT_TAB_ONLY;
entries.add(CaffeinatedItems.COFFEE_BERRIES, parentTabOnly);
entries.add(CaffeinatedItems.COFFEE_BEANS, parentTabOnly);
entries.add(CaffeinatedItems.GROUND_COFFEE, parentTabOnly);
entries.add(CaffeinatedBlocks.COFFEE_BEAN_BLOCK, parentTabOnly);
entries.add(CaffeinatedBlocks.GROUND_COFFEE_BLOCK, parentTabOnly);
registerCampfiresCauldron(entries, parentTabOnly);
entries.add(Items.GLASS_BOTTLE, parentTabOnly);
entries.add(CaffeinatedItems.BLACK_COFFEE_BOTTLE, parentTabOnly);
entries.add(CaffeinatedItems.LATTE_COFFEE_BOTTLE, parentTabOnly);
entries.add(CaffeinatedBlocks.TIRAMISU, parentTabOnly);
entries.add(CaffeinatedItems.JAVA_BANNER_PATTERN, parentTabOnly);
entries.add(CaffeinatedItems.CIVET_SPAWN_EGG, parentTabOnly);
});
ItemGroupEvents.MODIFY_ENTRIES_ALL.register((group, entries) -> {
final String farmersDelight = "farmersdelight";
if (Registries.ITEM_GROUP.getId(group).equals(Identifier.of(farmersDelight, farmersDelight))) {
for (int i = 0; i < entries.getDisplayStacks().size(); ++i) {
ItemStack displayStack = entries.getDisplayStacks().get(i);
Identifier id = Registries.ITEM.getId(displayStack.getItem());
if (id.equals(Identifier.of(farmersDelight, "carrot_crate"))) {
entries.addBefore(displayStack, CaffeinatedBlocks.COFFEE_BERRY_CRATE);
++i;
} else if (id.equals(Identifier.of(farmersDelight, "cake_slice"))) {
entries.addAfter(displayStack, CaffeinatedItems.TIRAMISU_SLICE);
++i;
}
}
}
});
}

Expand Down
Loading

0 comments on commit 2ec6c07

Please sign in to comment.