From 7924d1be2b9c6beaabf72cb823caefbccd7fc4fc Mon Sep 17 00:00:00 2001 From: Altaymi Date: Sun, 12 Nov 2023 11:58:23 -0700 Subject: [PATCH 1/6] Added Fluid matcher to CraftingUtils --- src/main/java/growthcraft/lib/utils/CraftingUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/growthcraft/lib/utils/CraftingUtils.java b/src/main/java/growthcraft/lib/utils/CraftingUtils.java index 64b99c9c..be8ff784 100644 --- a/src/main/java/growthcraft/lib/utils/CraftingUtils.java +++ b/src/main/java/growthcraft/lib/utils/CraftingUtils.java @@ -45,5 +45,10 @@ public static NonNullList readIngredients(JsonArray ingredientArray) return nonnulllist; } + public static boolean doesFluidMatch(FluidStack controlFluidStack, FluidStack testFluidStack) { + boolean inputFluidTypeMatches = controlFluidStack.getFluid() == testFluidStack.getFluid(); + boolean inputFluidAmountMatches = controlFluidStack.getAmount() == testFluidStack.getAmount(); + return inputFluidTypeMatches && inputFluidAmountMatches; + } private CraftingUtils() { /* Prevent automatic public constructor */ } } From 7ec9df101342edfdf96e3f12ba9378113f8337e3 Mon Sep 17 00:00:00 2001 From: Altaymi Date: Sun, 12 Nov 2023 11:59:59 -0700 Subject: [PATCH 2/6] Incremented version to 9.1.3 --- README.md | 6 +++--- gradle.properties | 2 +- src/main/java/growthcraft/core/shared/Reference.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 17682c1a..a6c07a68 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Growthcraft 9 for Minecraft 1.20.1 (Forge) -[![Growthcraft Version](https://img.shields.io/badge/Growthcraft-9.1.2-orange.svg)](https://github.com/GrowthcraftCE/Growthcraft-1.20) +[![Growthcraft Version](https://img.shields.io/badge/Growthcraft-9.1.3-orange.svg)](https://github.com/GrowthcraftCE/Growthcraft-1.20) [![](http://cf.way2muchnoise.eu/versions/growthcraft-community-edition_latest.svg)](https://minecraft.curseforge.com/projects/growthcraft-community-edition/) [![](http://cf.way2muchnoise.eu/short_growthcraft-community-edition.svg)](https://minecraft.curseforge.com/projects/growthcraft-community-edition/) [![Forge Version](https://img.shields.io/badge/Minecraft%20Forge-47.2.0-yellow.svg)](http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.20.1.html) @@ -22,8 +22,8 @@ to our GitHub wiki documentation. As of version 9 we have included an in-game ma ### Growthcraft 9 (Minecraft 1.20.1) End of Support: TBD -Latest Version: 9.0.7 -Stable Version: 9.1.2 +Latest Version: 9.1.2 +Stable Version: 9.1.3 ### Growthcraft 8 (Minecraft 1.19.4) diff --git a/gradle.properties b/gradle.properties index 97dda0c0..cbf8c7ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ mod_id=growthcraft mod_archive_base=growthcraft mod_name=Growthcraft mod_license=GNU General Public License v3.0 -mod_version=9.1.2 +mod_version=9.1.3 mod_group_id=growthcraft mod_authors=Alatyami mod_description=Growthcraft is a realistic and immersive Forge mod that adds various new elements to the game of Minecraft. diff --git a/src/main/java/growthcraft/core/shared/Reference.java b/src/main/java/growthcraft/core/shared/Reference.java index 1946e0e6..80f8b0dc 100644 --- a/src/main/java/growthcraft/core/shared/Reference.java +++ b/src/main/java/growthcraft/core/shared/Reference.java @@ -6,7 +6,7 @@ public class Reference { public static final String MODID = "growthcraft"; public static final String NAME = "Growthcraft"; public static final String NAME_SHORT = "core"; - public static final String VERSION = "9.1.2"; + public static final String VERSION = "9.1.3"; private Reference() { /* Prevent default public constructor */ } From f0984cfcb2eaea760f894dbc7af08468e571b316 Mon Sep 17 00:00:00 2001 From: Altaymi Date: Sun, 12 Nov 2023 12:00:41 -0700 Subject: [PATCH 3/6] #11 Added tag support for Mixing Vat fluid recipes. --- .../milk/recipe/MixingVatFluidRecipe.java | 53 +++++++++---------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/src/main/java/growthcraft/milk/recipe/MixingVatFluidRecipe.java b/src/main/java/growthcraft/milk/recipe/MixingVatFluidRecipe.java index 3cd4a476..82d2aeef 100644 --- a/src/main/java/growthcraft/milk/recipe/MixingVatFluidRecipe.java +++ b/src/main/java/growthcraft/milk/recipe/MixingVatFluidRecipe.java @@ -1,11 +1,11 @@ package growthcraft.milk.recipe; -import com.google.gson.JsonArray; import com.google.gson.JsonObject; import growthcraft.lib.utils.CraftingUtils; import growthcraft.lib.utils.RecipeUtils; import growthcraft.milk.GrowthcraftMilk; import growthcraft.milk.shared.Reference; +import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; @@ -13,22 +13,26 @@ import net.minecraft.world.SimpleContainer; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; import net.minecraftforge.common.crafting.CraftingHelper; import net.minecraftforge.fluids.FluidStack; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; public class MixingVatFluidRecipe implements Recipe { private final ResourceLocation recipeId; private final RecipeUtils.Category category; private final ItemStack activationTool; - private final List ingredients; + private final NonNullList inputIngredients; + private final FluidStack inputFluidStack; private final int processingTime; @@ -40,7 +44,7 @@ public class MixingVatFluidRecipe implements Recipe { public MixingVatFluidRecipe(ResourceLocation recipeId, RecipeUtils.Category category, FluidStack inputFluidStack, FluidStack reagentFluidStack, - List ingredients, int processingTime, + NonNullList inputIngredients, int processingTime, FluidStack outputFluidStack, FluidStack wasteFluidStack, ItemStack activationTool, boolean requiresHeat) { @@ -48,7 +52,7 @@ public MixingVatFluidRecipe(ResourceLocation recipeId, RecipeUtils.Category cate this.category = category; this.inputFluidStack = inputFluidStack; this.reagentFluidStack = reagentFluidStack; - this.ingredients = ingredients; + this.inputIngredients = inputIngredients; this.processingTime = processingTime; this.outputFluidStack = outputFluidStack; this.wasteFluidStack = wasteFluidStack; @@ -57,25 +61,19 @@ public MixingVatFluidRecipe(ResourceLocation recipeId, RecipeUtils.Category cate } @Override - public boolean matches(SimpleContainer container, Level level) { + public boolean matches(@NotNull SimpleContainer container, @NotNull Level level) { return false; } public boolean matches(FluidStack testBaseFluidStack, FluidStack testReagentFluidStack, List testIngredients, boolean hasHeatSource) { - boolean inputFluidTypeMatches = testBaseFluidStack.getFluid() == this.getInputFluidStack().getFluid(); - boolean inputFluidAmountMatches = testBaseFluidStack.getAmount() == this.getInputFluidStack().getAmount(); - - boolean reagentFluidTypeMatches = testReagentFluidStack.getFluid() == this.getReagentFluidStack().getFluid(); - boolean reagentFluidAmountMatches = testReagentFluidStack.getAmount() == this.getReagentFluidStack().getAmount(); - - boolean fluidMatches = inputFluidTypeMatches && inputFluidAmountMatches - && reagentFluidTypeMatches && reagentFluidAmountMatches; + boolean fluidMatches = CraftingUtils.doesFluidMatch(testBaseFluidStack, this.getInputFluidStack()) + && CraftingUtils.doesFluidMatch(reagentFluidStack, this.getReagentFluidStack()); boolean ingredientMatches = false; - if (this.getIngredientList().size() == testIngredients.size()) { + if (this.getIngredients().size() == testIngredients.size()) { int itemCount = this.getIngredientList().size(); int matchCount = 0; for (int i = 0; i < this.getIngredientList().size(); i++) { @@ -142,8 +140,13 @@ public boolean activationToolValid(ItemStack tool) { return this.activationTool.getItem() == tool.getItem(); } + @Override + public @NotNull NonNullList getIngredients() { + return this.inputIngredients; + } + public List getIngredientList() { - return ingredients; + return Arrays.stream(inputIngredients.get(0).getItems()).toList(); } public List getIngredientItems() { @@ -203,15 +206,7 @@ public MixingVatFluidRecipe fromJson(ResourceLocation recipeId, JsonObject json) ItemStack activationTool = CraftingHelper.getItemStack( GsonHelper.getAsJsonObject(json, "activation_tool"), false); - List ingredients = new ArrayList<>(); - JsonArray jsonIngredients = GsonHelper.getAsJsonArray(json, "ingredients"); - - if (jsonIngredients.size() <= maxIngredients) { - for (int i = 0; i < jsonIngredients.size(); i++) { - ItemStack itemStack = CraftingHelper.getItemStack(jsonIngredients.get(i).getAsJsonObject(), false); - ingredients.add(itemStack); - } - } + NonNullList inputIngredient = CraftingUtils.readIngredients(GsonHelper.getAsJsonArray(json, "ingredients")); FluidStack reagentFluid = CraftingUtils.getFluidStack( GsonHelper.getAsJsonObject(json, "reagent_fluid")); @@ -221,7 +216,7 @@ public MixingVatFluidRecipe fromJson(ResourceLocation recipeId, JsonObject json) GsonHelper.getAsJsonObject(json, "result_fluid_waste")); return new MixingVatFluidRecipe(recipeId, RecipeUtils.Category.FLUID, - inputFluid, reagentFluid, ingredients, processingTime, resultFluid, wasteFluid, activationTool, requiresHeat); + inputFluid, reagentFluid, inputIngredient, processingTime, resultFluid, wasteFluid, activationTool, requiresHeat); } @@ -237,10 +232,10 @@ public MixingVatFluidRecipe fromJson(ResourceLocation recipeId, JsonObject json) ItemStack activationTool = buffer.readItem(); int ingredientSize = buffer.readVarInt(); + NonNullList ingredients = NonNullList.withSize(ingredientSize, Ingredient.EMPTY); - List ingredients = new ArrayList<>(); for (int i = 0; i < ingredientSize; i++) { - ingredients.add(buffer.readItem()); + ingredients.set(i, Ingredient.fromNetwork(buffer)); } FluidStack reagentFluidStack = buffer.readFluidStack(); @@ -268,8 +263,8 @@ public void toNetwork(FriendlyByteBuf buffer, MixingVatFluidRecipe recipe) { buffer.writeVarInt(recipe.getIngredientList().size()); - for (int i = 0; i < recipe.getIngredientList().size(); i++) { - buffer.writeItemStack(recipe.getIngredientList().get(i), false); + for (Ingredient ingredient : recipe.getIngredients()) { + ingredient.toNetwork(buffer); } buffer.writeFluidStack(recipe.getReagentFluidStack()); From ac4c87561c5c593da6bdcda550699e0faaaae77a Mon Sep 17 00:00:00 2001 From: Altaymi Date: Sun, 12 Nov 2023 17:36:05 -0700 Subject: [PATCH 4/6] #11 Added tag support for Mixing Vat item recipes. --- .../milk/block/MixingVatBlock.java | 17 ++++-- .../block/entity/MixingVatBlockEntity.java | 7 ++- .../milk/recipe/MixingVatFluidRecipe.java | 8 +-- .../milk/recipe/MixingVatItemRecipe.java | 55 +++++++++---------- ...eller_cheese_curds_from_purple_grapes.json | 2 +- ...enzeller_cheese_curds_from_red_grapes.json | 2 +- ...zeller_cheese_curds_from_white_grapes.json | 2 +- .../mixing_vat_item_asiago_cheese_curds.json | 4 +- ...xing_vat_item_casu_marzu_cheese_curds.json | 2 +- .../mixing_vat_item_cheddar_cheese_curds.json | 4 +- ...xing_vat_item_emmentaler_cheese_curds.json | 2 +- ...nzola_cheese_curds_from_purple_grapes.json | 2 +- ...rgonzola_cheese_curds_from_red_grapes.json | 2 +- ...onzola_cheese_curds_from_white_grapes.json | 2 +- .../mixing_vat_item_gouda_cheese_curds.json | 2 +- ...mixing_vat_item_monterey_cheese_curds.json | 2 +- ...mixing_vat_item_parmesan_cheese_curds.json | 2 +- ...ixing_vat_item_provolone_cheese_curds.json | 2 +- 18 files changed, 64 insertions(+), 55 deletions(-) diff --git a/src/main/java/growthcraft/milk/block/MixingVatBlock.java b/src/main/java/growthcraft/milk/block/MixingVatBlock.java index 139dc271..f605d11f 100644 --- a/src/main/java/growthcraft/milk/block/MixingVatBlock.java +++ b/src/main/java/growthcraft/milk/block/MixingVatBlock.java @@ -6,7 +6,6 @@ import growthcraft.milk.block.entity.MixingVatBlockEntity; import growthcraft.milk.init.GrowthcraftMilkBlockEntities; import growthcraft.milk.init.GrowthcraftMilkFluids; -import growthcraft.milk.init.GrowthcraftMilkTags; import growthcraft.milk.init.config.GrowthcraftMilkConfig; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -36,8 +35,10 @@ import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.fluids.capability.templates.FluidTank; import net.minecraftforge.network.NetworkHooks; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import javax.annotation.ParametersAreNonnullByDefault; import java.util.Arrays; import static net.minecraft.world.phys.shapes.BooleanOp.OR; @@ -124,7 +125,8 @@ public BlockEntityTicker getTicker(Level level, Block } @Override - public InteractionResult use(BlockState blockState, Level level, BlockPos blockPos, Player player, InteractionHand interactionHand, BlockHitResult hitResult) { + @ParametersAreNonnullByDefault + public @NotNull InteractionResult use(BlockState blockState, Level level, BlockPos blockPos, Player player, InteractionHand interactionHand, BlockHitResult hitResult) { if (level.isClientSide) { return InteractionResult.SUCCESS; } @@ -185,13 +187,18 @@ public InteractionResult use(BlockState blockState, Level level, BlockPos blockP } return fluidInteractionResult ? InteractionResult.SUCCESS : InteractionResult.FAIL; - } else if (player.getItemInHand(interactionHand).is(GrowthcraftMilkTags.Items.TAG_MIXING_VAT_TOOLS)) { - // TODO Handle tool activation of MixingVat. + } else if (!player.getItemInHand(interactionHand).isEmpty() + && (player.getItemInHand(interactionHand).is(blockEntity.getActivationTool().getItem()) + || player.getItemInHand(interactionHand).is(blockEntity.getResultActivationTool().getItem())) + ) { + // Try and activate the recipe. if(blockEntity.activateRecipe(player.getItemInHand(interactionHand))) { - player.getItemInHand(interactionHand).shrink(1); + if (GrowthcraftMilkConfig.isConsumeMixingVatActivator()) + player.getItemInHand(interactionHand).shrink(1); return InteractionResult.SUCCESS; } + // Process the Cheese Curds extraction. if(!blockEntity.getInventoryHandler().getStackInSlot(3).isEmpty() && blockEntity.activateResult(player, player.getItemInHand(interactionHand))) { player.getItemInHand(interactionHand).shrink(1); diff --git a/src/main/java/growthcraft/milk/block/entity/MixingVatBlockEntity.java b/src/main/java/growthcraft/milk/block/entity/MixingVatBlockEntity.java index 7821a40e..e82b65f9 100644 --- a/src/main/java/growthcraft/milk/block/entity/MixingVatBlockEntity.java +++ b/src/main/java/growthcraft/milk/block/entity/MixingVatBlockEntity.java @@ -67,6 +67,11 @@ public class MixingVatBlockEntity extends BlockEntity implements BlockEntityTick protected void onContentsChanged(int slot) { setChanged(); } + + @Override + public int getSlotLimit(int slot) { + return 1; + } }; private LazyOptional inventoryHandler = LazyOptional.empty(); @@ -478,7 +483,7 @@ public boolean activateRecipe(ItemStack stack) { && isHeated() == this.requiresHeatSource; // Reset the activation tool if recipe is activated - if (activated) this.activationTool = ItemStack.EMPTY; + if (this.activated) this.activationTool = ItemStack.EMPTY; return this.activated; } diff --git a/src/main/java/growthcraft/milk/recipe/MixingVatFluidRecipe.java b/src/main/java/growthcraft/milk/recipe/MixingVatFluidRecipe.java index 82d2aeef..45bacc4e 100644 --- a/src/main/java/growthcraft/milk/recipe/MixingVatFluidRecipe.java +++ b/src/main/java/growthcraft/milk/recipe/MixingVatFluidRecipe.java @@ -31,7 +31,7 @@ public class MixingVatFluidRecipe implements Recipe { private final ResourceLocation recipeId; private final RecipeUtils.Category category; private final ItemStack activationTool; - private final NonNullList inputIngredients; + private final NonNullList ingredients; private final FluidStack inputFluidStack; private final int processingTime; @@ -52,7 +52,7 @@ public MixingVatFluidRecipe(ResourceLocation recipeId, RecipeUtils.Category cate this.category = category; this.inputFluidStack = inputFluidStack; this.reagentFluidStack = reagentFluidStack; - this.inputIngredients = inputIngredients; + this.ingredients = inputIngredients; this.processingTime = processingTime; this.outputFluidStack = outputFluidStack; this.wasteFluidStack = wasteFluidStack; @@ -142,11 +142,11 @@ public boolean activationToolValid(ItemStack tool) { @Override public @NotNull NonNullList getIngredients() { - return this.inputIngredients; + return this.ingredients; } public List getIngredientList() { - return Arrays.stream(inputIngredients.get(0).getItems()).toList(); + return Arrays.stream(ingredients.get(0).getItems()).toList(); } public List getIngredientItems() { diff --git a/src/main/java/growthcraft/milk/recipe/MixingVatItemRecipe.java b/src/main/java/growthcraft/milk/recipe/MixingVatItemRecipe.java index 1f3e8404..c6f4daef 100644 --- a/src/main/java/growthcraft/milk/recipe/MixingVatItemRecipe.java +++ b/src/main/java/growthcraft/milk/recipe/MixingVatItemRecipe.java @@ -1,26 +1,28 @@ package growthcraft.milk.recipe; -import com.google.gson.JsonArray; import com.google.gson.JsonObject; import growthcraft.lib.utils.CraftingUtils; import growthcraft.lib.utils.RecipeUtils; import growthcraft.milk.GrowthcraftMilk; import growthcraft.milk.shared.Reference; +import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.GsonHelper; import net.minecraft.world.SimpleContainer; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; import net.minecraftforge.common.crafting.CraftingHelper; import net.minecraftforge.fluids.FluidStack; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; +import java.util.Arrays; import java.util.List; public class MixingVatItemRecipe implements Recipe { @@ -28,7 +30,7 @@ public class MixingVatItemRecipe implements Recipe { private final ResourceLocation recipeId; private final RecipeUtils.Category category; private final ItemStack activationTool; - private final List ingredients; + private final NonNullList ingredients; private final FluidStack inputFluidStack; private final int processingTime; private final ItemStack resultItemStack; @@ -37,7 +39,7 @@ public class MixingVatItemRecipe implements Recipe { public MixingVatItemRecipe(ResourceLocation recipeId, RecipeUtils.Category category, - FluidStack inputFluidStack, List ingredients, int processingTime, + FluidStack inputFluidStack, NonNullList ingredients, int processingTime, ItemStack resultItemStack, ItemStack activationTool, ItemStack resultActivationTool, boolean requiresHeat) { @@ -54,20 +56,17 @@ public MixingVatItemRecipe(ResourceLocation recipeId, RecipeUtils.Category categ @Override - public boolean matches(SimpleContainer p_44002_, Level p_44003_) { + public boolean matches(@NotNull SimpleContainer p_44002_, @NotNull Level p_44003_) { return false; } public boolean matches(FluidStack testFluidStack, List testIngredients, boolean hasHeatSource) { - boolean fluidMatches = false; - boolean itemMatches = false; - if (testFluidStack.getFluid() == this.getInputFluidStack().getFluid() - && testFluidStack.getAmount() == this.getInputFluidStack().getAmount()) { - fluidMatches = true; - } + boolean fluidMatches = CraftingUtils.doesFluidMatch(testFluidStack, this.getInputFluidStack()); + + boolean ingredientMatches = false; - if (this.getIngredientList().size() == testIngredients.size()) { + if (this.getIngredients().size() == testIngredients.size()) { int itemCount = this.getIngredientList().size(); int matchCount = 0; for (int i = 0; i < this.getIngredientList().size(); i++) { @@ -76,10 +75,10 @@ public boolean matches(FluidStack testFluidStack, List testIngredient matchCount++; } } - if (itemCount == matchCount) itemMatches = true; + ingredientMatches = itemCount == matchCount; } - return fluidMatches && itemMatches && hasHeatSource == isHeatRequired(); + return fluidMatches && ingredientMatches && hasHeatSource == isHeatRequired(); } public boolean matchResult(ItemStack itemStack) { @@ -98,8 +97,13 @@ public int getProcessingTime() { return processingTime; } + @Override + public @NotNull NonNullList getIngredients() { + return this.ingredients; + } + public List getIngredientList() { - return ingredients; + return Arrays.stream(ingredients.get(0).getItems()).toList(); } public ItemStack getResultItemStack() { @@ -111,11 +115,12 @@ public ItemStack getResultActivationTool() { } + @Override public ItemStack assemble(SimpleContainer container, RegistryAccess registryAccess) { return resultItemStack; } - + @Override public ItemStack getResultItem(RegistryAccess registryAccess) { return resultItemStack; } @@ -182,15 +187,7 @@ public MixingVatItemRecipe fromJson(ResourceLocation recipeId, JsonObject json) ItemStack activationTool = CraftingHelper.getItemStack( GsonHelper.getAsJsonObject(json, "activation_tool"), false); - List ingredients = new ArrayList<>(); - JsonArray jsonIngredients = GsonHelper.getAsJsonArray(json, "ingredients"); - - if (jsonIngredients.size() <= maxIngredients) { - for (int i = 0; i < jsonIngredients.size(); i++) { - ItemStack itemStack = CraftingHelper.getItemStack(jsonIngredients.get(i).getAsJsonObject(), false); - ingredients.add(itemStack); - } - } + NonNullList ingredients = CraftingUtils.readIngredients(GsonHelper.getAsJsonArray(json, "ingredients")); if (category == RecipeUtils.Category.ITEM) { ItemStack resultItemStack = CraftingHelper.getItemStack( @@ -218,10 +215,10 @@ public MixingVatItemRecipe fromJson(ResourceLocation recipeId, JsonObject json) ItemStack activationTool = buffer.readItem(); int ingredientSize = buffer.readVarInt(); + NonNullList ingredients = NonNullList.withSize(ingredientSize, Ingredient.EMPTY); - List ingredients = new ArrayList<>(); for (int i = 0; i < ingredientSize; i++) { - ingredients.add(buffer.readItem()); + ingredients.set(i, Ingredient.fromNetwork(buffer)); } ItemStack resultingItemStack = buffer.readItem(); @@ -248,8 +245,8 @@ public void toNetwork(FriendlyByteBuf buffer, MixingVatItemRecipe recipe) { buffer.writeVarInt(recipe.getIngredientList().size()); - for (int i = 0; i < recipe.getIngredientList().size(); i++) { - buffer.writeItemStack(recipe.getIngredientList().get(i), false); + for (Ingredient ingredient : recipe.getIngredients()) { + ingredient.toNetwork(buffer); } buffer.writeItemStack(recipe.getResultItemStack(), false); diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_appenzeller_cheese_curds_from_purple_grapes.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_appenzeller_cheese_curds_from_purple_grapes.json index 93e4bf79..a4b02561 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_appenzeller_cheese_curds_from_purple_grapes.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_appenzeller_cheese_curds_from_purple_grapes.json @@ -9,7 +9,7 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_appenzeller_cheese_curds_from_red_grapes.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_appenzeller_cheese_curds_from_red_grapes.json index 168d43c9..1d998834 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_appenzeller_cheese_curds_from_red_grapes.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_appenzeller_cheese_curds_from_red_grapes.json @@ -9,7 +9,7 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_appenzeller_cheese_curds_from_white_grapes.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_appenzeller_cheese_curds_from_white_grapes.json index 63ad5fb1..39de9737 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_appenzeller_cheese_curds_from_white_grapes.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_appenzeller_cheese_curds_from_white_grapes.json @@ -9,7 +9,7 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_asiago_cheese_curds.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_asiago_cheese_curds.json index 771fdf17..033c61c5 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_asiago_cheese_curds.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_asiago_cheese_curds.json @@ -9,11 +9,11 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_casu_marzu_cheese_curds.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_casu_marzu_cheese_curds.json index 5e16aff0..8982ac13 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_casu_marzu_cheese_curds.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_casu_marzu_cheese_curds.json @@ -9,7 +9,7 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_cheddar_cheese_curds.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_cheddar_cheese_curds.json index cd60c0e1..d7adb3af 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_cheddar_cheese_curds.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_cheddar_cheese_curds.json @@ -9,11 +9,11 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { - "item": "minecraft:orange_dye", + "tag": "forge:dyes/orange", "count": 1 } ], diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_emmentaler_cheese_curds.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_emmentaler_cheese_curds.json index 8a8d1c1e..b1da3dc5 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_emmentaler_cheese_curds.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_emmentaler_cheese_curds.json @@ -9,7 +9,7 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gorgonzola_cheese_curds_from_purple_grapes.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gorgonzola_cheese_curds_from_purple_grapes.json index 1cc40f00..d096bd7f 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gorgonzola_cheese_curds_from_purple_grapes.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gorgonzola_cheese_curds_from_purple_grapes.json @@ -9,7 +9,7 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gorgonzola_cheese_curds_from_red_grapes.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gorgonzola_cheese_curds_from_red_grapes.json index 2f4d605b..c737f109 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gorgonzola_cheese_curds_from_red_grapes.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gorgonzola_cheese_curds_from_red_grapes.json @@ -9,7 +9,7 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gorgonzola_cheese_curds_from_white_grapes.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gorgonzola_cheese_curds_from_white_grapes.json index a961bf22..8ac0110d 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gorgonzola_cheese_curds_from_white_grapes.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gorgonzola_cheese_curds_from_white_grapes.json @@ -9,7 +9,7 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gouda_cheese_curds.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gouda_cheese_curds.json index 4ea06144..053684c7 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gouda_cheese_curds.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_gouda_cheese_curds.json @@ -9,7 +9,7 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_monterey_cheese_curds.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_monterey_cheese_curds.json index 5adb5775..0ca9b8f4 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_monterey_cheese_curds.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_monterey_cheese_curds.json @@ -9,7 +9,7 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_parmesan_cheese_curds.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_parmesan_cheese_curds.json index 9c115449..2a4d3d81 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_parmesan_cheese_curds.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_parmesan_cheese_curds.json @@ -9,7 +9,7 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { diff --git a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_provolone_cheese_curds.json b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_provolone_cheese_curds.json index d8e0c5da..caa8610c 100644 --- a/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_provolone_cheese_curds.json +++ b/src/main/resources/data/growthcraft_milk/recipes/mixing_vat_item_provolone_cheese_curds.json @@ -9,7 +9,7 @@ }, "ingredients": [ { - "item": "growthcraft:salt", + "tag": "forge:dusts/salt", "count": 1 }, { From 9aec691a79484afa0a676e3122cbd97bff66a0cc Mon Sep 17 00:00:00 2001 From: Altaymi Date: Sun, 12 Nov 2023 17:40:56 -0700 Subject: [PATCH 5/6] Fixed #68 Corrected Apple Plank Slab item texture. --- .../assets/growthcraft_apples/models/item/apple_plank_slab.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/growthcraft_apples/models/item/apple_plank_slab.json b/src/main/resources/assets/growthcraft_apples/models/item/apple_plank_slab.json index e61bec6c..0dd3036a 100644 --- a/src/main/resources/assets/growthcraft_apples/models/item/apple_plank_slab.json +++ b/src/main/resources/assets/growthcraft_apples/models/item/apple_plank_slab.json @@ -1,3 +1,3 @@ { - "parent": "block/acacia_slab" + "parent": "growthcraft_apples:block/apple_plank_slab" } From bfe2f683f7e3f111dc47ca4e13a0b413bce08996 Mon Sep 17 00:00:00 2001 From: Altaymi Date: Sun, 12 Nov 2023 17:41:05 -0700 Subject: [PATCH 6/6] Updated change log --- .../growthcraft/en_us/entries/core/change_log.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/growthcraft/patchouli_books/growthcraft/en_us/entries/core/change_log.json b/src/main/resources/assets/growthcraft/patchouli_books/growthcraft/en_us/entries/core/change_log.json index 4712d5a7..26d78b2e 100644 --- a/src/main/resources/assets/growthcraft/patchouli_books/growthcraft/en_us/entries/core/change_log.json +++ b/src/main/resources/assets/growthcraft/patchouli_books/growthcraft/en_us/entries/core/change_log.json @@ -6,7 +6,12 @@ "pages": [ { "type": "patchouli:text", - "text": "9.1.2 - Oct 22, 2023$(br)9.1.0 - Oct 9, 2023$(br)9.0.6 - Sep 10, 2023$(br)9.0.5 - Sep 3, 2023$(br)9.0.4 - Aug 21, 2023$(br)9.0.3 - Aug 11, 2023$(br)9.0.2 - Aug 6, 2023$(br)9.0.1 - Jul 29, 2023$(br)9.0.0 - Jul 26, 2023" + "text": "9.1.3 - Nov 12, 2023$(br)9.1.2 - Oct 22, 2023$(br)9.1.0 - Oct 9, 2023$(br)9.0.6 - Sep 10, 2023$(br)9.0.5 - Sep 3, 2023$(br)9.0.4 - Aug 21, 2023$(br)9.0.3 - Aug 11, 2023$(br)9.0.2 - Aug 6, 2023$(br)9.0.1 - Jul 29, 2023$(br)9.0.0 - Jul 26, 2023" + }, + { + "type": "patchouli:text", + "title": "9.1.3", + "text": "$(li)Added tags for Mixing Vat$(li)Fixed Apple Wood Slab Item Texture" }, { "type": "patchouli:text",