@Override public int size() { return this.target.size(); }
protected void saveChanges() { // recalculate values this.storedItems = (short) this.cellItems.size(); this.storedItemCount = 0; for( final T v : this.cellItems ) { this.storedItemCount += v.getStackSize(); } this.isPersisted = false; if( this.container != null ) { this.container.saveChanges( this ); } else { // if there is no ISaveProvider, store to NBT immediately this.persist(); } }
this.view.ensureCapacity( this.list.size() );
this.view.ensureCapacity( this.list.size() );
public void cancel() { if( this.myLastLink != null ) { this.myLastLink.cancel(); } final IItemList<IAEItemStack> list; this.getListOfItem( list = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList(), CraftingItemList.ALL ); for( final IAEItemStack is : list ) { this.postChange( is, this.machineSrc ); } this.isComplete = true; this.myLastLink = null; this.tasks.clear(); // final ImmutableSet<IAEItemStack> items = ImmutableSet.copyOf( this.waitingFor ); final List<IAEItemStack> items = new ArrayList<>( this.waitingFor.size() ); this.waitingFor.forEach( stack -> items.add( stack.copy().setStackSize( -stack.getStackSize() ) ) ); this.waitingFor.resetStatus(); for( final IAEItemStack is : items ) { this.postCraftingStatusChange( is ); } this.finalOutput = null; this.updateCPU(); this.storeItems(); // marks dirty }
this.storedItems = (short) this.cellItems.size(); if( this.cellItems.isEmpty() )
@BasicObjectMethod.Inject( value = IGrid.class, modId = AppEng.MOD_ID, doc = "function():table -- List all items which are stored in the network" ) public static Object[] listAvailableItems(IContext<IGrid> context, Object[] args) { IGrid grid = context.getTarget(); IStorageGrid storageGrid = grid.getCache(IStorageGrid.class); IItemStorageChannel channel = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class); IItemList<IAEItemStack> items = storageGrid.getInventory(channel).getStorageList(); int i = 0; Map<Integer, Map<Object, Object>> output = Maps.newHashMapWithExpectedSize(items.size()); for (IAEItemStack stack : items) output.put(++i, getBasicProperties(stack)); return new Object[]{output}; }
Map<Integer, Map<String, Object>> out = Maps.newHashMapWithExpectedSize(plan.size()); for (IAEItemStack needed : plan) { Map<String, Object> component = Maps.newHashMap();
public void updateView() { this.view.clear(); this.view.ensureCapacity(this.list.size());