Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.nextlevelminecraft.cad435.ClientDependencies.GUI.GliderGui;
- import com.nextlevelminecraft.cad435.ClientDependencies.GliderFramework.GliderInventory;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.inventory.Container;
- import net.minecraft.inventory.IInventory;
- import net.minecraft.inventory.Slot;
- import net.minecraft.item.ItemStack;
- //Slot handling
- public class GliderGuiContainer extends Container {
- public IInventory PlanInv;
- EntityPlayer player;
- public GliderGuiContainer(InventoryPlayer inventoryPlayer, EntityPlayer _player)
- {
- player = _player;
- PlanInv = new GliderInventory(player.getEntityWorld(),player.posX,player.posY,player.posZ);
- //Stick places
- addSlotToContainer(new Slot(PlanInv, 0, -14, 10));
- addSlotToContainer(new Slot(PlanInv, 1, -14, 40));
- addSlotToContainer(new Slot(PlanInv, 2, -14, 70));
- //Belt Places
- addSlotToContainer(new Slot(PlanInv, 3, 39, 63));
- addSlotToContainer(new Slot(PlanInv, 4, 67, 63));
- addSlotToContainer(new Slot(PlanInv, 5, 96, 63));
- //Wings
- addSlotToContainer(new Slot(PlanInv, 6, 90, 6));
- addSlotToContainer(new Slot(PlanInv, 7, 31, -5));
- //End-Product
- addSlotToContainer(new Slot(PlanInv, 8, 165, 29));
- //Normal Player Inv
- bindPlayerInventory(inventoryPlayer);
- }
- protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) {
- //Use-Bar
- for (int i = 0; i < 9; i++) {
- addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142 + 24));
- //System.out.println(i);
- }
- //Player-Inventory
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < 9; j++) {
- addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9,
- 8 + j * 18, 84 + 24 + i * 18));
- }
- }
- }
- @Override
- public boolean canInteractWith(EntityPlayer p_75145_1_) {
- return true;
- }
- @Override
- public ItemStack transferStackInSlot(EntityPlayer player, int slot) {
- //TODO: do the transfer
- return null;
- }
- @Override
- public void onContainerClosed(EntityPlayer p_75134_1_)
- {
- PlanInv.closeInventory();
- super.onContainerClosed(p_75134_1_);
- }
- //Todo: validate if item can stay in slot
- //Todo: Testing on server: drop remaining item(s) on close
- //Todo: destroy Plan on crafting success
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement