First iteration of making integrations typesafe
This commit is contained in:
@@ -21,12 +21,6 @@ package appeng.integration;
|
||||
|
||||
public abstract class BaseModule implements IIntegrationModule
|
||||
{
|
||||
|
||||
protected void testClassExistence( Class<?> clz )
|
||||
{
|
||||
clz.isInstance( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void init() throws Throwable;
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.integration;
|
||||
|
||||
|
||||
public class IntegrationHelper
|
||||
{
|
||||
|
||||
public static void testClassExistence( Object o, Class<?> clz )
|
||||
{
|
||||
clz.isInstance( o );
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public final class IntegrationNode
|
||||
IntegrationStage failedStage = IntegrationStage.PRE_INIT;
|
||||
Throwable exception = null;
|
||||
String name = null;
|
||||
Class classValue = null;
|
||||
Class<?> classValue = null;
|
||||
Object instance;
|
||||
IIntegrationModule mod = null;
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ public enum IntegrationRegistry
|
||||
{
|
||||
INSTANCE;
|
||||
|
||||
private static final String PACKAGE_PREFIX = "appeng.integration.modules.";
|
||||
|
||||
private final Collection<IntegrationNode> modules = new LinkedList<IntegrationNode>();
|
||||
|
||||
public void add( IntegrationType type )
|
||||
@@ -46,7 +48,7 @@ public enum IntegrationRegistry
|
||||
return;
|
||||
}
|
||||
|
||||
this.modules.add( new IntegrationNode( type.dspName, type.modID, type, "appeng.integration.modules." + type.name() ) );
|
||||
this.modules.add( new IntegrationNode( type.dspName, type.modID, type, PACKAGE_PREFIX + type.name() ) );
|
||||
}
|
||||
|
||||
public void init()
|
||||
|
||||
@@ -23,8 +23,10 @@ import net.mcft.copy.betterstorage.api.crate.ICrateStorage;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.integration.BaseModule;
|
||||
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;
|
||||
@@ -33,12 +35,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
|
||||
@@ -60,7 +63,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
|
||||
|
||||
@@ -50,6 +50,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;
|
||||
@@ -58,7 +59,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" );
|
||||
|
||||
@@ -25,17 +25,25 @@ import cpw.mods.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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,25 +24,31 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
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() );
|
||||
|
||||
@@ -22,28 +22,44 @@ 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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,9 +25,14 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
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
|
||||
@@ -35,17 +40,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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,9 @@ import cpw.mods.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;
|
||||
@@ -32,8 +34,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();
|
||||
@@ -51,15 +64,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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user