Advertisement
Guest User

Example Container

a guest
Jul 1st, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. package iitest.gui;
  2.  
  3. import iitest.capability.ITest;
  4. import net.minecraft.entity.player.EntityPlayer;
  5. import net.minecraft.inventory.Container;
  6. import net.minecraft.inventory.IInventory;
  7. import net.minecraft.inventory.Slot;
  8. import net.minecraft.item.ItemStack;
  9.  
  10. public class TestContainer extends Container {
  11.  
  12.     public TestContainer(ITest cap, EntityPlayer player) {
  13.         addSlotToContainer(new Slot(cap, 0, 0, 0));
  14.  
  15.         for (int y = 0; y < 4; y++) {
  16.             for (int x = 0; x < 9; x++) {
  17.                 addSlotToContainer(new Slot(player.inventory, y * 9 + x, x * 18, y * 18 + 24));
  18.             }
  19.         }
  20.     }
  21.  
  22.     @Override
  23.     public boolean canInteractWith(EntityPlayer playerIn) {
  24.         return true;
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement