Package net.minecraft.inventory

Examples of net.minecraft.inventory.Slot


    super(playerInv, te);
  }

  @Override
  protected void addMachineSlots(InventoryPlayer playerInv) {
    addSlotToContainer(new Slot(tileEntity, 0, 80, 25) {
      @Override
      public boolean isItemValid(ItemStack itemStack) {
        return tileEntity.isItemValidForSlot(0, itemStack);
      }
    });
View Full Code Here


      }
    }
  }

  protected void renderSlotHighlight(int slot, Vector4f col) {
    Slot invSlot = (Slot) inventorySlots.inventorySlots.get(slot);
    renderSlotHighlight(col, invSlot.xDisplayPosition, invSlot.yDisplayPosition, 16, 16);
  }
View Full Code Here

  {
    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, i * 18 + 79));
      }
    }

    for (int i = 0; i < 9; i++)
    {
      addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 137));
    }
  }
View Full Code Here

  @Override
  public ItemStack transferStackInSlot(EntityPlayer player, int slotnumber)
  {
    ItemStack itemstack = null;
    Slot slot = (Slot) inventorySlots.get(slotnumber);
    if (slot != null && slot.getHasStack())
    {
      ItemStack itemstack1 = slot.getStack();
      itemstack = itemstack1.copy();
      if (inventory.isItemValidForSlot(0, itemstack1))
      {
        if (slotnumber >= 0 && slotnumber <= 7)
        {
          mergeItemStack(itemstack, 8, 43, true);
          slot.onSlotChanged();
          return null;
        } else if (slotnumber >= 8 && slotnumber <= 43)
        {
          mergeItemStack(itemstack, 0, 7, true);
          slot.onSlotChanged();
          return null;
        }
        if (itemstack1.stackSize == 0)
        {
          slot.putStack(null);
        } else
        {
          slot.onSlotChanged();
        }
      } else
      {
        return null;
      }
View Full Code Here

  {
    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, i * 18 + 112));
      }
    }

    for (int i = 0; i < 9; i++)
    {
      addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 170));
    }
  }
View Full Code Here

  @Override
  public ItemStack transferStackInSlot(EntityPlayer player, int slotnumber)
  {
    ItemStack itemstack = null;
    Slot slot = (Slot) inventorySlots.get(slotnumber);
    if (slot != null && slot.getHasStack())
    {
      ItemStack itemstack1 = slot.getStack();
      itemstack = itemstack1.copy();
      itemstack.stackSize = 1;
      if (tileentity.isItemValidForSlot(0, itemstack1))
      {
        if (slotnumber >= 0 && slotnumber <= 53)
        {
          shiftItemStack(itemstack, 54, 90);
          return null;
        } else if (slotnumber >= 54 && slotnumber <= 90)
        {
          shiftItemStack(itemstack, 0, 53);
          return null;
        }
        if (itemstack1.stackSize == 0)
        {
          slot.putStack(null);
        } else
        {
          slot.onSlotChanged();
        }
      } else
      {
        return null;
      }
View Full Code Here

  {
    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, i * 18 + 84));
      }
    }

    for (int i = 0; i < 9; i++)
    {
      addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
    }
  }
View Full Code Here

  @Override
  public ItemStack transferStackInSlot(EntityPlayer player, int slotnumber)
  {
    ItemStack itemstack = null;
    Slot slot = (Slot) inventorySlots.get(slotnumber);
    if (slot != null && slot.getHasStack())
    {
      ItemStack itemstack1 = slot.getStack();
      itemstack = itemstack1.copy();
      itemstack.stackSize = 1;
      if (tileentity.isItemValidForSlot(0, itemstack1))
      {
        if (slotnumber == 0)
View Full Code Here

  {
    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, i * 18 + 79));
      }
    }

    for (int i = 0; i < 9; i++)
    {
      addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 137));
    }
  }
View Full Code Here

  @Override
  public ItemStack transferStackInSlot(EntityPlayer player, int slotnumber)
  {
    ItemStack itemstack = null;
    Slot slot = (Slot) inventorySlots.get(slotnumber);
    if (slot != null && slot.getHasStack())
    {
      ItemStack itemstack1 = slot.getStack();
      itemstack = itemstack1.copy();
      itemstack.stackSize = 1;
      if (tileentity.isItemValidForSlot(0, itemstack1))
      {
        if (slotnumber >= 0 && slotnumber <= 7)
        {
          shiftItemStack(itemstack, 8, 43);
          return null;
        } else if (slotnumber >= 8 && slotnumber <= 43)
        {
          shiftItemStack(itemstack, 0, 7);
          return null;
        }
        if (itemstack1.stackSize == 0)
        {
          slot.putStack(null);
        } else
        {
          slot.onSlotChanged();
        }
      } else
      {
        return null;
      }
View Full Code Here

TOP

Related Classes of net.minecraft.inventory.Slot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.