@Override public void setEmitable( final IAEItemStack someItem ) { this.emitableItems.add( someItem.copy() ); }
private IAEItemStack findVisualStack( final IAEItemStack l ) { for( final IAEItemStack o : this.visual ) { if( o.equals( l ) ) { return o; } } final IAEItemStack stack = l.copy(); this.visual.add( stack ); return stack; }
private IAEItemStack findVisualStack( final IAEItemStack l ) { for( final IAEItemStack o : this.visual ) { if( o.equals( l ) ) { return o; } } final IAEItemStack stack = l.copy(); this.visual.add( stack ); return stack; }
@Override public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final IActionSource src ) { final IAEItemStack local = this.itemListCache.findPrecise( request ); if( local == null ) { return null; } return request.copy(); }
IAEItemStack getStack( final long size ) { final IAEItemStack is = this.what.copy(); is.setStackSize( size ); return is; }
void addMissing( IAEItemStack what ) { what = what.copy(); this.missing.add( what ); }
public CraftingCalculationFailure( final IAEItemStack what, final long howMany ) { super( "this should have been caught!" ); this.missing = what.copy(); this.missing.setStackSize( howMany ); } }
@Override public void postChange( final IBaseMonitor<IAEItemStack> monitor, final Iterable<IAEItemStack> change, final IActionSource actionSource ) { for( IAEItemStack is : change ) { is = is.copy(); is.setStackSize( 1 ); this.list.add( is ); } }
private void handleStackSizeChanged( int slot, IAEItemStack oldAeIS, ItemStack newIS, List<IAEItemStack> changes ) { // Still the same item, but amount might have changed final long diff = newIS.getCount() - oldAeIS.getStackSize(); if( diff != 0 ) { final IAEItemStack stack = oldAeIS.copy(); stack.setStackSize( newIS.getCount() ); this.cachedAeStacks[slot] = stack; final IAEItemStack a = stack.copy(); a.setStackSize( diff ); changes.add( a ); } }
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 add( final IAEItemStack option ) { if( option == null ) { return; } final IAEItemStack st = this.records.get( ( (AEItemStack) option ).getSharedStack() ); if( st != null ) { st.add( option ); return; } final IAEItemStack opt = option.copy(); this.putItemRecord( opt ); }
public CraftBranchFailure( final IAEItemStack what, final long howMany ) { super( "Failed: " + what.getItem().getUnlocalizedName() + " x " + howMany ); 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 ); } }
@Override public void addStorage( final IAEItemStack option ) { if( option == null ) { return; } final IAEItemStack st = this.records.get( ( (AEItemStack) option ).getSharedStack() ); if( st != null ) { st.incStackSize( option.getStackSize() ); return; } final IAEItemStack opt = option.copy(); 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 ); } } }
@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 ); }
private void completeJob() { if( this.myLastLink != null ) { ( (CraftingLink) this.myLastLink ).markDone(); } if( AELog.isCraftingLogEnabled() ) { final IAEItemStack logStack = this.finalOutput.copy(); logStack.setStackSize( this.startItemCount ); AELog.crafting( LOG_MARK_AS_COMPLETE, logStack ); } this.remainingItemCount = 0; this.startItemCount = 0; this.lastTime = 0; this.elapsedTime = 0; this.isComplete = true; }
public void setTargetStack( final IAEItemStack stack ) { // client doesn't need to re-send, makes for lower overhead rapid packets. if( Platform.isClient() ) { if( stack == null && this.clientRequestedTargetItem == null ) { return; } if( stack != null && stack.isSameType( this.clientRequestedTargetItem ) ) { return; } NetworkHandler.instance().sendToServer( new PacketTargetItemStack( (AEItemStack) stack ) ); } this.clientRequestedTargetItem = stack == null ? null : stack.copy(); }
@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 ); }
public CraftingJob( final World w, final IGrid grid, final IActionSource actionSrc, final IAEItemStack what, final ICraftingCallback callback ) { this.world = this.wrapWorld( w ); this.output = what.copy(); this.actionSrc = actionSrc; this.callback = callback; final ICraftingGrid cc = grid.getCache( ICraftingGrid.class ); final IStorageGrid sg = grid.getCache( IStorageGrid.class ); this.original = new MECraftingInventory( sg .getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ), actionSrc, false, false, false ); this.setTree( this.getCraftingTree( cc, what ) ); this.availableCheck = null; }