Revert using internal API
This commit is contained in:
@@ -45,7 +45,6 @@ import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Api;
|
||||
import appeng.hooks.TickHandler;
|
||||
|
||||
|
||||
@@ -56,8 +55,8 @@ public class CraftingJob implements Runnable, ICraftingJob
|
||||
|
||||
private final MECraftingInventory original;
|
||||
private final World world;
|
||||
private final IItemList<IAEItemStack> crafting = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
private final IItemList<IAEItemStack> missing = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
private final IItemList<IAEItemStack> crafting = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
private final IItemList<IAEItemStack> missing = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
private final HashMap<String, TwoIntegers> opsAndMultiplier = new HashMap<>();
|
||||
private final Object monitor = new Object();
|
||||
private final Stopwatch watch = Stopwatch.createUnstarted();
|
||||
@@ -88,7 +87,7 @@ public class CraftingJob implements Runnable, ICraftingJob
|
||||
final ICraftingGrid cc = grid.getCache( ICraftingGrid.class );
|
||||
final IStorageGrid sg = grid.getCache( IStorageGrid.class );
|
||||
this.original = new MECraftingInventory( sg
|
||||
.getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) ), actionSrc, false, false, false );
|
||||
.getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ), actionSrc, false, false, false );
|
||||
|
||||
this.setTree( this.getCraftingTree( cc, what ) );
|
||||
this.availableCheck = null;
|
||||
|
||||
@@ -36,7 +36,6 @@ import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.core.Api;
|
||||
import appeng.me.cluster.implementations.CraftingCPUCluster;
|
||||
|
||||
|
||||
@@ -46,7 +45,7 @@ public class CraftingTreeNode
|
||||
// what slot!
|
||||
private final int slot;
|
||||
private final CraftingJob job;
|
||||
private final IItemList<IAEItemStack> used = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
private final IItemList<IAEItemStack> used = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
// parent node.
|
||||
private final CraftingTreeProcess parent;
|
||||
private final World world;
|
||||
|
||||
@@ -38,7 +38,6 @@ import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.container.ContainerNull;
|
||||
import appeng.core.Api;
|
||||
import appeng.me.cluster.implementations.CraftingCPUCluster;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -209,7 +208,7 @@ public class CraftingTreeProcess
|
||||
ItemStack is = ic.getStackInSlot( x );
|
||||
is = Platform.getContainerItem( is );
|
||||
|
||||
final IAEItemStack o = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createStack( is );
|
||||
final IAEItemStack o = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( is );
|
||||
if( o != null )
|
||||
{
|
||||
this.bytes++;
|
||||
@@ -228,7 +227,7 @@ public class CraftingTreeProcess
|
||||
if( this.containerItems )
|
||||
{
|
||||
final ItemStack is = Platform.getContainerItem( stack.createItemStack() );
|
||||
final IAEItemStack o = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createStack( is );
|
||||
final IAEItemStack o = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( is );
|
||||
if( o != null )
|
||||
{
|
||||
this.bytes++;
|
||||
|
||||
@@ -28,7 +28,6 @@ import appeng.api.storage.IStorageChannel;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.core.Api;
|
||||
import appeng.util.inv.ItemListIgnoreCrafting;
|
||||
|
||||
|
||||
@@ -51,7 +50,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
public MECraftingInventory()
|
||||
{
|
||||
this.localCache = new ItemListIgnoreCrafting<>( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList() );
|
||||
this.localCache = new ItemListIgnoreCrafting<>( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList() );
|
||||
this.extractedCache = null;
|
||||
this.injectedCache = null;
|
||||
this.missingCache = null;
|
||||
@@ -71,7 +70,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
if( this.logMissing )
|
||||
{
|
||||
this.missingCache = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
this.missingCache = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -80,7 +79,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
if( this.logExtracted )
|
||||
{
|
||||
this.extractedCache = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
this.extractedCache = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -89,7 +88,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
if( this.logInjections )
|
||||
{
|
||||
this.injectedCache = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
this.injectedCache = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -97,7 +96,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
}
|
||||
|
||||
this.localCache = this.target
|
||||
.getAvailableItems( new ItemListIgnoreCrafting<>( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList() ) );
|
||||
.getAvailableItems( new ItemListIgnoreCrafting<>( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList() ) );
|
||||
|
||||
this.par = parent;
|
||||
}
|
||||
@@ -111,7 +110,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
if( logMissing )
|
||||
{
|
||||
this.missingCache = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
this.missingCache = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -120,7 +119,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
if( logExtracted )
|
||||
{
|
||||
this.extractedCache = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
this.extractedCache = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -129,14 +128,14 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
if( logInjections )
|
||||
{
|
||||
this.injectedCache = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
this.injectedCache = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.injectedCache = null;
|
||||
}
|
||||
|
||||
this.localCache = new ItemListIgnoreCrafting<>( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList() );
|
||||
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 ) );
|
||||
@@ -154,7 +153,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
if( logMissing )
|
||||
{
|
||||
this.missingCache = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
this.missingCache = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -163,7 +162,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
if( logExtracted )
|
||||
{
|
||||
this.extractedCache = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
this.extractedCache = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -172,14 +171,14 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
if( logInjections )
|
||||
{
|
||||
this.injectedCache = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
this.injectedCache = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.injectedCache = null;
|
||||
}
|
||||
|
||||
this.localCache = target.getAvailableItems( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList() );
|
||||
this.localCache = target.getAvailableItems( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList() );
|
||||
this.par = null;
|
||||
}
|
||||
|
||||
@@ -260,7 +259,7 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
@Override
|
||||
public IStorageChannel getChannel()
|
||||
{
|
||||
return Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class );
|
||||
return AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class );
|
||||
}
|
||||
|
||||
public IItemList<IAEItemStack> getItemList()
|
||||
@@ -270,8 +269,8 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
public boolean commit( final IActionSource src )
|
||||
{
|
||||
final IItemList<IAEItemStack> added = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
final IItemList<IAEItemStack> pulled = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
final IItemList<IAEItemStack> added = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
final IItemList<IAEItemStack> pulled = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
boolean failed = false;
|
||||
|
||||
if( this.logInjections )
|
||||
|
||||
Reference in New Issue
Block a user