[1.16] PotionBrewerTile crash. Game crashed after I removed the potion from the block inventory.
Particle1904 opened this issue ยท 2 comments
Industrial Foregoing Version: 3.0.5
Titanium Version: 3.0.4
**Crashlog If Applicable (Upload to pastebin/gist): https://pastebin.com/Cixf2V44 **
Thanks for looking into my issue! :)
happened on Forgecraft, quick fix:
--- a/src/main/java/com/buuz135/industrial/block/resourceproduction/tile/PotionBrewerTile.java
+++ b/src/main/java/com/buuz135/industrial/block/resourceproduction/tile/PotionBrewerTile.java
@@ -186,10 +186,12 @@ public class PotionBrewerTile extends IndustrialProcessingTile<PotionBrewerTile>
ItemStack ingredient = this.brewingItems.getStackInSlot(slot);
input.add(ingredient);
if (ForgeEventFactory.onPotionAttemptBrew(input)) return;
- BrewingRecipeRegistry.brewPotions(input, ingredient, new int[]{0, 1, 2});
+ int[] indices = new int[input.size()];
+ for (int i = 0; i < indices.length; i++) indices[i] = i;
+ BrewingRecipeRegistry.brewPotions(input, ingredient, indices);
ingredient.shrink(1);
ForgeEventFactory.onPotionBrewed(input);
- for (int i = 0; i < 3; i++) {
+ for (int i : indices) {
this.output.setStackInSlot(i, input.get(i));
}
}