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
@@ -39,6 +39,7 @@ import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier;
import appeng.api.networking.IGridNode;
@@ -59,7 +60,6 @@ import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.util.AECableType;
import appeng.api.util.AEPartLocation;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.core.settings.TickRates;
import appeng.core.sync.packets.PacketTransitionEffect;
@@ -337,7 +337,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
{
final IStorageGrid storage = this.getProxy().getStorage();
final IEnergyGrid energy = this.getProxy().getEnergy();
final IAEItemStack overflow = Platform.poweredInsert( energy, storage.getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) ), itemToStore, this.mySrc );
final IAEItemStack overflow = Platform.poweredInsert( energy, storage.getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ), itemToStore, this.mySrc );
this.isAccepting = overflow == null;
@@ -541,7 +541,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
for( final ItemStack itemStack : itemStacks )
{
final IAEItemStack itemToTest = AEItemStack.fromItemStack( itemStack );
final IAEItemStack overflow = storage.getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) ).injectItems( itemToTest, Actionable.SIMULATE, this.mySrc );
final IAEItemStack overflow = storage.getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ).injectItems( itemToTest, Actionable.SIMULATE, this.mySrc );
if( overflow == null || itemToTest.getStackSize() > overflow.getStackSize() )
{
canStore = true;
@@ -58,7 +58,6 @@ import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.util.AECableType;
import appeng.core.AELog;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.core.settings.TickRates;
@@ -138,7 +137,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
final IMEMonitor<IAEItemStack> inv = this.getProxy()
.getStorage()
.getInventory(
Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) );
AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
final IEnergyGrid energy = this.getProxy().getEnergy();
final ICraftingGrid cg = this.getProxy().getCrafting();
final FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE );
@@ -46,6 +46,7 @@ import net.minecraft.world.server.ServerWorld;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable;
import appeng.api.config.FuzzyMode;
@@ -67,7 +68,6 @@ import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.api.util.AEPartLocation;
import appeng.core.AEConfig;
import appeng.core.Api;
import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
@@ -92,7 +92,7 @@ public class PartFormationPlane extends PartAbstractFormationPlane<IAEItemStack>
return MODELS.getModels();
}
private final MEInventoryHandler<IAEItemStack> myHandler = new MEInventoryHandler<>( this, Api.INSTANCE
private final MEInventoryHandler<IAEItemStack> myHandler = new MEInventoryHandler<>( this, AEApi.instance()
.storage()
.getStorageChannel( IItemStorageChannel.class ) );
private final AppEngInternalAEInventory Config = new AppEngInternalAEInventory( this, 63 );
@@ -113,7 +113,7 @@ public class PartFormationPlane extends PartAbstractFormationPlane<IAEItemStack>
this.myHandler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST );
this.myHandler.setPriority( this.getPriority() );
final IItemList<IAEItemStack> priorityList = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
final IItemList<IAEItemStack> priorityList = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
final int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
for( int x = 0; x < this.Config.getSlots() && x < slotsToUse; x++ )
@@ -208,7 +208,7 @@ public class PartFormationPlane extends PartAbstractFormationPlane<IAEItemStack>
@Override
public List<IMEInventoryHandler> getCellArray( final IStorageChannel channel )
{
if( this.getProxy().isActive() && channel == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) )
if( this.getProxy().isActive() && channel == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) )
{
final List<IMEInventoryHandler> handler = new ArrayList<>( 1 );
handler.add( this.myHandler );
@@ -368,7 +368,7 @@ public class PartFormationPlane extends PartAbstractFormationPlane<IAEItemStack>
@Override
public IStorageChannel<IAEItemStack> getChannel()
{
return Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class );
return AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class );
}
@Override
@@ -380,7 +380,7 @@ public class PartFormationPlane extends PartAbstractFormationPlane<IAEItemStack>
@Override
public ItemStack getItemStackRepresentation()
{
return Api.INSTANCE.definitions().parts().formationPlane().maybeStack( 1 ).orElse( ItemStack.EMPTY );
return AEApi.instance().definitions().parts().formationPlane().maybeStack( 1 ).orElse( ItemStack.EMPTY );
}
@Override
@@ -30,6 +30,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.Vec3d;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.config.FuzzyMode;
import appeng.api.config.RedstoneMode;
@@ -47,7 +48,6 @@ import appeng.api.storage.IMEMonitor;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.util.AECableType;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.core.settings.TickRates;
import appeng.helpers.Reflected;
@@ -99,9 +99,9 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
final IMEMonitor<IAEItemStack> inv = this.getProxy()
.getStorage()
.getInventory(
Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) );
AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
final IAEItemStack out = inv.injectItems( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createStack( stack ),
final IAEItemStack out = inv.injectItems( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( stack ),
Actionable.SIMULATE,
this.source );
if( out == null )
@@ -174,7 +174,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
final IMEMonitor<IAEItemStack> inv = this.getProxy()
.getStorage()
.getInventory(
Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) );
AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
final IEnergyGrid energy = this.getProxy().getEnergy();
boolean Configured = false;
@@ -234,7 +234,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
if( !newItems.isEmpty() )
{
final IAEItemStack aeStack = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createStack( newItems );
final IAEItemStack aeStack = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( newItems );
final IAEItemStack failed = Platform.poweredInsert( energy, inv, aeStack, this.source );
if( failed != null )
@@ -38,6 +38,7 @@ import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.api.config.FuzzyMode;
import appeng.api.config.LevelType;
import appeng.api.config.RedstoneMode;
@@ -73,7 +74,6 @@ import appeng.api.storage.data.IItemList;
import appeng.api.util.AECableType;
import appeng.api.util.AEPartLocation;
import appeng.api.util.IConfigManager;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.helpers.Reflected;
@@ -279,7 +279,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
this.updateState();
// no more item stuff..
this.getProxy().getStorage().getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) ).removeListener( this );
this.getProxy().getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ).removeListener( this );
}
catch( final GridAccessException e )
{
@@ -293,11 +293,11 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
{
if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 || myStack == null )
{
this.getProxy().getStorage().getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) ).addListener( this, this.getProxy().getGrid() );
this.getProxy().getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ).addListener( this, this.getProxy().getGrid() );
}
else
{
this.getProxy().getStorage().getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) ).removeListener( this );
this.getProxy().getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ).removeListener( this );
if( this.myWatcher != null )
{
@@ -305,7 +305,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
}
}
this.updateReportingValue( this.getProxy().getStorage().getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) ) );
this.updateReportingValue( this.getProxy().getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ) );
}
catch( final GridAccessException e )
{
@@ -361,7 +361,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
@Override
public void onStackChange( final IItemList o, final IAEStack fullStack, final IAEStack diffStack, final IActionSource src, final IStorageChannel chan )
{
if( chan == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) && fullStack.equals( this.config.getAEStackInSlot( 0 ) ) && this.getInstalledUpgrades( Upgrades.FUZZY ) == 0 )
if( chan == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) && fullStack.equals( this.config.getAEStackInSlot( 0 ) ) && this.getInstalledUpgrades( Upgrades.FUZZY ) == 0 )
{
this.lastReportedValue = fullStack.getStackSize();
this.updateState();
@@ -406,7 +406,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
{
try
{
this.updateReportingValue( this.getProxy().getStorage().getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) ) );
this.updateReportingValue( this.getProxy().getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ) );
}
catch( final GridAccessException e )
{