Merge remote-tracking branch 'origin/AE2-Omnifactory' into AE2-Omnifactory

This commit is contained in:
PrototypeTrousers
2022-03-12 17:15:11 -03:00
+10 -22
View File
@@ -279,31 +279,19 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
} }
@Override @Override
public ItemStack getCachedItemStack( long stackSize ) public ItemStack getCachedItemStack( long stackSize ) {
{ if (this.cachedItemStack != null) {
ItemStack currentCached = null; ItemStack currentCached = this.cachedItemStack;
if( this.cachedItemStack != null )
{
currentCached = this.cachedItemStack;
this.cachedItemStack = null; this.cachedItemStack = null;
} currentCached.setCount(Ints.saturatedCast(stackSize));
return currentCached;
}
ItemStack itemStack; ItemStack itemStack = this.createItemStack();
itemStack.setCount(Ints.saturatedCast(stackSize));
if( currentCached != null ) return itemStack;
{ }
// Cache is suitable, just update the count
itemStack = currentCached;
currentCached.setCount( Ints.saturatedCast( stackSize ) );
}
else
{
// We need a new stack :-(
itemStack = this.createItemStack();
itemStack.setCount( Ints.saturatedCast( stackSize ) );
}
return itemStack;
}
@Override @Override
public void setCachedItemStack( ItemStack itemStack ) public void setCachedItemStack( ItemStack itemStack )