Guest User

Untitled

a guest
Apr 29th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.60 KB | None | 0 0
  1. package neg2013.acsension.inventory;
  2.  
  3. import com.ibm.icu.util.Region;
  4.  
  5. import cpw.mods.fml.relauncher.Side;
  6. import cpw.mods.fml.relauncher.SideOnly;
  7. import neg2013.acsension.slot.CrusherInputSlot;
  8. import neg2013.acsension.slot.CrusherOutputSlot;
  9. import neg2013.acsension.slot.GenericSlot;
  10. import neg2013.acsension.tile_entity.TECrusher;
  11. import neg2013.acsension.tile_entity.TEDecomp;
  12. import net.minecraft.entity.player.EntityPlayer;
  13. import net.minecraft.entity.player.InventoryPlayer;
  14. import net.minecraft.inventory.Container;
  15. import net.minecraft.inventory.Slot;
  16.  
  17. public class DecompContainer extends Container{
  18.  
  19.     private TEDecomp decomp;
  20.     private int slotId = -1;
  21.    
  22.    
  23.    
  24.     private int nextId(){
  25.         slotId++;
  26.         return slotId;
  27.     }
  28.    
  29.     public DecompContainer(InventoryPlayer invPlayer, TEDecomp decomp){
  30.    
  31.         this.decomp = decomp;
  32.        
  33.        
  34.        
  35.         // player inv
  36.         //hot bar
  37.         for(int x = 0; x < 9; x++){
  38.             addSlotToContainer(new Slot(invPlayer, x, 8 + (18 * x), 146));
  39.         }
  40.        
  41.         for(int x = 0; x < 9; x++)
  42.             for(int y = 0; y < 3; y++)
  43.                
  44.                 addSlotToContainer(new Slot(invPlayer, x + y * 9 + 9, 8 + 18 * x, 88 + 18 * y));
  45.    
  46.            
  47.            
  48.            
  49.        
  50.         // player inv
  51.  
  52.        
  53.        
  54.         addSlotToContainer(new GenericSlot(decomp, nextId(), 80, 15));         
  55.         addSlotToContainer(new GenericSlot(decomp, nextId(), 60, 64));         
  56.         addSlotToContainer(new GenericSlot(decomp, nextId(), 80, 64));         
  57.         addSlotToContainer(new GenericSlot(decomp, nextId(), 100, 64));        
  58.        
  59.        
  60.     }
  61.    
  62.  
  63.    
  64.    
  65.    
  66.    
  67.     @Override
  68.     public boolean canInteractWith(EntityPlayer player) {
  69.  
  70.         return decomp.isUseableByPlayer(player);
  71.     }
  72.  
  73.      
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment