private static int FixPotions(ref TileEntityBrewingStand brewingStand) { int fixedPotions = 0; for (int slot = 0; slot <= brewingStand.Items.Capacity; slot++) { Item item = brewingStand.Items[slot]; if (item != null && item.ID == ItemInfo.Potion.NameID && FixPotion(ref item)) { fixedPotions++; } } return(fixedPotions); }
public ContainerBrewingStand(InventoryPlayer par1InventoryPlayer, TileEntityBrewingStand par2TileEntityBrewingStand) { BrewTime = 0; TileBrewingStand = par2TileEntityBrewingStand; AddSlot(new SlotBrewingStandPotion(this, par1InventoryPlayer.Player, par2TileEntityBrewingStand, 0, 56, 46)); AddSlot(new SlotBrewingStandPotion(this, par1InventoryPlayer.Player, par2TileEntityBrewingStand, 1, 79, 53)); AddSlot(new SlotBrewingStandPotion(this, par1InventoryPlayer.Player, par2TileEntityBrewingStand, 2, 102, 46)); AddSlot(new SlotBrewingStandIngredient(this, par2TileEntityBrewingStand, 3, 79, 17)); for (int i = 0; i < 3; i++) { for (int k = 0; k < 9; k++) { AddSlot(new Slot(par1InventoryPlayer, k + i * 9 + 9, 8 + k * 18, 84 + i * 18)); } } for (int j = 0; j < 9; j++) { AddSlot(new Slot(par1InventoryPlayer, j, 8 + j * 18, 142)); } }