@@ -179,25 +179,29 @@ public class PartConversionMonitor extends AbstractPartMonitor
|
|||||||
final IEnergySource energy = this.getProxy().getEnergy();
|
final IEnergySource energy = this.getProxy().getEnergy();
|
||||||
final IMEMonitor<IAEItemStack> cell = this.getProxy()
|
final IMEMonitor<IAEItemStack> cell = this.getProxy()
|
||||||
.getStorage()
|
.getStorage()
|
||||||
.getInventory(
|
.getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
|
||||||
AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
|
|
||||||
if( allItems )
|
if( allItems )
|
||||||
{
|
{
|
||||||
final IAEItemStack input = this.getDisplayed().copy();
|
if( this.getDisplayed() != null )
|
||||||
IItemHandler inv = new PlayerMainInvWrapper( player.inventory );
|
|
||||||
|
|
||||||
for( int x = 0; x < inv.getSlots(); x++ )
|
|
||||||
{
|
{
|
||||||
final ItemStack targetStack = inv.getStackInSlot( x );
|
final IAEItemStack input = this.getDisplayed().copy();
|
||||||
if( input.equals( targetStack ) )
|
IItemHandler inv = new PlayerMainInvWrapper( player.inventory );
|
||||||
|
|
||||||
|
for( int x = 0; x < inv.getSlots(); x++ )
|
||||||
{
|
{
|
||||||
final ItemStack canExtract = inv.extractItem( x, targetStack.getCount(), true );
|
final ItemStack targetStack = inv.getStackInSlot( x );
|
||||||
if( !canExtract.isEmpty() )
|
if( input.equals( targetStack ) )
|
||||||
{
|
{
|
||||||
input.setStackSize( canExtract.getCount() );
|
final ItemStack canExtract = inv.extractItem( x, targetStack.getCount(), true );
|
||||||
final IAEItemStack failedToInsert = Platform.poweredInsert( energy, cell, input, new PlayerSource( player, this ) );
|
if( !canExtract.isEmpty() )
|
||||||
inv.extractItem( x, failedToInsert == null ? canExtract.getCount() : canExtract.getCount() - (int) failedToInsert.getStackSize(),
|
{
|
||||||
false );
|
input.setStackSize( canExtract.getCount() );
|
||||||
|
final IAEItemStack failedToInsert = Platform.poweredInsert( energy, cell, input, new PlayerSource( player, this ) );
|
||||||
|
inv.extractItem( x,
|
||||||
|
failedToInsert == null ? canExtract.getCount() : canExtract.getCount() - (int) failedToInsert.getStackSize(),
|
||||||
|
false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user