Advertisement
Guest User

Untitled

a guest
Feb 9th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.23 KB | None | 0 0
  1. //Container
  2.  
  3.  
  4.  
  5.  
  6. package com.nextlevelminecraft.cad435.ClientDependencies.GUI.GliderGui;
  7.  
  8. import net.minecraft.entity.player.EntityPlayer;
  9. import net.minecraft.entity.player.InventoryPlayer;
  10. import net.minecraft.inventory.Container;
  11. import net.minecraft.inventory.Slot;
  12. import net.minecraft.item.ItemStack;
  13.  
  14.  
  15.  
  16. //Slot handling
  17. public class GliderGuiContainer extends Container {
  18.     public GliderGuiContainer(InventoryPlayer inventoryPlayer)
  19.     {
  20.  
  21.  
  22.         //Stick places
  23.         addSlotToContainer(new Slot(inventoryPlayer, 36, -14, 10));
  24.         addSlotToContainer(new Slot(inventoryPlayer, 37, -14, 40));
  25.         addSlotToContainer(new Slot(inventoryPlayer, 38, -14, 70));
  26.         //Belt Places
  27.         addSlotToContainer(new Slot(inventoryPlayer, 39, 39, 63));
  28.         addSlotToContainer(new Slot(inventoryPlayer, 40, 67, 63)); // this crashes the integrated server
  29.         addSlotToContainer(new Slot(inventoryPlayer, 41, 39, 96));
  30.  
  31.         //Wings
  32.         addSlotToContainer(new Slot(inventoryPlayer, 42, 90, 6));
  33.         addSlotToContainer(new Slot(inventoryPlayer, 43, 31, -5));
  34.  
  35.         //End-Product
  36.         addSlotToContainer(new Slot(inventoryPlayer, 44, 165, 29));
  37.  
  38.         //Normal Player Inv
  39.         bindPlayerInventory(inventoryPlayer);
  40.     }
  41.  
  42.  
  43.     protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) {
  44.  
  45.  
  46.         //Use-Bar
  47.         for (int i = 0; i < 9; i++) {
  48.             addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142 + 24));
  49.             //System.out.println(i);
  50.         }
  51.         //Player-Inventory
  52.         for (int i = 0; i < 3; i++) {
  53.             for (int j = 0; j < 9; j++) {
  54.                 addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9,
  55.                         8 + j * 18, 84 + 24 + i * 18));
  56.             }
  57.         }
  58.     }
  59.  
  60.  
  61.     @Override
  62.     public boolean canInteractWith(EntityPlayer p_75145_1_) {
  63.         return true;
  64.     }
  65.  
  66.    @Override
  67.     public ItemStack transferStackInSlot(EntityPlayer player, int slot) {
  68.        //TODO: do the transfer
  69.        
  70.         return null;
  71.     }
  72.  
  73.     //Todo: validate if item can stay in slot
  74.    
  75.     //Todo: drop remaining item(s) on close
  76.    
  77.     //Todo: destroy Plan on crafting success
  78.  
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement