Advertisement
riking

Untitled

Jan 15th, 2013
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package net.minecraft.server;
  2.  
  3. public abstract class ContainerNormal extends Container {
  4.     public ProperContainer(InventoryPlayer playerinv, IInventory holder, int[][] coords) {
  5.         bindPlayerInventory(playerinv);
  6.         setupSlots(holder, coords);
  7.     }
  8.    
  9.     public ProperContainer(InventoryPlayer playerinv) {
  10.         bindPlayerInventory(playerinv);
  11.     }
  12.    
  13.     public void bindPlayerInventory(InventoryPlayer playerinv) {
  14.         for (int x = 0; x < 9; x++) {
  15.             addSlotToContainer(new Slot(playerinv, x, 8+x*18, 126));
  16.         }
  17.  
  18.         for (int y = 0; y < 3; y++) {
  19.             for (int x = 0; x < 9; x++) {
  20.                 addSlotToContainer(new Slot(playerinv, y*9+x+9, 8+x*18, 68+y*18));
  21.             }
  22.         }
  23.     }
  24.    
  25.     public void setupSlots(IInventory holder, int[][] coords) {
  26.         for(int i = 0; i < coords.length; i++) {
  27.             addSlotToContainer(new Slot(holder, i, coords[i][0], coords[i][1]));
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement