Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.07 KB | None | 0 0
  1. package net.theviolentsquirrels.questsystem.inventory;
  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.Slot;
  7.  
  8. public class        ModContainer extends Container {
  9.  
  10.     @Override
  11.     public boolean  canInteractWith(EntityPlayer playerIn) {
  12.         return (false);
  13.     }
  14.  
  15.     protected void  addPlayerSlots(InventoryPlayer playerInventory) {
  16.  
  17.         /**
  18.          *  This adds the player inventory slots to the container
  19.          *  Slots IDs from 9 to 35
  20.          */
  21.         for (int y = 0; y < 3; ++y) {
  22.             for (int x = 0; x < 9; ++x) {
  23.                 this.addSlotToContainer(new Slot(playerInventory, x + y * 9 + 9, 8 + x * 18, 84 + y * 18));
  24.             }
  25.         }
  26.  
  27.         /**
  28.          *  This adds the player hotbar slots to the container
  29.          *  Slots IDs from 0 to 8
  30.          */
  31.         for (int x = 0; x < 9; ++x) {
  32.             this.addSlotToContainer(new Slot(playerInventory, x, 8 + x * 18, 142));
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement