cache more itemstacks

This commit is contained in:
PrototypeTrousers
2022-02-19 23:02:40 -03:00
parent a2bda8f449
commit 66bc243b41
2 changed files with 61 additions and 38 deletions
@@ -893,12 +893,21 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
else if( itemStack.getStackSize() > 0 )
{
// make sure strange things didn't happen...
ItemStack inputStack = itemStack.createItemStack();
if( !adaptor.simulateAdd( inputStack ).isEmpty() )
ItemStack inputStack = itemStack.getCachedItemStack( itemStack.getStackSize() );
ItemStack remaining = adaptor.simulateAdd( inputStack );
if( !remaining.isEmpty() )
{
itemStack.setCachedItemStack( remaining );
changed = true;
throw new GridAccessException();
}
else
{
itemStack.setCachedItemStack( inputStack );
}
IAEItemStack storedStack = this.gridProxy.getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ).getStorageList().findPrecise( itemStack );
if( storedStack != null )