small optimization to crafting tree

This commit is contained in:
PrototypeTrousers
2022-02-27 23:04:29 -03:00
parent 50fd83e96b
commit 285fc6314c
6 changed files with 43 additions and 67 deletions
@@ -97,8 +97,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
this.injectedCache = null;
}
this.localCache = this.target
.getAvailableItems( new ItemListIgnoreCrafting<>( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList() ) );
this.localCache = this.target.getAvailableItems( new ItemListIgnoreCrafting<>( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList() ) );
this.par = parent;
}
@@ -140,7 +139,14 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
this.localCache = new ItemListIgnoreCrafting<>( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList() );
for( final IAEItemStack is : target.getStorageList() )
{
this.localCache.add( target.extractItems( is, Actionable.SIMULATE, src ) );
if( src.player().isPresent() )
{
this.localCache.add( target.extractItems( is, Actionable.SIMULATE, src ) );
}
else
{
this.localCache.add( is );
}
}
this.par = null;
@@ -321,7 +327,10 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
}
}
failed = true;
if( !src.player().isPresent() ) break;
if( !src.player().isPresent() )
{
break;
}
}
}
}