Advertisement
Guest User

ProperContainer

a guest
Jan 15th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. public class ProperContainer extends Container {
  2.  
  3.     public ProperContainer(InventoryPlayer playerinv, IInventory holder, int[] coords){
  4.         assert(coords.length %2 == 0);
  5.         bind(this, playerinv);
  6.  
  7.         int x, y;
  8.         for(int i=0; i!=coords.length; i+=2){
  9.             x= coords[i];
  10.             y= coords[i+1];
  11.  
  12.             addSlotToContainer(new Slot(holder, i, x, y));
  13.         }
  14.     }
  15.     @Override
  16.     public boolean canInteractWith(EntityPlayer var1) {return true; }
  17.  
  18.     public static void bind(ProperContainer cont, InventoryPlayer playerinv){
  19.         for (int x = 0; x < 9; x++) {
  20.             cont.addSlotToContainer(new Slot(playerinv, x, 8+x*18, 126));   }
  21.  
  22.         for (int y = 0; y < 3; y++) {
  23.             for (int x = 0; x < 9; x++) {
  24.                 cont.addSlotToContainer(new Slot(playerinv, y*9+x+9, 8+x*18, 68+y*18)); }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement