Examples of ISidedInventory


Examples of net.minecraft.inventory.ISidedInventory

          return new InvStack(inventory, i, toSend);
        }
      }
    }
    else {
      ISidedInventory sidedInventory = (ISidedInventory)inventory;
      int[] slots = sidedInventory.getAccessibleSlotsFromSide(ForgeDirection.OPPOSITES[side]);

      if(slots != null && slots.length != 0)
      {
        for(int get = slots.length - 1; get >= 0; get--)
        {
          int slotID = slots[get];

          if(sidedInventory.getStackInSlot(slotID) != null && id.modifies(sidedInventory.getStackInSlot(slotID)))
          {
            ItemStack toSend = sidedInventory.getStackInSlot(slotID);

            if(sidedInventory.canExtractItem(slotID, toSend, ForgeDirection.OPPOSITES[side]))
            {
              return new InvStack(inventory, slotID, toSend);
            }
          }
        }
View Full Code Here

Examples of net.minecraft.inventory.ISidedInventory

          }
        }
      }
    }
    else {
      ISidedInventory sidedInventory = (ISidedInventory)inventory;
      int[] slots = sidedInventory.getAccessibleSlotsFromSide(ForgeDirection.OPPOSITES[side]);

      if(slots != null && slots.length != 0)
      {
        if(force && sidedInventory instanceof TileEntityBin && ForgeDirection.OPPOSITES[side] == 0)
        {
          slots = sidedInventory.getAccessibleSlotsFromSide(1);
        }

        for(int get = 0; get <= slots.length - 1; get++)
        {
          int slotID = slots[get];

          if(!force)
          {
            if(!sidedInventory.isItemValidForSlot(slotID, itemStack) || !sidedInventory.canInsertItem(slotID, itemStack, ForgeDirection.OPPOSITES[side]))
            {
              continue;
            }
          }
View Full Code Here

Examples of net.minecraft.inventory.ISidedInventory

        if(inventory.getSizeInventory() > 0)
        {
          if(inventory instanceof ISidedInventory)
          {
            ISidedInventory sidedInventory = (ISidedInventory)inventory;

            if(sidedInventory.getAccessibleSlotsFromSide(forgeSide.ordinal()) != null)
            {
              if(sidedInventory.getAccessibleSlotsFromSide(forgeSide.ordinal()).length > 0)
              {
                connectable[side] = true;
              }
            }
          }
View Full Code Here

Examples of net.minecraft.inventory.ISidedInventory

          }
        }
      }
    }
    else {
      ISidedInventory sidedInventory = (ISidedInventory)inventory;
      int[] slots = sidedInventory.getAccessibleSlotsFromSide(ForgeDirection.OPPOSITES[side]);

      if(slots != null && slots.length != 0)
      {
        if(force && sidedInventory instanceof TileEntityBin && ForgeDirection.OPPOSITES[side] == 0)
        {
          slots = sidedInventory.getAccessibleSlotsFromSide(1);
        }

        for(int get = 0; get <= slots.length - 1; get++)
        {
          int slotID = slots[get];

          if(!force)
          {
            if(!sidedInventory.isItemValidForSlot(slotID, toInsert) && !sidedInventory.canInsertItem(slotID, toInsert, ForgeDirection.OPPOSITES[side]))
            {
              continue;
            }
          }
View Full Code Here

Examples of net.minecraft.inventory.ISidedInventory

          return new InvStack(inventory, i, toSend);
        }
      }
    }
    else {
      ISidedInventory sidedInventory = (ISidedInventory)inventory;
      int[] slots = sidedInventory.getAccessibleSlotsFromSide(ForgeDirection.OPPOSITES[side]);

      if(slots != null)
      {
        for(int get = slots.length - 1; get >= 0; get--)
        {
          int slotID = slots[get];

          if(sidedInventory.getStackInSlot(slotID) != null && sidedInventory.getStackInSlot(slotID).stackSize > 0)
          {
            ItemStack toSend = sidedInventory.getStackInSlot(slotID).copy();
            toSend.stackSize = 1;

            if(sidedInventory.canExtractItem(slotID, toSend, ForgeDirection.OPPOSITES[side]))
            {
              return new InvStack(inventory, slotID, toSend);
            }
          }
        }
View Full Code Here

Examples of net.minecraft.inventory.ISidedInventory

          continue;

        // Get complete inventory (for double chests)
        IInventory inventory = Utils.getChest(inventories[j]);
        if (inventory instanceof ISidedInventory) {
          ISidedInventory sidedInventory = (ISidedInventory)inventory;
          int[] slots = sidedInventory.getAccessibleSlotsFromSide(ForgeDirection.UP.ordinal());
          for (int sl = 0; sl < slots.length; ++sl) {
            StackUtils.stowInInventory(stack, sidedInventory, true, sl, 1);
          }
        }
        else {
View Full Code Here

Examples of net.minecraft.inventory.ISidedInventory

  public void tick() {
    if(++currentTickCount < ticksToOperation) return;
    currentTickCount = 0;
    IInventory inv = _service.getRealInventory();
    if(!(inv instanceof ISidedInventory)) return;
    ISidedInventory sinv = (ISidedInventory)inv;
    ForgeDirection direction = _service.inventoryOrientation().getOpposite();
    ItemStack stack = extractItem(sinv, false, direction, 1);
    if(stack == null) return;
    if(!(_service.canUseEnergy(100))) return;
   
View Full Code Here

Examples of net.minecraft.inventory.ISidedInventory

  @Override
  public boolean containsItems()
  {
    if ( i instanceof ISidedInventory )
    {
      ISidedInventory sided = (ISidedInventory) i;
      int slots[] = sided.getAccessibleSlotsFromSide( d.ordinal() );

      if ( slots == null )
        return false;

      for (int slot : slots)
View Full Code Here

Examples of net.minecraft.inventory.ISidedInventory

    {
      return new AdaptorISpecialInventory( (ISpecialInventory) te, d );
    }
    else if ( te instanceof ISidedInventory )
    {
      ISidedInventory si =(ISidedInventory)te;
      int[] slots = si.getAccessibleSlotsFromSide( d.ordinal() );
      if ( si.getSizeInventory() > 0 && slots != null && slots.length > 0 )
        return new AdaptorIInventory( new WrapperMCISidedInventory( si, d ) );
    }
    else if ( te instanceof IInventory )
    {
      IInventory i =(IInventory)te;
View Full Code Here

Examples of net.minecraft.inventory.ISidedInventory

    for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
    {
      IPart bp = getPart( side );
      if ( bp instanceof ISidedInventory )
      {
        ISidedInventory part = (ISidedInventory) bp;
        slotCount += part.getSizeInventory();
        inventories.add( part );
      }
    }

    if ( inventories.isEmpty() || slotCount == 0 )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.