@Override public Iterator<T> iterator() { return this.target.iterator(); }
public IMEAdaptorIterator( final IMEAdaptor parent, final IItemList<IAEItemStack> availableItems ) { this.stack = availableItems.iterator(); this.containerSize = parent.getMaxSlots(); this.parent = parent; }
public void partition() { IAEFluidTank h = this.storageBus.getConfig(); final IMEInventory<IAEFluidStack> cellInv = this.storageBus.getInternalHandler(); Iterator<IAEFluidStack> i = new NullIterator<>(); if( cellInv != null ) { final IItemList<IAEFluidStack> list = cellInv .getAvailableItems( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createList() ); i = list.iterator(); } for( int x = 0; x < h.getSlots(); x++ ) { if( i.hasNext() && this.isSlotEnabled( ( x / 9 ) - 2 ) ) { h.setFluidInSlot( x, i.next() ); } else { h.setFluidInSlot( x, null ); } } this.detectAndSendChanges(); }
public void partition() { final IItemHandler inv = this.getUpgradeable().getInventoryByName( "config" ); final IMEInventory<IAEItemStack> cellInv = this.storageBus.getInternalHandler(); Iterator<IAEItemStack> i = new NullIterator<>(); if( cellInv != null ) { final IItemList<IAEItemStack> list = cellInv .getAvailableItems( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList() ); i = list.iterator(); } for( int x = 0; x < inv.getSlots(); x++ ) { if( i.hasNext() && this.isSlotEnabled( ( x / 9 ) - 2 ) ) { // TODO: check if ok final ItemStack g = i.next().asItemStackRepresentation(); ItemHandlerUtil.setStackInSlot( inv, x, g ); } else { ItemHandlerUtil.setStackInSlot( inv, x, ItemStack.EMPTY ); } } this.detectAndSendChanges(); }
public void partition() { final IItemHandler inv = this.getUpgradeable().getInventoryByName( "config" ); final ItemStack is = this.getUpgradeable().getInventoryByName( "cell" ).getStackInSlot( 0 ); final IStorageChannel channel = is.getItem() instanceof IStorageCell ? ( (IStorageCell) is.getItem() ).getChannel() : AEApi.instance() .storage() .getStorageChannel( IItemStorageChannel.class ); final IMEInventory cellInv = AEApi.instance().registries().cell().getCellInventory( is, null, channel ); Iterator<IAEStack> i = new NullIterator<>(); if( cellInv != null ) { final IItemList list = cellInv.getAvailableItems( channel.createList() ); i = list.iterator(); } for( int x = 0; x < inv.getSlots(); x++ ) { if( i.hasNext() ) { // TODO: check if ok final ItemStack g = i.next().asItemStackRepresentation(); ItemHandlerUtil.setStackInSlot( inv, x, g ); } else { ItemHandlerUtil.setStackInSlot( inv, x, ItemStack.EMPTY ); } } this.detectAndSendChanges(); }