cache itemstack on export bus
This commit is contained in:
@@ -319,16 +319,16 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
|||||||
return this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0;
|
return this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pushItemIntoTarget( final InventoryAdaptor d, final IEnergyGrid energy, final IMEInventory<IAEItemStack> inv, IAEItemStack ais )
|
private void pushItemIntoTarget( final InventoryAdaptor d, final IEnergyGrid energy, final IMEInventory<IAEItemStack> inv, IAEItemStack org )
|
||||||
{
|
{
|
||||||
ItemStack inputStack = ais.getCachedItemStack( ais.getStackSize() );
|
ItemStack inputStack = org.getCachedItemStack( org.getStackSize() );
|
||||||
|
|
||||||
ItemStack remaining = d.simulateAdd( inputStack );
|
ItemStack remaining = d.simulateAdd( inputStack );
|
||||||
|
|
||||||
// Store the stack in the cache for next time.
|
// Store the stack in the cache for next time.
|
||||||
if( !remaining.isEmpty() )
|
if( !remaining.isEmpty() )
|
||||||
{
|
{
|
||||||
ais.setCachedItemStack( remaining );
|
org.setCachedItemStack( remaining );
|
||||||
if( remaining == inputStack )
|
if( remaining == inputStack )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -339,7 +339,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
|||||||
|
|
||||||
if( canFit > 0 )
|
if( canFit > 0 )
|
||||||
{
|
{
|
||||||
ais = ais.copy();
|
IAEItemStack ais = org.copy();
|
||||||
ais.setStackSize( canFit );
|
ais.setStackSize( canFit );
|
||||||
final IAEItemStack itemsToAdd = Platform.poweredExtraction( energy, inv, ais, this.mySrc );
|
final IAEItemStack itemsToAdd = Platform.poweredExtraction( energy, inv, ais, this.mySrc );
|
||||||
|
|
||||||
@@ -360,6 +360,10 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
|||||||
this.didSomething = true;
|
this.didSomething = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
org.setCachedItemStack( inputStack );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user