Examples of IAEItemStack


Examples of appeng.api.storage.data.IAEItemStack

  }

  @Override
  public ItemStack getSingleItem(ItemIdentifier item) {
    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    IAEItemStack stack = AEApi.instance().storage().createItemStack(item.makeNormalStack(1));
    return tmp.getItemInventory().extractItems(stack, Actionable.MODULATE, source).getItemStack();
  }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

  }

  @Override
  public ItemStack getMultipleItems(ItemIdentifier item, int count) {
    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    IAEItemStack stack = AEApi.instance().storage().createItemStack(item.makeNormalStack(count));
    return tmp.getItemInventory().extractItems(stack, Actionable.MODULATE, source).getItemStack();
  }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

  }

  @Override
  public boolean containsItem(ItemIdentifier item) {
    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    IAEItemStack stack = AEApi.instance().storage().createItemStack(item.unsafeMakeNormalStack(1));
    return tmp.getItemInventory().extractItems(stack, Actionable.SIMULATE, source) != null;
  }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

  @Override
  public int roomForItem(ItemIdentifier item, int count) {
    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    while (count > 0) {
      IAEItemStack stack = AEApi.instance().storage().createItemStack(item.makeNormalStack(count));
      if (tmp.getItemInventory().canAccept(stack)) {
        return count;
      }
      count--;
    }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

  }

  @Override
  public ItemStack add(ItemStack stack, ForgeDirection from, boolean doAdd) {
    ItemStack st = stack.copy();
    IAEItemStack tst = AEApi.instance().storage().createItemStack(stack);

    IStorageMonitorable tmp = tile.getMonitorable(dir, source);
    IAEItemStack overflow = tmp.getItemInventory().injectItems(tst, Actionable.MODULATE, source);
    if (overflow != null) {
      st.stackSize -= overflow.getStackSize();
    }
    return st;
  }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

          bytesUsed = result.getByteTotal();

          for (IAEItemStack out : plan)
          {
            IAEItemStack m = null;

            IAEItemStack o = out.copy();
            o.reset();
            o.setStackSize( out.getStackSize() );

            IAEItemStack p = out.copy();
            p.reset();
            p.setStackSize( out.getCountRequestable() );

            IStorageGrid sg = getGrid().getCache( IStorageGrid.class );
            IMEInventory<IAEItemStack> items = sg.getItemInventory();

            if ( c != null && result.isSimulation() )
            {
              m = o.copy();
              o = items.extractItems( o, Actionable.SIMULATE, mySrc );

              if ( o == null )
              {
                o = m.copy();
                o.setStackSize( 0 );
              }

              m.setStackSize( m.getStackSize() - o.getStackSize() );
            }

            if ( o.getStackSize() > 0 )
              a.appendItem( o );

            if ( p.getStackSize() > 0 )
              b.appendItem( p );

            if ( c != null && m != null && m.getStackSize() > 0 )
              c.appendItem( m );
          }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

      return;

    if ( tile instanceof TileCraftingMonitorTile )
    {
      TileCraftingMonitorTile cmt = (TileCraftingMonitorTile) tile;
      IAEItemStack ais = cmt.getJobProgress();

      if ( cmt.dspList == null )
      {
        cmt.updateList = true;
        cmt.dspList = GLAllocation.generateDisplayLists( 1 );
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

  public void craftOrGetItem(PacketPatternSlot packetPatternSlot)
  {
    if ( packetPatternSlot.slotItem != null && cellInv != null )
    {
      IAEItemStack out = packetPatternSlot.slotItem.copy();

      InventoryAdaptor inv = new AdaptorPlayerHand( getPlayerInv().player );
      InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( getPlayerInv().player, ForgeDirection.UNKNOWN );
      if ( packetPatternSlot.shift )
        inv = playerInv;

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

      IAEItemStack extracted = Platform.poweredExtraction( powerSrc, cellInv, out, mySrc );
      EntityPlayer p = getPlayerInv().player;

      if ( extracted != null )
      {
        inv.addItems( extracted.getItemStack() );
        if ( p instanceof EntityPlayerMP )
          updateHeld( (EntityPlayerMP) p );
        detectAndSendChanges();
        return;
      }
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

    this.depth = depth;
    world = job.getWorld();

    if ( details.isCraftable() )
    {
      IAEItemStack list[] = details.getInputs();

      InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
      IAEItemStack[] is = details.getInputs();
      for (int x = 0; x < ic.getSizeInventory(); x++)
        ic.setInventorySlotContents( x, is[x] == null ? null : is[x].getItemStack() );

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

      for (int x = 0; x < ic.getSizeInventory(); x++)
      {
        ItemStack g = ic.getStackInSlot( x );
        if ( g != null && g.stackSize > 1 )
          fullSimulation = true;
      }

      for ( IAEItemStack part : details.getCondensedInputs() )
      {
        ItemStack g = part.getItemStack();

        boolean isAnInput = false;
        for ( IAEItemStack a : details.getCondensedOutputs() )
        {
          if ( g != null && a != null && a.equals( g ) )
            isAnInput = true;
        }

        if ( isAnInput )
          limitQty = true;

        if ( g.getItem().hasContainerItem( g ) )
          limitQty = containerItems = true;
      }

      boolean complicated = false;

      if ( containerItems || complicated )
      {
        for (int x = 0; x < list.length; x++)
        {
          IAEItemStack part = list[x];
          if ( part != null )
            nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, x, depth + 1 ), part.getStackSize() );
        }
      }
      else
      {
        // this is minorly different then below, this slot uses the pattern, but kinda fudges it.
        for (IAEItemStack part : details.getCondensedInputs())
        {
          for (int x = 0; x < list.length; x++)
          {
            IAEItemStack comparePart = list[x];
            if ( part != null && part.equals( comparePart ) )
            {
              // use the first slot...
              nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, x, depth + 1 ), part.getStackSize() );
              break;
View Full Code Here

Examples of appeng.api.storage.data.IAEItemStack

          {
            IGridBlock blk = machine.getGridBlock();
            ItemStack is = blk.getMachineRepresentation();
            if ( is != null && is.getItem() != null )
            {
              IAEItemStack ais = AEItemStack.create( is );
              ais.setStackSize( 1 );
              ais.setCountRequestable( (long) (blk.getIdlePowerUsage() * 100.0) );
              list.add( ais );
            }
          }

          for (IAEItemStack ais : list)
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.