Revert using internal API

This commit is contained in:
yueh
2020-06-07 17:21:20 +02:00
parent 7715f605eb
commit 23b6e195ac
148 changed files with 472 additions and 498 deletions
@@ -29,7 +29,6 @@ import java.util.Optional;
import javax.annotation.Nullable;
import appeng.core.Api;
import com.google.common.collect.ImmutableSet;
import net.minecraft.block.Block;
@@ -134,10 +133,10 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
private final AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, NUMBER_OF_CONFIG_SLOTS );
private final AppEngInternalInventory storage = new AppEngInternalInventory( this, NUMBER_OF_STORAGE_SLOTS );
private final AppEngInternalInventory patterns = new AppEngInternalInventory( this, NUMBER_OF_PATTERN_SLOTS );
private final MEMonitorPassThrough<IAEItemStack> items = new MEMonitorPassThrough<>( new NullInventory<IAEItemStack>(), Api.INSTANCE
private final MEMonitorPassThrough<IAEItemStack> items = new MEMonitorPassThrough<>( new NullInventory<IAEItemStack>(), AEApi.instance()
.storage()
.getStorageChannel( IItemStorageChannel.class ) );
private final MEMonitorPassThrough<IAEFluidStack> fluids = new MEMonitorPassThrough<>( new NullInventory<IAEFluidStack>(), Api.INSTANCE
private final MEMonitorPassThrough<IAEFluidStack> fluids = new MEMonitorPassThrough<>( new NullInventory<IAEFluidStack>(), AEApi.instance()
.storage()
.getStorageChannel( IFluidStorageChannel.class ) );
private final UpgradeInventory upgrades;
@@ -425,7 +424,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
if( req == null && !stored.isEmpty() )
{
final IAEItemStack work = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createStack( stored );
final IAEItemStack work = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( stored );
this.requireWork[slot] = work.setStackSize( -work.getStackSize() );
return;
}
@@ -448,7 +447,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
else
// Stored != null; dispose!
{
final IAEItemStack work = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createStack( stored );
final IAEItemStack work = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( stored );
this.requireWork[slot] = work.setStackSize( -work.getStackSize() );
return;
}
@@ -513,7 +512,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
@Override
public boolean canInsert( final ItemStack stack )
{
final IAEItemStack out = this.destination.injectItems( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createStack( stack ),
final IAEItemStack out = this.destination.injectItems( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( stack ),
Actionable.SIMULATE, null );
if( out == null )
{
@@ -540,8 +539,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
{
try
{
this.items.setInternal( this.gridProxy.getStorage().getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) ) );
this.fluids.setInternal( this.gridProxy.getStorage().getInventory( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) ) );
this.items.setInternal( this.gridProxy.getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ) );
this.fluids.setInternal( this.gridProxy.getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) ) );
}
catch( final GridAccessException gae )
{
@@ -669,7 +668,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
boolean changed = false;
try
{
this.destination = this.gridProxy.getStorage().getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) );
this.destination = this.gridProxy.getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
final IEnergySource src = this.gridProxy.getEnergy();
if( this.craftingTracker.isBusy( x ) )
@@ -796,7 +795,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
@Override
public <T extends IAEStack<T>> IMEMonitor<T> getInventory( IStorageChannel<T> channel )
{
if( channel == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) )
if( channel == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) )
{
if( this.hasConfig() )
{
@@ -805,7 +804,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
return (IMEMonitor<T>) this.items;
}
else if( channel == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) )
else if( channel == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) )
{
if( this.hasConfig() )
{
@@ -890,7 +889,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
@Override
public <T extends IAEStack<T>> IMEMonitor<T> getInventory( IStorageChannel<T> channel )
{
if( channel == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) )
if( channel == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) )
{
return (IMEMonitor<T>) new InterfaceInventory( di );
}
@@ -22,7 +22,6 @@ package appeng.helpers;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import appeng.core.Api;
import com.google.common.collect.ImmutableSet;
import net.minecraft.nbt.CompoundNBT;
@@ -62,7 +61,7 @@ public class MultiCraftingTracker
if( link != null && !link.isEmpty() )
{
this.setLink( x, Api.INSTANCE.storage().loadCraftingLink( link, this.owner ) );
this.setLink( x, AEApi.instance().storage().loadCraftingLink( link, this.owner ) );
}
}
}
@@ -27,7 +27,6 @@ import java.util.Map;
import java.util.Set;
import java.util.StringJoiner;
import appeng.core.Api;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -43,6 +42,7 @@ import appeng.api.storage.data.IAEItemStack;
import appeng.container.ContainerNull;
import appeng.core.AEConfig;
import appeng.core.AELog;
import appeng.api.AEApi;
import appeng.api.features.AEFeature;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
@@ -104,7 +104,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
this.markItemAs( x, gs, TestStatus.ACCEPT );
}
in.add( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createStack( gs ) );
in.add( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( gs ) );
this.testFrame.setInventorySlotContents( x, gs );
}
@@ -115,7 +115,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
if( this.standardRecipe != null )
{
this.correctOutput = this.standardRecipe.getCraftingResult( this.crafting );
out.add( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createStack( this.correctOutput ) );
out.add( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( this.correctOutput ) );
}
else
{
@@ -139,7 +139,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
if( !gs.isEmpty() )
{
out.add( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createStack( gs ) );
out.add( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( gs ) );
}
}
}
@@ -19,7 +19,6 @@
package appeng.helpers;
import appeng.core.Api;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@@ -79,7 +78,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II
try
{
final long encKey = Long.parseLong( this.encryptionKey );
obj = Api.INSTANCE.registries().locatable().getLocatableBy( encKey );
obj = AEApi.instance().registries().locatable().getLocatableBy( encKey );
}
catch( final NumberFormatException err )
{
@@ -97,7 +96,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II
this.sg = this.targetGrid.getCache( IStorageGrid.class );
if( this.sg != null )
{
this.itemStorage = this.sg.getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) );
this.itemStorage = this.sg.getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
}
}
}
@@ -236,7 +235,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II
{
return this.itemStorage.getChannel();
}
return Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class );
return AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class );
}
@Override