Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ContainerForge extends Container
- {
- private TileEntityForge forge;
- public int lastBurnTime;
- public int lastItemBurnTime;
- public int lastCookTime;
- public ContainerForge(InventoryPlayer inventory, TileEntityForge tileentity)
- {
- this.forge = tileentity;
- this.addSlotToContainer(new Slot(tileentity, 0, 56, 17));
- this.addSlotToContainer(new Slot(tileentity, 1, 36, 17));
- this.addSlotToContainer(new Slot(tileentity, 2, 61, 17));
- this.addSlotToContainer(new Slot(tileentity, 3, 86, 17));
- this.addSlotToContainer(new Slot(tileentity, 4, 49, 53));
- this.addSlotToContainer(new SlotFurnace(inventory.player, tileentity, 5, 116, 35));
- for(int i = 0; i < 3; i++)
- {
- for(int j = 0; j < 9; j++)
- {
- this.addSlotToContainer(new Slot(inventory, j + i*9 + 9, 8 + j*18, 84 + i*18));
- }
- }
- for(int i = 0; i < 9; i++)
- {
- this.addSlotToContainer(new Slot(inventory, i, 8 + i*18, 142));
- }
- }
- public void addCraftingToCrafters(ICrafting icrafting)
- {
- super.addCraftingToCrafters(icrafting);
- icrafting.sendProgressBarUpdate(this, 0, this.forge.cookTime);
- icrafting.sendProgressBarUpdate(this, 1, this.forge.cookTime);
- icrafting.sendProgressBarUpdate(this, 2, this.forge.cookTime);
- icrafting.sendProgressBarUpdate(this, 3, this.forge.cookTime);
- icrafting.sendProgressBarUpdate(this, 4, this.forge.burnTime);
- icrafting.sendProgressBarUpdate(this, 5, this.forge.currentItemBurnTime);
- }
- public void detectAndSendChanges()
- {
- super.detectAndSendChanges();
- }
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int slot, int newValue)
- {
- if(slot == 0) this.forge.cookTime = newValue;
- if(slot == 1) this.forge.cookTime = newValue;
- if(slot == 2) this.forge.cookTime = newValue;
- if(slot == 3) this.forge.cookTime = newValue;
- if(slot == 4) this.forge.burnTime = newValue;
- if(slot == 5) this.forge.currentItemBurnTime = newValue;
- }
- public ItemStack transferStackInSlot(EntityPlayer player, int slot)
- {
- return null;
- }
- public boolean canInteractWith(EntityPlayer entityplayer)
- {
- return this.forge.isUseableByPlayer(entityplayer);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment