revert iitemrepository cache changes
This commit is contained in:
@@ -93,7 +93,7 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
|
|||||||
}
|
}
|
||||||
else if( countPos < countPre )
|
else if( countPos < countPre )
|
||||||
{
|
{
|
||||||
injectedList.add( Pair.of( i, countPos - countPre ) );
|
injectedList.add( Pair.of( i, countPre - countPos ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,32 +68,14 @@ class ItemRepositoryAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<
|
|||||||
|
|
||||||
if( type == Actionable.MODULATE )
|
if( type == Actionable.MODULATE )
|
||||||
{
|
{
|
||||||
if( this.cache.cachedAeStacks.length == 0 ) this.cache.update();
|
try
|
||||||
boolean found = false;
|
|
||||||
for( IAEItemStack iaeItemStack : this.cache.cachedAeStacks )
|
|
||||||
{
|
{
|
||||||
if( iaeItemStack == null )
|
this.proxyable.getProxy().getTick().alertDevice( this.proxyable.getProxy().getNode() );
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if( iaeItemStack.equals( iox ) )
|
|
||||||
{
|
|
||||||
found = true;
|
|
||||||
iaeItemStack.incStackSize( iox.getStackSize() );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if( !found )
|
catch( GridAccessException ex )
|
||||||
{
|
{
|
||||||
this.cache.cachedAeStacks = Arrays.copyOf( this.cache.cachedAeStacks, this.cache.cachedAeStacks.length + 1 );
|
// meh
|
||||||
IAEItemStack inserted = iox.copy();
|
|
||||||
if (remaining.isEmpty())
|
|
||||||
{
|
|
||||||
this.cache.cachedAeStacks[this.cache.cachedAeStacks.length - 1] = inserted;
|
|
||||||
} else {
|
|
||||||
this.cache.cachedAeStacks[this.cache.cachedAeStacks.length - 1] = inserted.setStackSize( iox.getStackSize() - remaining.getCount() );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return AEItemStack.fromItemStack( remaining );
|
return AEItemStack.fromItemStack( remaining );
|
||||||
@@ -108,8 +90,7 @@ class ItemRepositoryAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<
|
|||||||
|
|
||||||
final boolean simulate = ( mode == Actionable.SIMULATE );
|
final boolean simulate = ( mode == Actionable.SIMULATE );
|
||||||
|
|
||||||
ItemStack extracted;
|
ItemStack extracted = this.itemRepository.extractItem( requestedItemStack, remainingSize, simulate );
|
||||||
extracted = this.itemRepository.extractItem( requestedItemStack, remainingSize, simulate );
|
|
||||||
|
|
||||||
if( extracted.getCount() > remainingSize )
|
if( extracted.getCount() > remainingSize )
|
||||||
{
|
{
|
||||||
@@ -122,33 +103,19 @@ class ItemRepositoryAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<
|
|||||||
|
|
||||||
if( !extracted.isEmpty() )
|
if( !extracted.isEmpty() )
|
||||||
{
|
{
|
||||||
if (this.cache.cachedAeStacks.length == 0) this.cache.update();
|
|
||||||
IAEItemStack iaeExtracted = AEItemStack.fromItemStack( extracted );
|
|
||||||
|
|
||||||
if( mode == Actionable.MODULATE )
|
if( mode == Actionable.MODULATE )
|
||||||
{
|
{
|
||||||
for ( int i = 0; i < this.cache.cachedAeStacks.length; i++ )
|
try
|
||||||
{
|
{
|
||||||
IAEItemStack iaeItemStack = this.cache.cachedAeStacks[i];
|
this.proxyable.getProxy().getTick().alertDevice( this.proxyable.getProxy().getNode() );
|
||||||
if( iaeExtracted.isSameType( iaeItemStack ) )
|
}
|
||||||
{
|
catch( GridAccessException ex )
|
||||||
if( iaeExtracted.getStackSize() >= iaeItemStack.getStackSize() )
|
{
|
||||||
{
|
// meh
|
||||||
iaeExtracted.decStackSize( iaeItemStack.getStackSize() );
|
|
||||||
this.cache.cachedAeStacks[i] = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
iaeItemStack.decStackSize( iaeExtracted.getStackSize() );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return AEItemStack.fromItemStack( extracted );
|
return AEItemStack.fromItemStack( extracted );
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user