Guest User

ContainerAlloyOven Class

a guest
Oct 22nd, 2014
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.68 KB | None | 0 0
  1. package com.arucraft.container;
  2.  
  3. import net.minecraft.entity.player.EntityPlayer;
  4. import net.minecraft.entity.player.InventoryPlayer;
  5. import net.minecraft.inventory.Container;
  6. import net.minecraft.inventory.ICrafting;
  7. import net.minecraft.inventory.Slot;
  8.  
  9. import com.arucraft.slot.SlotAlloyOven;
  10. import com.arucraft.tileentity.TileEntityAlloyOven;
  11.  
  12. public class ContainerAlloyOven extends Container {
  13.  
  14.     private TileEntityAlloyOven oven;
  15.     private int tripCookTime;
  16.     private int tripPower;
  17.     private int lastItemBurnTime;
  18.  
  19.     public ContainerAlloyOven(InventoryPlayer invPlayer, TileEntityAlloyOven teAlloyOven) {
  20.         tripCookTime = 0;
  21.         tripPower = 0;
  22.         lastItemBurnTime = 0;
  23.  
  24.         oven = teAlloyOven;
  25.  
  26.         this.addSlotToContainer(new Slot(teAlloyOven, 0, 44, 16));
  27.         this.addSlotToContainer(new Slot(teAlloyOven, 1, 44, 35));
  28.         this.addSlotToContainer(new Slot(teAlloyOven, 2, 44, 54));
  29.         this.addSlotToContainer(new Slot(teAlloyOven, 3, 8, 55));
  30.         this.addSlotToContainer(new SlotAlloyOven(invPlayer.player, teAlloyOven, 4, 124, 35));
  31.  
  32.         //Inventory
  33.         for(int i = 0; i < 3; i++) {
  34.             for(int j = 0; j < 9; j++) {
  35.                 this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
  36.             }
  37.         }
  38.  
  39.         //ActionBar
  40.         for(int i = 0; i < 9; i++) {
  41.             this.addSlotToContainer(new Slot(invPlayer, 8, 8 + i * 18, 142));
  42.         }
  43.  
  44.     }
  45.    
  46.     public void addCraftingToCrafters (ICrafting icraft) {
  47.         super.addCraftingToCrafters(icraft);
  48.         icraft.sendProgressBarUpdate(this, 0, this.oven.tripCooktime);
  49.         icraft.sendProgressBarUpdate(this, 1, this.oven.tripPower);
  50.     }
  51.  
  52.     @Override
  53.     public boolean canInteractWith(EntityPlayer player) {
  54.         return oven.isUseableByPlayer(player);
  55.     }
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment