Examples of IAEItemStack


Examples of appeng.api.storage.data.IAEItemStack

    {
      InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );

      for (Entry<CraftingTreeNode, Long> entry : nodes.entrySet())
      {
        IAEItemStack item = entry.getKey().getStack( entry.getValue() );
        IAEItemStack stack = entry.getKey().request( inv, item.getStackSize(), src );

        ic.setInventorySlotContents( entry.getKey().slot, stack.getItemStack() );
      }

      FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) world ), details.getOutput( ic, world ), ic );

      for (int x = 0; x < ic.getSizeInventory(); x++)
      {
        ItemStack is = ic.getStackInSlot( x );
        is = Platform.getContainerItem( is );

        IAEItemStack o = AEApi.instance().storage().createItemStack( is );
        if ( o != null )
        {
          bytes++;
          inv.injectItems( o, Actionable.MODULATE, src );
        }
      }
    }
    else
    {
      // request and remove inputs...
      for (Entry<CraftingTreeNode, Long> entry : nodes.entrySet())
      {
        IAEItemStack item = entry.getKey().getStack( entry.getValue() );
        IAEItemStack stack = entry.getKey().request( inv, item.getStackSize() * i, src );

        if ( containerItems )
        {
          ItemStack is = Platform.getContainerItem( stack.getItemStack() );
          IAEItemStack o = AEApi.instance().storage().createItemStack( is );
          if ( o != null )
          {
            bytes++;
            inv.injectItems( o, Actionable.MODULATE, src );
          }
        }
      }
    }

    // assume its possible.

    // add crafting results..
    for (IAEItemStack out : details.getCondensedOutputs())
    {
      IAEItemStack o = out.copy();
      o.setStackSize( o.getStackSize() * i );
      inv.injectItems( o, Actionable.MODULATE, src );
    }

    crafts += i;
  }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

    return new IMEAdaptorIterator( this, getList() );
  }

  public ItemStack doRemoveItemsFuzzy(int how_many, ItemStack Filter, IInventoryDestination destination, Actionable type, FuzzyMode fuzzyMode)
  {
    IAEItemStack reqFilter = AEItemStack.create( Filter );
    if ( reqFilter == null )
      return null;

    IAEItemStack out = null;

    for (IAEItemStack req : ImmutableList.copyOf( getList().findFuzzy( reqFilter, fuzzyMode ) ))
    {
      if ( req != null )
      {
        req.setStackSize( how_many );
        out = target.extractItems( req, type, src );
        if ( out != null )
          return out.getItemStack();
      }
    }

    return null;
  }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

    return null;
  }

  public ItemStack doRemoveItems(int how_many, ItemStack Filter, IInventoryDestination destination, Actionable type)
  {
    IAEItemStack req = null;

    if ( Filter == null )
    {
      IItemList<IAEItemStack> list = getList();
      if ( !list.isEmpty() )
        req = list.getFirstItem();
    }
    else
      req = AEItemStack.create( Filter );

    IAEItemStack out = null;

    if ( req != null )
    {
      req.setStackSize( how_many );
      out = target.extractItems( req, type, src );
    }

    if ( out != null )
      return out.getItemStack();

    return null;
  }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

  }

  @Override
  public ItemStack addItems(ItemStack A)
  {
    IAEItemStack in = AEItemStack.create( A );
    if ( in != null )
    {
      IAEItemStack out = target.injectItems( in, Actionable.MODULATE, src );
      if ( out != null )
        return out.getItemStack();
    }
    return null;
  }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

  }

  @Override
  public ItemStack simulateAdd(ItemStack A)
  {
    IAEItemStack in = AEItemStack.create( A );
    if ( in != null )
    {
      IAEItemStack out = target.injectItems( in, Actionable.SIMULATE, src );
      if ( out != null )
        return out.getItemStack();
    }
    return null;
  }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

  @TileEvent(TileEventType.NETWORK_READ)
  public boolean readFromStream_TileCharger(ByteBuf data)
  {
    try
    {
      IAEItemStack item = AEItemStack.loadItemStackFromPacket( data );
      ItemStack is = item.getItemStack();
      inv.setInventorySlotContents( 0, is );
    }
    catch (Throwable t)
    {
      inv.setInventorySlotContents( 0, null );
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

    if ( parent.maxSlots < offset )
      parent.maxSlots = offset;

    if ( hasNext )
    {
      IAEItemStack item = stack.next();
      slot.setAEItemStack( item );
      return slot;
    }

    slot.setItemStack( null );
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

          PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate();

          for (IAEItemStack is : items)
          {
            IAEItemStack send = monitorCache.findPrecise( is );
            if ( send == null )
            {
              is.setStackSize( 0 );
              piu.appendItem( is );
            }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

  }

  public IAEItemStack getStack(long size)
  {
    IAEItemStack is = what.copy();
    is.setStackSize( size );
    return is;
  }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

    {
      if ( getStackInSlot( 0 ) != null )
      {
        IMEInventory<IAEItemStack> cell = getHandler( StorageChannel.ITEMS );

        IAEItemStack returns = Platform.poweredInsert( this, cell, AEApi.instance().storage().createItemStack( inv.getStackInSlot( 0 ) ), mySrc );

        if ( returns == null )
          inv.setInventorySlotContents( 0, null );
        else
          inv.setInventorySlotContents( 0, returns.getItemStack() );
      }
    }
    catch (ChestNoHandler ignored)
    {
    }
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.