First iteration of making integrations typesafe

This commit is contained in:
yueh
2015-08-06 16:01:56 +02:00
committed by thatsIch
parent cdcba63c2d
commit 0d25b76b77
45 changed files with 446 additions and 170 deletions
@@ -21,9 +21,11 @@ package appeng.integration.modules;
import net.mcft.copy.betterstorage.api.crate.ICrateStorage;
import appeng.api.AEApi;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.api.util.ForgeDirection;
import appeng.integration.IIntegrationModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IBetterStorage;
import appeng.integration.modules.helpers.BSCrateHandler;
import appeng.integration.modules.helpers.BSCrateStorageAdaptor;
@@ -32,12 +34,13 @@ import appeng.util.InventoryAdaptor;
public class BetterStorage extends BaseModule implements IIntegrationModule, IBetterStorage
{
@Reflected
public static BetterStorage instance;
@Reflected
public BetterStorage()
{
this.testClassExistence( net.mcft.copy.betterstorage.api.crate.ICrateStorage.class );
IntegrationHelper.testClassExistence( this, net.mcft.copy.betterstorage.api.crate.ICrateStorage.class );
}
@Override
@@ -59,7 +62,6 @@ public class BetterStorage extends BaseModule implements IIntegrationModule, IBe
@Override
public void init()
{
}
@Override
@@ -28,10 +28,7 @@ import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import buildcraft.api.blueprints.BuilderAPI;
import buildcraft.api.blueprints.IBuilderContext;
import buildcraft.api.blueprints.ISchematicRegistry;
import buildcraft.api.blueprints.SchematicBlock;
import buildcraft.api.blueprints.SchematicTile;
import appeng.api.AEApi;
import appeng.api.definitions.IBlockDefinition;
@@ -41,6 +38,7 @@ import appeng.api.util.IOrientableBlock;
import appeng.core.AELog;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.modules.BCHelpers.AECableSchematicTile;
import appeng.integration.modules.BCHelpers.AEGenericSchematicTile;
import appeng.integration.modules.BCHelpers.AERotatableBlockSchematic;
@@ -62,11 +60,11 @@ public class BuildCraftBuilder extends BaseModule
@Reflected
public BuildCraftBuilder()
{
this.testClassExistence( BuilderAPI.class );
this.testClassExistence( IBuilderContext.class );
this.testClassExistence( ISchematicRegistry.class );
this.testClassExistence( SchematicTile.class );
this.testClassExistence( SchematicBlock.class );
IntegrationHelper.testClassExistence( this, buildcraft.api.blueprints.BuilderAPI.class );
IntegrationHelper.testClassExistence( this, buildcraft.api.blueprints.IBuilderContext.class );
IntegrationHelper.testClassExistence( this, buildcraft.api.blueprints.ISchematicRegistry.class );
IntegrationHelper.testClassExistence( this, buildcraft.api.blueprints.SchematicTile.class );
IntegrationHelper.testClassExistence( this, buildcraft.api.blueprints.SchematicBlock.class );
}
@Override
@@ -85,7 +83,6 @@ public class BuildCraftBuilder extends BaseModule
@Override
public void postInit()
{
}
private void initBuilderSupport()
@@ -25,7 +25,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import buildcraft.BuildCraftTransport;
import buildcraft.api.tools.IToolWrench;
import appeng.api.AEApi;
@@ -33,6 +32,7 @@ import appeng.api.config.TunnelType;
import appeng.api.features.IP2PTunnelRegistry;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IBuildCraftCore;
@@ -45,9 +45,9 @@ public final class BuildCraftCore extends BaseModule implements IBuildCraftCore
@Reflected
public BuildCraftCore()
{
this.testClassExistence( buildcraft.BuildCraftCore.class );
this.testClassExistence( BuildCraftTransport.class );
this.testClassExistence( IToolWrench.class );
IntegrationHelper.testClassExistence( this, buildcraft.BuildCraftCore.class );
IntegrationHelper.testClassExistence( this, buildcraft.BuildCraftTransport.class );
IntegrationHelper.testClassExistence( this, buildcraft.api.tools.IToolWrench.class );
}
@Override
@@ -71,7 +71,6 @@ public final class BuildCraftCore extends BaseModule implements IBuildCraftCore
@Override
public void init()
{
}
@Override
@@ -33,7 +33,6 @@ import cpw.mods.fml.common.event.FMLInterModComms;
import buildcraft.api.facades.IFacadeItem;
import buildcraft.api.transport.IInjectable;
import buildcraft.api.transport.IPipeConnection;
import buildcraft.api.transport.IPipeTile;
import buildcraft.transport.ItemFacade;
import buildcraft.transport.PipeIconProvider;
@@ -48,6 +47,7 @@ import appeng.api.parts.IFacadePart;
import appeng.facade.FacadePart;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IBuildCraftTransport;
import appeng.integration.modules.BCHelpers.BCPipeHandler;
@@ -66,14 +66,14 @@ public class BuildCraftTransport extends BaseModule implements IBuildCraftTransp
@Reflected
public BuildCraftTransport()
{
this.testClassExistence( buildcraft.BuildCraftTransport.class );
this.testClassExistence( IFacadeItem.class );
this.testClassExistence( IInjectable.class );
this.testClassExistence( IPipeConnection.class );
this.testClassExistence( IPipeTile.class );
this.testClassExistence( ItemFacade.class );
this.testClassExistence( PipeIconProvider.class );
this.testClassExistence( IPipeTile.PipeType.class );
IntegrationHelper.testClassExistence( this, buildcraft.BuildCraftTransport.class );
IntegrationHelper.testClassExistence( this, buildcraft.api.facades.IFacadeItem.class );
IntegrationHelper.testClassExistence( this, buildcraft.api.transport.IInjectable.class );
IntegrationHelper.testClassExistence( this, buildcraft.api.transport.IPipeConnection.class );
IntegrationHelper.testClassExistence( this, buildcraft.api.transport.IPipeTile.class );
IntegrationHelper.testClassExistence( this, buildcraft.api.transport.IPipeTile.PipeType.class );
IntegrationHelper.testClassExistence( this, buildcraft.transport.ItemFacade.class );
IntegrationHelper.testClassExistence( this, buildcraft.transport.PipeIconProvider.class );
}
@Override
@@ -20,19 +20,26 @@ package appeng.integration.modules;
import appeng.api.util.AEColor;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.ICLApi;
public class CLApi extends BaseModule implements ICLApi
{
@Reflected
public static CLApi instance;
@Reflected
public CLApi()
{
IntegrationHelper.testClassExistence( this, coloredlightscore.src.api.CLApi.class );
}
@Override
public void init() throws Throwable
{
this.testClassExistence( coloredlightscore.src.api.CLApi.class );
}
@Override
@@ -56,6 +56,7 @@ import appeng.api.features.IInscriberRecipe;
import appeng.api.recipes.IIngredient;
import appeng.helpers.Reflected;
import appeng.integration.IIntegrationModule;
import appeng.integration.IntegrationHelper;
import appeng.recipes.game.ShapedRecipe;
import appeng.recipes.game.ShapelessRecipe;
@@ -136,6 +137,33 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
@Reflected
public static CraftGuide instance;
public CraftGuide()
{
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.CraftGuideLog.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.DefaultRecipeTemplate.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.RecipeGeneratorImplementation.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.ChanceSlot.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.CraftGuideAPIObject.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.ItemSlot.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.RecipeGenerator.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.RecipeProvider.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.RecipeTemplate.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.Slot.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.SlotType.class );
IntegrationHelper.testClassExistence( this, uristqwerty.gui_craftguide.texture.DynamicTexture.class );
IntegrationHelper.testClassExistence( this, uristqwerty.gui_craftguide.texture.TextureClip.class );
}
@Override
public void init() throws Throwable
{
}
@Override
public void postInit()
{
}
@Override
public void generateRecipes( RecipeGenerator generator )
{
@@ -428,15 +456,4 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
return null;
}
@Override
public void init() throws Throwable
{
}
@Override
public void postInit()
{
}
}
@@ -25,7 +25,9 @@ import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
import appeng.api.AEApi;
import appeng.api.storage.IMEInventory;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IDSU;
import appeng.integration.modules.helpers.MFRDSUHandler;
import appeng.integration.modules.helpers.MinefactoryReloadedDeepStorageUnit;
@@ -33,8 +35,15 @@ import appeng.integration.modules.helpers.MinefactoryReloadedDeepStorageUnit;
public class DSU extends BaseModule implements IDSU
{
@Reflected
public static DSU instance;
@Reflected
public DSU()
{
IntegrationHelper.testClassExistence( this, powercrystals.minefactoryreloaded.api.IDeepStorageUnit.class );
}
@Override
public IMEInventory getDSU( TileEntity te )
{
@@ -50,7 +59,6 @@ public class DSU extends BaseModule implements IDSU
@Override
public void init()
{
this.testClassExistence( IDeepStorageUnit.class );
}
@Override
@@ -47,6 +47,7 @@ import appeng.fmp.CableBusPart;
import appeng.fmp.FMPEvent;
import appeng.fmp.FMPPlacementHelper;
import appeng.fmp.PartRegistry;
import appeng.helpers.Reflected;
import appeng.integration.IIntegrationModule;
import appeng.integration.abstraction.IFMP;
import appeng.integration.modules.helpers.FMPPacketEvent;
@@ -55,7 +56,7 @@ import appeng.parts.CableBusContainer;
public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IFMP
{
@Reflected
public static FMP instance;
@Override
@@ -28,6 +28,8 @@ import net.minecraft.tileentity.TileEntity;
import appeng.api.AEApi;
import appeng.api.storage.IMEInventory;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IIntegrationModule;
import appeng.integration.abstraction.IFZ;
import appeng.integration.modules.helpers.FactorizationBarrel;
@@ -38,9 +40,9 @@ import appeng.util.Platform;
/**
* 100% Hacks.
*/
public class FZ implements IFZ, IIntegrationModule
public class FZ extends BaseModule implements IFZ, IIntegrationModule
{
@Reflected
public static FZ instance;
private static Class<?> day_BarrelClass;
@@ -27,25 +27,41 @@ import ic2.api.energy.tile.IEnergyTile;
import ic2.api.recipe.RecipeInputItemStack;
import appeng.api.AEApi;
import appeng.api.IAppEngApi;
import appeng.api.config.TunnelType;
import appeng.api.features.IP2PTunnelRegistry;
import appeng.api.parts.IPartHelper;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IIC2;
public class IC2 extends BaseModule implements IIC2
{
@Reflected
public static IC2 instance;
@Reflected
public IC2()
{
this.testClassExistence( IEnergyTile.class );
IntegrationHelper.testClassExistence( this, ic2.api.energy.tile.IEnergyTile.class );
IntegrationHelper.testClassExistence( this, ic2.api.recipe.RecipeInputItemStack.class );
}
@Override
public void init()
{
final IAppEngApi api = AEApi.instance();
final IPartHelper partHelper = api.partHelper();
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) )
{
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySink", "ic2.api.energy.tile.IEnergySink" );
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySource", "ic2.api.energy.tile.IEnergySource" );
}
}
@Override
@@ -31,7 +31,6 @@ import net.minecraft.world.World;
import mods.immibis.core.api.multipart.ICoverSystem;
import mods.immibis.core.api.multipart.IMultipartTile;
import mods.immibis.core.api.multipart.IPartContainer;
import appeng.api.AEApi;
import appeng.api.definitions.IBlockDefinition;
@@ -40,6 +39,7 @@ import appeng.api.parts.IPartItem;
import appeng.core.AELog;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IImmibisMicroblocks;
@@ -53,13 +53,17 @@ public class ImmibisMicroblocks extends BaseModule implements IImmibisMicroblock
private Class<?> MicroblockAPIUtils;
private Method mergeIntoMicroblockContainer;
@Reflected
public ImmibisMicroblocks()
{
IntegrationHelper.testClassExistence( this, mods.immibis.core.api.multipart.IMultipartTile.class );
IntegrationHelper.testClassExistence( this, mods.immibis.core.api.multipart.ICoverSystem.class );
IntegrationHelper.testClassExistence( this, mods.immibis.core.api.multipart.IPartContainer.class );
}
@Override
public void init() throws Throwable
{
this.testClassExistence( IMultipartTile.class );
this.testClassExistence( ICoverSystem.class );
this.testClassExistence( IPartContainer.class );
try
{
this.MicroblockAPIUtils = Class.forName( "mods.immibis.microblocks.api.MicroblockAPIUtils" );
@@ -22,17 +22,26 @@ package appeng.integration.modules;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.Loader;
import invtweaks.api.InvTweaksAPI;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IInvTweaks;
public class InvTweaks extends BaseModule implements IInvTweaks
{
@Reflected
public static InvTweaks instance;
static InvTweaksAPI api;
@Reflected
public InvTweaks()
{
IntegrationHelper.testClassExistence( this, invtweaks.api.InvTweaksAPI.class );
}
@Override
public void init()
{
@@ -19,30 +19,29 @@
package appeng.integration.modules;
import powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
public class MFR extends BaseModule
{
@Reflected
public static MFR instance;
@Reflected
public MFR()
{
this.testClassExistence( IRedNetConnection.class );
IntegrationHelper.testClassExistence( this, powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection.class );
}
@Override
public void init() throws Throwable
{
}
@Override
public void postInit()
{
}
}
@@ -21,26 +21,34 @@ package appeng.integration.modules;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLInterModComms;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IMekanism;
public final class Mekanism extends BaseModule implements IMekanism
{
@Reflected
public static Mekanism instance;
@Reflected
public Mekanism()
{
IntegrationHelper.testClassExistence( this, mekanism.api.energy.IStrictEnergyAcceptor.class );
}
@Override
public void init() throws Throwable
{
this.testClassExistence( mekanism.api.energy.IStrictEnergyAcceptor.class );
}
@Override
public void postInit()
{
}
@Override
@@ -42,6 +42,7 @@ import appeng.core.AEConfig;
import appeng.core.features.AEFeature;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.INEI;
import appeng.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler;
import appeng.integration.modules.NEIHelpers.NEIAEShapelessRecipeHandler;
@@ -61,15 +62,19 @@ public class NEI extends BaseModule implements INEI, IContainerTooltipHandler
private final Class<?> apiClass;
// recipe handler...
Method registerRecipeHandler;
Method registerUsageHandler;
private Method registerRecipeHandler;
private Method registerUsageHandler;
@Reflected
public NEI() throws ClassNotFoundException
{
this.testClassExistence( GuiContainerManager.class );
this.testClassExistence( codechicken.nei.recipe.ICraftingHandler.class );
this.testClassExistence( codechicken.nei.recipe.IUsageHandler.class );
IntegrationHelper.testClassExistence( this, codechicken.nei.api.API.class );
IntegrationHelper.testClassExistence( this, codechicken.nei.api.IStackPositioner.class );
IntegrationHelper.testClassExistence( this, codechicken.nei.guihook.GuiContainerManager.class );
IntegrationHelper.testClassExistence( this, codechicken.nei.guihook.IContainerTooltipHandler.class );
IntegrationHelper.testClassExistence( this, codechicken.nei.recipe.ICraftingHandler.class );
IntegrationHelper.testClassExistence( this, codechicken.nei.recipe.IUsageHandler.class );
this.apiClass = Class.forName( "codechicken.nei.api.API" );
}
@@ -96,7 +101,7 @@ public class NEI extends BaseModule implements INEI, IContainerTooltipHandler
// crafting terminal...
Method registerGuiOverlay = this.apiClass.getDeclaredMethod( "registerGuiOverlay", Class.class, String.class, IStackPositioner.class );
Class overlayHandler = Class.forName( "codechicken.nei.api.IOverlayHandler" );
Class defaultHandler = NEICraftingHandler.class;
Class<NEICraftingHandler> defaultHandler = NEICraftingHandler.class;
Method registrar = this.apiClass.getDeclaredMethod( "registerGuiOverlayHandler", Class.class, overlayHandler, String.class );
registerGuiOverlay.invoke( this.apiClass, GuiCraftingTerm.class, "crafting", new TerminalCraftingSlotFinder() );
@@ -21,27 +21,43 @@ package appeng.integration.modules;
import li.cil.oc.api.Items;
import appeng.api.AEApi;
import appeng.api.IAppEngApi;
import appeng.api.config.TunnelType;
import appeng.api.features.IP2PTunnelRegistry;
import appeng.api.parts.IPartHelper;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
public class OpenComputers extends BaseModule
{
@Reflected
public static OpenComputers instance;
@Reflected
public OpenComputers()
{
this.testClassExistence( li.cil.oc.api.Items.class );
this.testClassExistence( li.cil.oc.api.Network.class );
this.testClassExistence( li.cil.oc.api.network.Environment.class );
this.testClassExistence( li.cil.oc.api.network.SidedEnvironment.class );
this.testClassExistence( li.cil.oc.api.network.Node.class );
this.testClassExistence( li.cil.oc.api.network.Message.class );
IntegrationHelper.testClassExistence( this, li.cil.oc.api.Items.class );
IntegrationHelper.testClassExistence( this, li.cil.oc.api.Network.class );
IntegrationHelper.testClassExistence( this, li.cil.oc.api.network.Environment.class );
IntegrationHelper.testClassExistence( this, li.cil.oc.api.network.SidedEnvironment.class );
IntegrationHelper.testClassExistence( this, li.cil.oc.api.network.Node.class );
IntegrationHelper.testClassExistence( this, li.cil.oc.api.network.Message.class );
}
@Override
public void init()
{
final IAppEngApi api = AEApi.instance();
final IPartHelper partHelper = api.partHelper();
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
{
partHelper.registerNewLayer( "appeng.parts.layers.LayerSidedEnvironment", "li.cil.oc.api.network.SidedEnvironment" );
}
}
@Override
@@ -31,6 +31,7 @@ import appeng.api.features.IP2PTunnelRegistry;
import appeng.api.parts.IPartHelper;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
@@ -45,10 +46,10 @@ public class PneumaticCraft extends BaseModule
@Reflected
public PneumaticCraft()
{
this.testClassExistence( pneumaticCraft.api.block.BlockSupplier.class );
this.testClassExistence( pneumaticCraft.api.tileentity.ISidedPneumaticMachine.class );
this.testClassExistence( pneumaticCraft.api.tileentity.AirHandlerSupplier.class );
this.testClassExistence( pneumaticCraft.api.tileentity.IAirHandler.class );
IntegrationHelper.testClassExistence( this, pneumaticCraft.api.block.BlockSupplier.class );
IntegrationHelper.testClassExistence( this, pneumaticCraft.api.tileentity.ISidedPneumaticMachine.class );
IntegrationHelper.testClassExistence( this, pneumaticCraft.api.tileentity.AirHandlerSupplier.class );
IntegrationHelper.testClassExistence( this, pneumaticCraft.api.tileentity.IAirHandler.class );
}
@Override
@@ -24,19 +24,22 @@ import net.minecraft.item.ItemStack;
import mods.railcraft.api.crafting.IRockCrusherRecipe;
import mods.railcraft.api.crafting.RailcraftCraftingManager;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IRC;
public class RC extends BaseModule implements IRC
{
@Reflected
public static RC instance;
@Reflected
public RC()
{
this.testClassExistence( RailcraftCraftingManager.class );
this.testClassExistence( IRockCrusherRecipe.class );
IntegrationHelper.testClassExistence( this, mods.railcraft.api.crafting.RailcraftCraftingManager.class );
IntegrationHelper.testClassExistence( this, mods.railcraft.api.crafting.IRockCrusherRecipe.class );
}
@Override
@@ -49,13 +52,10 @@ public class RC extends BaseModule implements IRC
@Override
public void init()
{
// TODO Auto-generated method stub
}
@Override
public void postInit()
{
}
}
@@ -23,9 +23,14 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi;
import appeng.api.IAppEngApi;
import appeng.api.config.TunnelType;
import appeng.api.parts.IPartHelper;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
public final class RF extends BaseModule
@@ -33,17 +38,25 @@ public final class RF extends BaseModule
@Reflected
public static RF instance;
@Reflected
public RF()
{
this.testClassExistence( cofh.api.energy.IEnergyReceiver.class );
this.testClassExistence( cofh.api.energy.IEnergyProvider.class );
this.testClassExistence( cofh.api.energy.IEnergyHandler.class );
this.testClassExistence( cofh.api.energy.IEnergyConnection.class );
IntegrationHelper.testClassExistence( this, cofh.api.energy.IEnergyReceiver.class );
IntegrationHelper.testClassExistence( this, cofh.api.energy.IEnergyProvider.class );
IntegrationHelper.testClassExistence( this, cofh.api.energy.IEnergyHandler.class );
IntegrationHelper.testClassExistence( this, cofh.api.energy.IEnergyConnection.class );
}
@Override
public void init()
{
final IAppEngApi api = AEApi.instance();
final IPartHelper partHelper = api.partHelper();
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.RF ) )
{
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergyHandler", "cofh.api.energy.IEnergyReceiver" );
}
}
@Override
@@ -19,28 +19,29 @@
package appeng.integration.modules;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
public class RFItem extends BaseModule
{
@Reflected
public static RFItem instance;
@Reflected
public RFItem()
{
this.testClassExistence( cofh.api.energy.IEnergyContainerItem.class );
IntegrationHelper.testClassExistence( this, cofh.api.energy.IEnergyContainerItem.class );
}
@Override
public void init()
{
}
@Override
public void postInit()
{
}
}
@@ -19,28 +19,30 @@
package appeng.integration.modules;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
public class RotaryCraft extends BaseModule
{
@Reflected
public static RotaryCraft instance;
@Reflected
public RotaryCraft()
{
this.testClassExistence( Reika.RotaryCraft.API.Power.AdvancedShaftPowerReceiver.class );
this.testClassExistence( Reika.RotaryCraft.API.Interfaces.Transducerable.class );
IntegrationHelper.testClassExistence( this, Reika.RotaryCraft.API.Power.AdvancedShaftPowerReceiver.class );
IntegrationHelper.testClassExistence( this, Reika.RotaryCraft.API.Interfaces.Transducerable.class );
}
@Override
public void init() throws Throwable
{
}
@Override
public void postInit()
{
}
}
@@ -22,7 +22,10 @@ package appeng.integration.modules;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.api.IWailaRegistrar;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.modules.waila.PartWailaDataProvider;
import appeng.integration.modules.waila.TileWailaDataProvider;
import appeng.tile.AEBaseTile;
@@ -30,8 +33,19 @@ import appeng.tile.AEBaseTile;
public class Waila extends BaseModule
{
@Reflected
public static Waila instance;
@Reflected
public Waila()
{
IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.IWailaDataProvider.class );
IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.IWailaRegistrar.class );
IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.IWailaConfigHandler.class );
IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.IWailaDataAccessor.class );
IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.ITaggedList.class );
}
public static void register( IWailaRegistrar registrar )
{
final IWailaDataProvider partHost = new PartWailaDataProvider();
@@ -49,15 +63,11 @@ public class Waila extends BaseModule
@Override
public void init() throws Throwable
{
this.testClassExistence( IWailaDataProvider.class );
this.testClassExistence( IWailaRegistrar.class );
FMLInterModComms.sendMessage( "Waila", "register", this.getClass().getName() + ".register" );
}
@Override
public void postInit()
{
// :P
}
}