if( list == null || list.getStackSize() == 0 ) if( list.getStackSize() >= request.getStackSize() ) list.decStackSize( request.getStackSize() ); if( this.logExtracted ) final IAEItemStack ret = request.copy(); ret.setStackSize( list.getStackSize() ); list.reset(); if( this.logExtracted )
@Override public ItemStack getStackInSlot( final int var1 ) { if( this.inv[var1] == null ) { return ItemStack.EMPTY; } return this.inv[var1].createItemStack(); }
@Override public IAEItemStack extractItems( final IAEItemStack request, final Actionable type, final IActionSource src ) { ItemStack out = ItemStack.EMPTY; if( type == Actionable.SIMULATE ) { out = this.adaptor.simulateRemove( (int) request.getStackSize(), request.getDefinition(), null ); } else { out = this.adaptor.removeItems( (int) request.getStackSize(), request.getDefinition(), null ); } if( out.isEmpty() ) { return null; } // better then doing construction from scratch :3 final IAEItemStack o = request.copy(); o.setStackSize( out.getCount() ); if( type == Actionable.MODULATE ) { this.onTick(); } return o; }
public CraftingCalculationFailure( final IAEItemStack what, final long howMany ) { super( "this should have been caught!" ); this.missing = what.copy(); this.missing.setStackSize( howMany ); } }
void addTask( IAEItemStack what, final long crafts, final ICraftingPatternDetails details, final int depth ) { if( crafts > 0 ) { what = what.copy(); what.setStackSize( what.getStackSize() * crafts ); this.crafting.add( what ); } }
public CraftBranchFailure( final IAEItemStack what, final long howMany ) { super( "Failed: " + what.getItem().getUnlocalizedName() + " x " + howMany ); this.missing = what.copy(); this.missing.setStackSize( howMany ); } }
if( req instanceof IAEItemStack ) shots = Math.min( shots, (int) req.getStackSize() ); for( int sh = 0; sh < shots; sh++ ) IAEItemStack aeAmmo = req.copy(); this.extractAEPower( p.getHeldItem( hand ), 1600, Actionable.MODULATE ); aeAmmo.setStackSize( 1 ); final ItemStack ammo = aeAmmo.createItemStack(); if( ammo == null ) if( penetration <= 0 ) final ItemStack type = aeAmmo.asItemStackRepresentation(); if( type.getItem() instanceof ItemPaintBall )
if( viewMode == ViewItems.CRAFTABLE && !is.isCraftable() ) if( viewMode == ViewItems.STORED && is.getStackSize() == 0 ) is = is.copy(); is.setStackSize( 0 );
@Override public void addRequestable( final IAEItemStack option ) { if( option == null ) { return; } final IAEItemStack st = this.records.get( ( (AEItemStack) option ).getSharedStack() ); if( st != null ) { st.setCountRequestable( st.getCountRequestable() + option.getCountRequestable() ); return; } final IAEItemStack opt = option.copy(); opt.setStackSize( 0 ); opt.setCraftable( false ); opt.setCountRequestable( option.getCountRequestable() ); this.putItemRecord( opt ); }
fontRenderer.setUnicodeFlag( false ); if( aeStack.getStackSize() == 0 && aeStack.isCraftable() ) if( aeStack.getStackSize() > 0 ) final String stackSize = this.getToBeRenderedStackSize( aeStack.getStackSize() );
@Nullable @Override public ItemStack convert(@Nonnull IAEItemStack from) { return from.getStackSize() == 0 ? from.getDefinition() : from.createItemStack(); } }
private void updateReportingValue( final IMEMonitor<IAEItemStack> itemInventory ) { if( this.configuredItem != null ) { final IAEItemStack result = itemInventory.getStorageList().findPrecise( this.configuredItem ); if( result == null ) { this.configuredItem.setStackSize( 0 ); } else { this.configuredItem.setStackSize( result.getStackSize() ); } } }
@Override public void addCrafting( final IAEItemStack option ) { if( option == null ) { return; } final IAEItemStack st = this.records.get( ( (AEItemStack) option ).getSharedStack() ); if( st != null ) { st.setCraftable( true ); return; } final IAEItemStack opt = option.copy(); opt.setStackSize( 0 ); opt.setCraftable( true ); this.putItemRecord( opt ); }
void getPlan( final IItemList<IAEItemStack> plan ) { for( IAEItemStack i : this.details.getOutputs() ) { i = i.copy(); i.setCountRequestable( i.getStackSize() * this.crafts ); plan.addRequestable( i ); } for( final CraftingTreeNode pro : this.nodes.keySet() ) { pro.getPlan( plan ); } } }
@Nonnull public static HashMap<Object, Object> getBasicProperties(@Nonnull IAEItemStack stack) { HashMap<Object, Object> data = Maps.newHashMap(); data.putAll(MetaItemBasic.getBasicMeta(stack.getDefinition())); data.put("count", stack.getStackSize()); data.put("isCraftable", stack.isCraftable()); return data; } }
public boolean canAccept( final IAEItemStack input ) { if( input instanceof IAEItemStack ) { final IAEItemStack is = this.waitingFor.findPrecise( input ); if( is != null && is.getStackSize() > 0 ) { return true; } } return false; }
public void setJob( final IAEItemStack is ) { if( ( is == null ) != ( this.dspPlay == null ) ) { this.dspPlay = is == null ? null : is.copy(); this.markForUpdate(); } else if( is != null && this.dspPlay != null ) { if( is.getStackSize() != this.dspPlay.getStackSize() ) { this.dspPlay = is.copy(); this.markForUpdate(); } } }
@Override public void setEmitable( final IAEItemStack someItem ) { this.emitableItems.add( someItem.copy() ); }
@Override public void add( final IAEItemStack option ) { if( option == null ) { return; } this.incStackSize( option.getStackSize() ); this.setCountRequestable( this.getCountRequestable() + option.getCountRequestable() ); this.setCraftable( this.isCraftable() || option.isCraftable() ); }
private int calculateMaximumAmountToImport( final InventoryAdaptor myAdaptor, final IAEItemStack whatToImport, final IMEMonitor<IAEItemStack> inv, final FuzzyMode fzMode ) { final int toSend = Math.min( this.itemsToSend, 64 ); final ItemStack itemStackToImport; if( whatToImport == null ) { itemStackToImport = ItemStack.EMPTY; } else { itemStackToImport = whatToImport.getDefinition(); } final IAEItemStack itemAmountNotStorable; final ItemStack simResult; if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) { simResult = myAdaptor.simulateSimilarRemove( toSend, itemStackToImport, fzMode, this ); itemAmountNotStorable = inv.injectItems( AEItemStack.fromItemStack( simResult ), Actionable.SIMULATE, this.source ); } else { simResult = myAdaptor.simulateRemove( toSend, itemStackToImport, this ); itemAmountNotStorable = inv.injectItems( AEItemStack.fromItemStack( simResult ), Actionable.SIMULATE, this.source ); } if( itemAmountNotStorable != null ) { return (int) Math.min( simResult.getCount() - itemAmountNotStorable.getStackSize(), toSend ); } return toSend; }