Fixes #2530: Use ItemListIgnoreCrafting to ignore craftable items.
Wraps the internal inventory into an ItemListIgnoreCrafting to hide craftable items from it. As the ItemLists will always create a copy of the actual stack before changing them, it will not affect any itemstack stored elsewhere.
This commit is contained in:
@@ -27,6 +27,7 @@ import appeng.api.storage.IMEMonitor;
|
|||||||
import appeng.api.storage.StorageChannel;
|
import appeng.api.storage.StorageChannel;
|
||||||
import appeng.api.storage.data.IAEItemStack;
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
import appeng.api.storage.data.IItemList;
|
import appeng.api.storage.data.IItemList;
|
||||||
|
import appeng.util.inv.ItemListIgnoreCrafting;
|
||||||
|
|
||||||
|
|
||||||
public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||||
@@ -48,7 +49,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
|||||||
|
|
||||||
public MECraftingInventory()
|
public MECraftingInventory()
|
||||||
{
|
{
|
||||||
this.localCache = AEApi.instance().storage().createItemList();
|
this.localCache = new ItemListIgnoreCrafting<>( AEApi.instance().storage().createItemList() );
|
||||||
this.extractedCache = null;
|
this.extractedCache = null;
|
||||||
this.injectedCache = null;
|
this.injectedCache = null;
|
||||||
this.missingCache = null;
|
this.missingCache = null;
|
||||||
@@ -93,7 +94,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
|||||||
this.injectedCache = null;
|
this.injectedCache = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.localCache = this.target.getAvailableItems( AEApi.instance().storage().createItemList() );
|
this.localCache = this.target.getAvailableItems( new ItemListIgnoreCrafting<>( AEApi.instance().storage().createItemList() ) );
|
||||||
|
|
||||||
this.par = parent;
|
this.par = parent;
|
||||||
}
|
}
|
||||||
@@ -132,7 +133,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
|||||||
this.injectedCache = null;
|
this.injectedCache = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.localCache = AEApi.instance().storage().createItemList();
|
this.localCache = new ItemListIgnoreCrafting<>( AEApi.instance().storage().createItemList() );
|
||||||
for( final IAEItemStack is : target.getStorageList() )
|
for( final IAEItemStack is : target.getStorageList() )
|
||||||
{
|
{
|
||||||
this.localCache.add( target.extractItems( is, Actionable.SIMULATE, src ) );
|
this.localCache.add( target.extractItems( is, Actionable.SIMULATE, src ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user