invalidate cached itemstack if its gonna be used in a real insertion

This commit is contained in:
PrototypeTrousers
2022-03-12 11:03:04 -03:00
parent 6d151bb890
commit cfa9fa2843
4 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ aebuild=7
aegroup=appeng aegroup=appeng
aebasename=appliedenergistics2 aebasename=appliedenergistics2
extended=extended_life extended=extended_life
extendedversion=v51c extendedversion=v51d
######################################################### #########################################################
# Versions # # Versions #
######################################################### #########################################################
@@ -305,6 +305,7 @@ public class CraftingTreeProcess
containerItems = new ArrayList<>(); containerItems = new ArrayList<>();
} }
this.bytes++; this.bytes++;
o.setCachedItemStack( is );
containerItems.add( o ); containerItems.add( o );
} }
} }
@@ -909,10 +909,6 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
changed = true; changed = true;
throw new GridAccessException(); throw new GridAccessException();
} }
else
{
itemStack.setCachedItemStack( inputStack );
}
IAEItemStack storedStack = this.gridProxy.getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ).getStorageList().findPrecise( itemStack ); IAEItemStack storedStack = this.gridProxy.getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ).getStorageList().findPrecise( itemStack );
if( storedStack != null ) if( storedStack != null )
@@ -930,8 +926,12 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
} }
else if( storedStack.isCraftable() ) else if( storedStack.isCraftable() )
{ {
changed = this.handleCrafting( x, adaptor, itemStack ) || changed; itemStack.setCachedItemStack(inputStack);
changed = this.handleCrafting( x, adaptor, itemStack ) || changed;
} }
if (acquired == null) {
itemStack.setCachedItemStack(inputStack);
}
} }
} }
// else wtf? // else wtf?
@@ -285,6 +285,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
if( this.cachedItemStack != null ) if( this.cachedItemStack != null )
{ {
currentCached = this.cachedItemStack; currentCached = this.cachedItemStack;
this.cachedItemStack = null;
} }
ItemStack itemStack; ItemStack itemStack;