private void brewPotions() { if (this.canBrew()) { ItemStack var1 = this.brewingItemStacks[3]; for (int var2 = 0; var2 < 3; ++var2) { if (this.brewingItemStacks[var2] != null && this.brewingItemStacks[var2].itemID == Item.potion.itemID) { int var3 = this.brewingItemStacks[var2].getItemDamage(); int var4 = this.getPotionResult(var3, var1); List var5 = Item.potion.getEffects(var3); List var6 = Item.potion.getEffects(var4); if ((var3 <= 0 || var5 != var6) && (var5 == null || !var5.equals(var6) && var6 != null)) { if (var3 != var4) { this.brewingItemStacks[var2].setItemDamage(var4); } } else if (!ItemPotion.isSplash(var3) && ItemPotion.isSplash(var4)) { this.brewingItemStacks[var2].setItemDamage(var4); } } } if (Item.itemsList[var1.itemID].hasContainerItem()) { this.brewingItemStacks[3] = new ItemStack(Item.itemsList[var1.itemID].getContainerItem()); } else { --this.brewingItemStacks[3].stackSize; if (this.brewingItemStacks[3].stackSize <= 0) { this.brewingItemStacks[3] = null; } } } }
private boolean canBrew() { if (this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0) { ItemStack var1 = this.brewingItemStacks[3]; if (!Item.itemsList[var1.itemID].isPotionIngredient()) { return false; } else { boolean var2 = false; for (int var3 = 0; var3 < 3; ++var3) { if (this.brewingItemStacks[var3] != null && this.brewingItemStacks[var3].itemID == Item.potion.itemID) { int var4 = this.brewingItemStacks[var3].getItemDamage(); int var5 = this.getPotionResult(var4, var1); if (!ItemPotion.isSplash(var4) && ItemPotion.isSplash(var5)) { var2 = true; break; } List var6 = Item.potion.getEffects(var4); List var7 = Item.potion.getEffects(var5); if ((var4 <= 0 || var6 != var7) && (var6 == null || !var6.equals(var7) && var7 != null) && var4 != var5) { var2 = true; break; } } } return var2; } } else { return false; } }