Guest User

Untitled

a guest
Aug 26th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.73 KB | None | 0 0
  1. package melonslise.runicinscription.common.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.IInventory;
  7. import net.minecraft.inventory.InventoryCraftResult;
  8. import net.minecraft.inventory.InventoryCrafting;
  9. import net.minecraft.inventory.Slot;
  10. import net.minecraft.item.ItemStack;
  11. import net.minecraft.world.World;
  12.  
  13. public class ContainerRuneInscription extends Container
  14. {
  15.     public InventoryCrafting craftMatrix;
  16.     public IInventory craftResult;
  17.     private World worldObj;
  18.     private int posX;
  19.     private int posY;
  20.     private int posZ;
  21.    
  22.     public ContainerRuneInscription(InventoryPlayer inventoryPlayer, World world, int x, int y, int z)
  23.     {
  24.         this.craftMatrix = new InventoryCrafting(this, 5, 5);
  25.         this.craftResult = new InventoryCraftResult();
  26.         this.worldObj = world;
  27.         this.posX = x;
  28.         this.posY = y;
  29.         this.posZ = z;
  30.        
  31.         for (int i = 0; i < 3; ++i)
  32.         {
  33.             for (int k = 0; k < 9; ++k)
  34.             {
  35.                 this.addSlotToContainer(new Slot(inventoryPlayer, k + i * 9 + 9, 8 + k * 18, 84 + i * 18));
  36.             }
  37.         }
  38.        
  39.         for (int i = 0; i < 9; ++i)
  40.         {
  41.             this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
  42.         }
  43.        
  44.         onCraftMatrixChanged(craftMatrix);
  45.     }
  46.    
  47.     @Override
  48.     public ItemStack transferStackInSlot(EntityPlayer player, int fromSlot)
  49.     {
  50.         return null;
  51.        
  52.         //On shift-click
  53.     }
  54.    
  55.     public void onContainerClosed(EntityPlayer player)
  56.     {
  57.         super.onContainerClosed(player);
  58.        
  59.         //On closed
  60.     }
  61.    
  62.     public void onCraftMatrixChanged(IInventory iinventory)
  63.     {
  64.         //On craft
  65.     }
  66.    
  67.     @Override
  68.     public boolean canInteractWith(EntityPlayer player)
  69.     {
  70.         return true;
  71.     }
  72. }
Add Comment
Please, Sign In to add comment