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,6 +29,7 @@ import java.util.Map;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.capability.IFluidHandler;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.networking.security.IActionSource;
import appeng.api.networking.storage.IBaseMonitor;
@@ -39,7 +40,6 @@ import appeng.api.storage.IStorageChannel;
import appeng.api.storage.channels.IFluidStorageChannel;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IItemList;
import appeng.core.Api;
import appeng.fluids.util.AEFluidStack;
import appeng.me.GridAccessException;
import appeng.me.helpers.IGridProxyable;
@@ -150,7 +150,7 @@ public class FluidHandlerAdapter implements IMEInventory<IAEFluidStack>, IBaseMo
@Override
public IStorageChannel<IAEFluidStack> getChannel()
{
return Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
return AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
}
@Override
@@ -4,7 +4,6 @@ package appeng.fluids.parts;
import java.util.List;
import appeng.core.Api;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
@@ -306,7 +305,7 @@ public class PartFluidAnnihilationPlane extends PartBasicState implements IGridT
try
{
final IStorageGrid storage = this.getProxy().getStorage();
final IMEInventory<IAEFluidStack> inv = storage.getInventory( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) );
final IMEInventory<IAEFluidStack> inv = storage.getInventory( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) );
if( modulate )
{
@@ -45,7 +45,6 @@ import appeng.api.storage.channels.IFluidStorageChannel;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IItemList;
import appeng.api.util.AEPartLocation;
import appeng.core.Api;
import appeng.fluids.util.AEFluidInventory;
import appeng.fluids.util.IAEFluidInventory;
@@ -69,7 +68,7 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
return MODELS.getModels();
}
private final MEInventoryHandler<IAEFluidStack> myHandler = new MEInventoryHandler<>( this, Api.INSTANCE
private final MEInventoryHandler<IAEFluidStack> myHandler = new MEInventoryHandler<>( this, AEApi.instance()
.storage()
.getStorageChannel( IFluidStorageChannel.class ) );
private final AEFluidInventory config = new AEFluidInventory( this, 63 );
@@ -87,7 +86,7 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
this.myHandler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST );
this.myHandler.setPriority( this.getPriority() );
final IItemList<IAEFluidStack> priorityList = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createList();
final IItemList<IAEFluidStack> priorityList = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createList();
final int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
for( int x = 0; x < this.config.getSlots() && x < slotsToUse; x++ )
@@ -202,13 +201,13 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
@Override
public IStorageChannel<IAEFluidStack> getChannel()
{
return Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
return AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
}
@Override
public List<IMEInventoryHandler> getCellArray( final IStorageChannel channel )
{
if( this.getProxy().isActive() && channel == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) )
if( this.getProxy().isActive() && channel == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) )
{
final List<IMEInventoryHandler> handler = new ArrayList<>( 1 );
handler.add( this.myHandler );
@@ -231,7 +230,7 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
@Override
public ItemStack getItemStackRepresentation()
{
return Api.INSTANCE.definitions().parts().fluidFormationnPlane().maybeStack( 1 ).orElse( ItemStack.EMPTY );
return AEApi.instance().definitions().parts().fluidFormationnPlane().maybeStack( 1 ).orElse( ItemStack.EMPTY );
}
@Override
@@ -37,6 +37,7 @@ import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.api.config.Upgrades;
import appeng.api.networking.IGridNode;
import appeng.api.networking.events.MENetworkChannelsChanged;
@@ -53,7 +54,6 @@ import appeng.api.storage.IStorageMonitorable;
import appeng.api.storage.data.IAEStack;
import appeng.api.util.AECableType;
import appeng.api.util.IConfigManager;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.fluids.helper.DualityFluidInterface;
@@ -235,7 +235,7 @@ public class PartFluidInterface extends PartBasicState implements IGridTickable,
@Override
public ItemStack getItemStackRepresentation()
{
return Api.INSTANCE.definitions().parts().fluidIface().maybeStack( 1 ).orElse( ItemStack.EMPTY );
return AEApi.instance().definitions().parts().fluidIface().maybeStack( 1 ).orElse( ItemStack.EMPTY );
}
@Override
@@ -40,7 +40,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.fluids.util.AEFluidInventory;
@@ -116,7 +115,7 @@ public class PartFluidLevelEmitter extends PartUpgradeable implements IStackWatc
@Override
public void onStackChange( IItemList<?> o, IAEStack<?> fullStack, IAEStack<?> diffStack, IActionSource src, IStorageChannel<?> chan )
{
if( chan == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) && fullStack.equals( this.config.getFluidInSlot( 0 ) ) )
if( chan == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) && fullStack.equals( this.config.getFluidInSlot( 0 ) ) )
{
this.lastReportedValue = fullStack.getStackSize();
this.updateState();
@@ -183,7 +182,7 @@ public class PartFluidLevelEmitter extends PartUpgradeable implements IStackWatc
{
try
{
final IStorageChannel<IAEFluidStack> channel = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
final IStorageChannel<IAEFluidStack> channel = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
final IMEMonitor<IAEFluidStack> inventory = this.getProxy().getStorage().getInventory( channel );
this.updateReportingValue( inventory );
@@ -209,7 +208,7 @@ public class PartFluidLevelEmitter extends PartUpgradeable implements IStackWatc
private void configureWatchers()
{
final IFluidStorageChannel channel = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
final IFluidStorageChannel channel = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
if( this.stackWatcher != null )
{
@@ -41,6 +41,7 @@ import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;
import appeng.api.AEApi;
import appeng.api.config.AccessRestriction;
import appeng.api.config.FuzzyMode;
import appeng.api.config.IncludeExclude;
@@ -67,7 +68,6 @@ import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IItemList;
import appeng.api.util.AEPartLocation;
import appeng.capabilities.Capabilities;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.core.settings.TickRates;
@@ -129,7 +129,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
IStorageMonitorable inventory = accessor.getInventory( this.source );
if( inventory != null )
{
return inventory.getInventory( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) );
return inventory.getInventory( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) );
}
// So this could / can be a design decision. If the tile does support our custom capability,
@@ -172,7 +172,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
this.resetCacheLogic = 0;
final IMEInventory<IAEFluidStack> in = this.getInternalHandler();
IItemList<IAEFluidStack> before = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createList();
IItemList<IAEFluidStack> before = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createList();
if( in != null )
{
before = in.getAvailableItems( before );
@@ -188,7 +188,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
if( in != out )
{
IItemList<IAEFluidStack> after = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createList();
IItemList<IAEFluidStack> after = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createList();
if( out != null )
{
after = out.getAvailableItems( after );
@@ -270,7 +270,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
{
if( this.getProxy().isActive() )
{
this.getProxy().getStorage().postAlterationOfStoredItems( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ), change, this.source );
this.getProxy().getStorage().postAlterationOfStoredItems( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ), change, this.source );
}
}
catch( final GridAccessException e )
@@ -314,13 +314,13 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
{
this.checkInterfaceVsStorageBus( target, this.getSide().getOpposite() );
this.handler = new MEInventoryHandler<>( inv, Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) );
this.handler = new MEInventoryHandler<>( inv, AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) );
this.handler.setBaseAccess( (AccessRestriction) this.getConfigManager().getSetting( Settings.ACCESS ) );
this.handler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST );
this.handler.setPriority( this.getPriority() );
final IItemList<IAEFluidStack> priorityList = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createList();
final IItemList<IAEFluidStack> priorityList = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createList();
final int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
for( int x = 0; x < this.config.getSlots() && x < slotsToUse; x++ )
@@ -462,7 +462,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
@Override
public IStorageChannel getStorageChannel()
{
return Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
return AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
}
public IAEFluidTank getConfig()
@@ -491,7 +491,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
@Override
public ItemStack getItemStackRepresentation()
{
return Api.INSTANCE.definitions().parts().fluidStorageBus().maybeStack( 1 ).orElse( ItemStack.EMPTY );
return AEApi.instance().definitions().parts().fluidStorageBus().maybeStack( 1 ).orElse( ItemStack.EMPTY );
}
@Override
@@ -35,6 +35,7 @@ import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import appeng.api.AEApi;
import appeng.api.config.RedstoneMode;
import appeng.api.config.Upgrades;
import appeng.api.networking.ticking.IGridTickable;
@@ -42,7 +43,6 @@ import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.storage.channels.IFluidStorageChannel;
import appeng.api.util.AECableType;
import appeng.core.Api;
import appeng.fluids.util.AEFluidInventory;
import appeng.fluids.util.IAEFluidTank;
@@ -183,7 +183,7 @@ public abstract class PartSharedFluidBus extends PartUpgradeable implements IGri
protected IFluidStorageChannel getChannel()
{
return Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
return AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
}
@Override