@Override @SideOnly(Side.CLIENT) public void updateProgressBar(int id, int value) { if (id == 0) { tile.fuel = value; } if (id == 1) { tile.maxFuel = value; } }
@Override public void detectAndSendChanges() { for (int i = 0; i < this.crafters.size(); ++i) { ICrafting icrafting = (ICrafting) this.crafters.get(i); if (this.lastFuel != tile.fuel) { icrafting.sendProgressBarUpdate(this, 0, tile.fuel); } if (this.lastFuelMax != tile.maxFuel) { icrafting.sendProgressBarUpdate(this, 1, tile.maxFuel); } } this.lastFuel = tile.fuel; this.lastFuelMax = tile.maxFuel; for (int i = 0; i < this.inventorySlots.size(); ++i) { ItemStack itemstack = ((Slot) this.inventorySlots.get(i)).getStack(); ItemStack itemstack1 = (ItemStack) this.inventoryItemStacks.get(i); if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) { if (isGuiContainer) { tile.onInventoryChanged(); } itemstack1 = itemstack == null ? null : itemstack.copy(); this.inventoryItemStacks.set(i, itemstack1); for (int j = 0; j < this.crafters.size(); ++j) { ((ICrafting) this.crafters.get(j)).sendSlotContents(this, i, itemstack1); } } } }
@Override public ItemStack transferStackInSlot(EntityPlayer user, int clicked) { ItemStack itemstack = null; Slot slot = (Slot) this.inventorySlots.get(clicked); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (clicked > 0) // INVENTORY { if (TileEntityBlastFH.isFuel(itemstack1)) { if (!this.mergeItemStack(itemstack1, 0, 1, false)) { return null; } } else if (clicked >= 1 && clicked < 28) // INVENTORY { if (!this.mergeItemStack(itemstack1, 28, 37, false)) { return null; } } // BAR else if (clicked >= 28 && clicked < 37 && !this.mergeItemStack(itemstack1, 1, 28, false)) { return null; } } else if (!this.mergeItemStack(itemstack1, 1, 37, false)) { return null; } if (itemstack1.stackSize == 0) { slot.putStack((ItemStack) null); } else { slot.onSlotChanged(); } if (itemstack1.stackSize == itemstack.stackSize) { return null; } slot.onPickupFromSlot(user, itemstack1); } return itemstack; }