@Override @SideOnly(Side.CLIENT) public void updateProgressBar(int id, int value) { switch (id) { case 0: campfireEnt.furnaceCookTime = value; break; case 1: campfireEnt.furnaceBurnTime = value; break; case 2: campfireEnt.currentItemBurnTime = value; break; } }
@Override public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex) { ItemStack originalStack = null; Slot slot = (Slot) this.inventorySlots.get(slotIndex); if (slot != null && slot.getHasStack()) { ItemStack stack = slot.getStack(); originalStack = stack.copy(); if (slotIndex == 2) { if (!mergeItemStack(stack, 3, 39, true)) { return null; } slot.onSlotChange(stack, originalStack); } else if (slotIndex > 1) { boolean inserted = false; for (int i = 1; i >= 0; i--) { if (campfireEnt.canInsertItem(i, stack, 0)) { inserted = true; if (!mergeItemStack(stack, i, i + 1, false)) { return null; } break; } } if (!inserted) { if (slotIndex >= 3 && slotIndex < 30) // Player inventory { if (!mergeItemStack(stack, 30, 39, false)) { return null; } } else if (slotIndex >= 30 && slotIndex < 39 && !mergeItemStack(stack, 3, 30, false)) { return null; } } } else if (!mergeItemStack(stack, 3, 39, false)) { return null; } if (stack.stackSize == 0) { slot.putStack(null); } else { slot.onSlotChanged(); } if (stack.stackSize == originalStack.stackSize) { return null; } slot.onPickupFromSlot(player, stack); } return originalStack; }
@Override public boolean canInteractWith(EntityPlayer player) { return campfireEnt.isUseableByPlayer(player); }