Package net.minecraft.inventory

Examples of net.minecraft.inventory.IInventory


      inv.setInventorySlotContents(slotIndex, itemstack);
  }

  @Override
  public int getInventoryStackLimit() {
    IInventory inv = getStructureInventory();
    if (inv != null)
      return inv.getInventoryStackLimit();
    else
      return 0;
  }
View Full Code Here


    return super.getAccessibleSlotsFromSide(side);
  }

  public ItemStack[] extractItem(boolean doRemove, ForgeDirection from, int maxItemCount) {

    IInventory inv;
    if (hasMaster()) {
      ITileStructure central = getCentralTE();
      if (central == null)
        return new ItemStack[0];
      inv = getCentralTE().getInventory();
    } else
      return StackUtils.EMPTY_STACK_ARRAY;

    ItemStack product = null;

    for (int i = TileFarmPlain.SLOT_PRODUCTION_1; i < TileFarmPlain.SLOT_PRODUCTION_1 + TileFarmPlain.SLOT_COUNT_PRODUCTION; i++) {
      if (inv.getStackInSlot(i) == null)
        continue;

      ItemStack stack = inv.getStackInSlot(i);

      if (doRemove)
        product = inv.decrStackSize(i, 1);
      else {
        product = stack.copy();
        product.stackSize = 1;
      }
      break;
View Full Code Here

    return null;
  }

  @Override
  public int getSizeInventory() {
    IInventory inv = getStructureInventory();
    if (inv != null)
      return inv.getSizeInventory();
    else
      return 0;
  }
View Full Code Here

      return 0;
  }

  @Override
  public ItemStack getStackInSlot(int slotIndex) {
    IInventory inv = getStructureInventory();
    if (inv != null)
      return inv.getStackInSlot(slotIndex);
    else
      return null;
  }
View Full Code Here

      return null;
  }

  @Override
  public ItemStack decrStackSize(int slotIndex, int amount) {
    IInventory inv = getStructureInventory();
    if (inv != null)
      return inv.decrStackSize(slotIndex, amount);
    else
      return null;
  }
View Full Code Here

      return null;
  }

  @Override
  public ItemStack getStackInSlotOnClosing(int slotIndex) {
    IInventory inv = getStructureInventory();
    if (inv != null)
      return inv.getStackInSlotOnClosing(slotIndex);
    else
      return null;
  }
View Full Code Here

  public void setInventorySlotContents(int slotIndex, ItemStack itemstack) {
    // Client side handling for container synch
    if (inventory == null && !Proxies.common.isSimulating(worldObj))
      createInventory();

    IInventory inv = getStructureInventory();
    if (inv != null)
      inv.setInventorySlotContents(slotIndex, itemstack);
  }
View Full Code Here

    return getUnlocalizedName();
  }

  @Override
  public int getInventoryStackLimit() {
    IInventory inv = getStructureInventory();
    if (inv != null)
      return inv.getInventoryStackLimit();
    else
      return 0;
  }
View Full Code Here

  /* ISPECIALINVENTORY */
  @Override
  public int addItem(ItemStack stack, boolean doAdd, ForgeDirection from) {

    IInventory inv = getStructureInventory();
    if (inv == null)
      return 0;

    // Princesses && Queens
    if (ForestryItem.beePrincessGE.isItemEqual(stack) || ForestryItem.beeQueenGE.isItemEqual(stack))
      if (inv.getStackInSlot(SLOT_QUEEN) == null) {
        if (doAdd) {
          inv.setInventorySlotContents(SLOT_QUEEN, stack.copy());
          inv.getStackInSlot(SLOT_QUEEN).stackSize = 1;
        }
        return 1;
      }

    // Drones
    if (ForestryItem.beeDroneGE.isItemEqual(stack)) {

      ItemStack droneStack = inv.getStackInSlot(SLOT_DRONE);
      if (droneStack == null) {
        if (doAdd)
          inv.setInventorySlotContents(SLOT_DRONE, stack.copy());
        return stack.stackSize;
      } else {
        if (!droneStack.isItemEqual(stack))
          return 0;
        if (!ItemStack.areItemStackTagsEqual(droneStack, stack))
View Full Code Here

  }

  @Override
  public ItemStack[] extractItem(boolean doRemove, ForgeDirection from, int maxItemCount) {

    IInventory inv = getStructureInventory();
    if (inv == null)
      return new ItemStack[0];

    ItemStack product = null;

    for (int i = SLOT_PRODUCT_1; i < inv.getSizeInventory(); i++) {
      if (inv.getStackInSlot(i) == null)
        continue;

      ItemStack stack = inv.getStackInSlot(i);

      if (doRemove)
        product = inv.decrStackSize(i, 1);
      else {
        product = stack.copy();
        product.stackSize = 1;
      }
      break;
View Full Code Here

TOP

Related Classes of net.minecraft.inventory.IInventory

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.