Package net.minecraft.inventory

Examples of net.minecraft.inventory.Slot


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

    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 p, int i)
  {
    ItemStack itemstack = null;
    Slot slot = (Slot) inventorySlots.get(i);
    if (slot != null && slot.getHasStack())
    {
      ItemStack itemstack1 = slot.getStack();
      itemstack = itemstack1.copy();
      if (appeng.api.Util.getCellRegistry().isCellHandled(itemstack))
      {
        if (i < 3)
        {
          if (!mergeItemStack(itemstack1, 3, 38, false))
          {
            return null;
          }
        } else if (!mergeItemStack(itemstack1, 0, 3, false))
        {
          return null;
        }
        if (itemstack1.stackSize == 0)
        {
          slot.putStack(null);
        } else
        {
          slot.onSlotChanged();
        }
      }
    }
    return itemstack;
  }
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 + 115));
      }
    }

    for (int i = 0; i < 9; i++)
    {
      addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 173));
    }
  }
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(slotnumber, itemstack1))
      {
        if (slotnumber >= 0 && slotnumber <= 5)
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 + 104));
      }
    }

    for (int i = 0; i < 9; i++)
    {
      addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 162));
    }
  }
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 (inventoryTileEntity.isItemValidForSlot(0, itemstack1))
      {
        if (slotnumber == 1 || slotnumber == 0)
        {
          if (!mergeItemStack(itemstack1, 3, 38, false))
            return null;
        } else if (slotnumber != 1 && slotnumber != 0)
        {
          if (!mergeItemStack(itemstack1, 0, 1, false))
            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();
      if (tileentity.isItemValidForSlot(0, itemstack1))
      {
        if (slotnumber < 10)
        {
          if (!mergeItemStack(itemstack1, 10, 36, false))
            return null;
        } else if (slotnumber >= 10 && slotnumber <= 36)
        {
          if (!mergeItemStack(itemstack1, 0, 1, false))
            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 + 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.