First iteration of making integrations typesafe
This commit is contained in:
parent
cdcba63c2d
commit
0d25b76b77
|
@ -67,9 +67,10 @@ import appeng.tile.networking.TileCableBus;
|
|||
import appeng.tile.networking.TileCableBusTESR;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
// TODO: MFR INTEGRATION
|
||||
//@Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR" )
|
||||
public class BlockCableBus extends AEBaseTileBlock // implements IRedNetConnection
|
||||
//@Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = IntegrationType.MFR )
|
||||
public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnection
|
||||
{
|
||||
|
||||
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
|
||||
|
@ -475,14 +476,17 @@ public class BlockCableBus extends AEBaseTileBlock // implements IRedNetConnecti
|
|||
CommonHelper.proxy.bindTileEntitySpecialRenderer( tesrTile, this );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* // TODO MFR INTEGRATION
|
||||
@Override
|
||||
@Method( iname = "MFR" )
|
||||
public RedNetConnectionType getConnectionType( World world, int x, int y, int z, AEPartLocation side )
|
||||
{
|
||||
return this.cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( AEPartLocation.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None;
|
||||
}
|
||||
*/
|
||||
|
||||
// TODO MFR Integration
|
||||
// @Override
|
||||
// @Method( iname = IntegrationType.MFR )
|
||||
// public RedNetConnectionType getConnectionType( World world, int x, int y, int z, ForgeDirection side )
|
||||
// {
|
||||
// return this.cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None;
|
||||
// }
|
||||
//
|
||||
// public void setRenderColor( int color )
|
||||
// {
|
||||
// this.myColorMultiplier = color;
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -243,7 +243,7 @@ public final class Registration
|
|||
// partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergyHandler", "cofh.api.energy.IEnergyReceiver" );
|
||||
// }
|
||||
//
|
||||
// if ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
|
||||
// if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
|
||||
// {
|
||||
// partHelper.registerNewLayer( "appeng.parts.layers.LayerSidedEnvironment", "li.cil.oc.api.network.SidedEnvironment" );
|
||||
// }
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
|
@ -38,7 +38,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()
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ import appeng.core.features.AEFeature;
|
|||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketClick;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.items.contents.NetworkToolViewer;
|
||||
import appeng.transformer.annotations.Integration.Interface;
|
||||
|
@ -53,8 +54,8 @@ import appeng.util.Platform;
|
|||
import com.google.common.base.Optional;
|
||||
|
||||
// TODO BC Integration
|
||||
//@Interface( iface = "buildcraft.api.tools.IToolWrench", iname = "BuildCraftCore" )
|
||||
public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench
|
||||
//@Interface( iface = "buildcraft.api.tools.IToolWrench", iname = IntegrationType.BuildCraftCore )
|
||||
public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench /*, IToolWrench */
|
||||
{
|
||||
|
||||
public ToolNetworkTool()
|
||||
|
|
|
@ -19,7 +19,23 @@
|
|||
package appeng.items.tools.powered.powersink;
|
||||
|
||||
|
||||
//@InterfaceList( value = { @Interface( iface = "ic2.api.item.ISpecialElectricItem", iname = "IC2" ), @Interface( iface = "ic2.api.item.IElectricItemManager", iname = "IC2" ) } )
|
||||
//import com.google.common.base.Optional;
|
||||
//
|
||||
//import net.minecraft.entity.EntityLivingBase;
|
||||
//import net.minecraft.item.Item;
|
||||
//import net.minecraft.item.ItemStack;
|
||||
//
|
||||
//import ic2.api.item.IElectricItemManager;
|
||||
//import ic2.api.item.ISpecialElectricItem;
|
||||
//
|
||||
//import appeng.api.config.PowerUnits;
|
||||
//import appeng.integration.IntegrationType;
|
||||
//import appeng.transformer.annotations.Integration.Interface;
|
||||
//import appeng.transformer.annotations.Integration.InterfaceList;
|
||||
//import appeng.transformer.annotations.Integration.Method;
|
||||
//
|
||||
//
|
||||
//@InterfaceList( value = { @Interface( iface = "ic2.api.item.ISpecialElectricItem", iname = IntegrationType.IC2 ), @Interface( iface = "ic2.api.item.IElectricItemManager", iname = IntegrationType.IC2 ) } )
|
||||
//public abstract class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpecialElectricItem
|
||||
//{
|
||||
// public IC2( double powerCapacity, Optional<String> subName )
|
||||
|
@ -120,7 +136,7 @@ package appeng.items.tools.powered.powersink;
|
|||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Method( iname = "IC2" )
|
||||
// @Method( iname = IntegrationType.IC2 )
|
||||
// public IElectricItemManager getManager( ItemStack itemStack )
|
||||
// {
|
||||
// return this;
|
||||
|
|
|
@ -19,7 +19,18 @@
|
|||
package appeng.items.tools.powered.powersink;
|
||||
|
||||
|
||||
//@Interface( iface = "cofh.api.energy.IEnergyContainerItem", iname = "RFItem" )
|
||||
//import com.google.common.base.Optional;
|
||||
//
|
||||
//import net.minecraft.item.ItemStack;
|
||||
//
|
||||
//import cofh.api.energy.IEnergyContainerItem;
|
||||
//
|
||||
//import appeng.api.config.PowerUnits;
|
||||
//import appeng.integration.IntegrationType;
|
||||
//import appeng.transformer.annotations.Integration.Interface;
|
||||
//
|
||||
//
|
||||
//@Interface( iface = "cofh.api.energy.IEnergyContainerItem", iname = IntegrationType.RFItem )
|
||||
//public abstract class RedstoneFlux extends IC2 implements IEnergyContainerItem
|
||||
//{
|
||||
// public RedstoneFlux( double powerCapacity, Optional<String> subName )
|
||||
|
|
|
@ -30,14 +30,15 @@ import net.minecraft.world.World;
|
|||
import appeng.api.implementations.items.IAEWrench;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
// TODO BC Integration
|
||||
//@Interface( iface = "buildcraft.api.tools.IToolWrench", iname = "BuildCraftCore" )
|
||||
public class ToolQuartzWrench extends AEBaseItem implements IAEWrench
|
||||
//@Interface( iface = "buildcraft.api.tools.IToolWrench", iname = IntegrationType.BuildCraftCore )
|
||||
public class ToolQuartzWrench extends AEBaseItem implements IAEWrench /*, IToolWrench */
|
||||
{
|
||||
|
||||
public ToolQuartzWrench( AEFeature type )
|
||||
|
|
|
@ -21,6 +21,8 @@ package appeng.parts.automation;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -35,6 +37,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.networking.IGridNode;
|
||||
|
@ -67,8 +70,6 @@ import appeng.util.IWorldCallable;
|
|||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
|
||||
public class PartAnnihilationPlane extends PartBasicState implements IGridTickable, IWorldCallable<TickRateModulation>
|
||||
{
|
||||
|
@ -363,10 +364,6 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
|||
/**
|
||||
* Spawns an overflow item as new {@link EntityItem} into the {@link World}
|
||||
*
|
||||
* @param w the world to spawn it
|
||||
* @param x x coordinate
|
||||
* @param y y coordinate
|
||||
* @param z coordinate
|
||||
* @param overflow the item to spawn
|
||||
*/
|
||||
private void spawnOverflow( IAEItemStack overflow )
|
||||
|
@ -377,10 +374,12 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
|||
}
|
||||
|
||||
final TileEntity te = this.getTile();
|
||||
final WorldServer w = (WorldServer) te.getWorldObj();
|
||||
final double x = te.xCoord + this.side.offsetX + .5d;
|
||||
final double y = te.yCoord + this.side.offsetY + .5d;
|
||||
final double z = te.zCoord + this.side.offsetZ + .5d;
|
||||
final WorldServer w = (WorldServer) te.getWorld();
|
||||
final BlockPos offset = te.getPos().offset( this.side.getFacing() );
|
||||
final BlockPos add = offset.add( .5, .5, .5 );
|
||||
final double x = add.getX();
|
||||
final double y = add.getY();
|
||||
final double z = add.getZ();
|
||||
|
||||
final EntityItem overflowEntity = new EntityItem( w, x, y, z, overflow.getItemStack() );
|
||||
overflowEntity.motionX = 0;
|
||||
|
|
|
@ -73,6 +73,7 @@ import appeng.core.sync.GuiBridge;
|
|||
import appeng.helpers.IInterfaceHost;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.storage.MEInventoryHandler;
|
||||
import appeng.me.storage.MEMonitorIInventory;
|
||||
|
@ -85,8 +86,8 @@ import appeng.util.prioitylist.PrecisePriorityList;
|
|||
|
||||
|
||||
// TODO: BC Integration
|
||||
//@Interface( iname = "BuildCraftTransport", iface = "buildcraft.api.transport.IPipeConnection" )
|
||||
public class PartStorageBus extends PartUpgradeable implements IGridTickable, ICellContainer, IMEMonitorHandlerReceiver<IAEItemStack>, IPriorityHost
|
||||
//@Interface( iname = IntegrationType.BuildCraftTransport, iface = "buildcraft.api.transport.IPipeConnection" )
|
||||
public class PartStorageBus extends PartUpgradeable implements IGridTickable, ICellContainer, IMEMonitorHandlerReceiver<IAEItemStack> /*, IPipeConnection*/, IPriorityHost
|
||||
{
|
||||
final BaseActionSource mySrc;
|
||||
final AppEngInternalAEInventory Config = new AppEngInternalAEInventory( this, 63 );
|
||||
|
@ -561,7 +562,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
|||
// TODO: BC PIPE INTEGRATION
|
||||
/*
|
||||
@Override
|
||||
@Method( iname = "BuildCraftTransport" )
|
||||
@Method( iname = IntegrationType.BuildCraftTransport )
|
||||
public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
|
||||
{
|
||||
return type == PipeType.ITEM && with == this.side ? ConnectOverride.CONNECT : ConnectOverride.DISCONNECT;
|
||||
|
|
|
@ -19,7 +19,28 @@
|
|||
package appeng.parts.p2p;
|
||||
|
||||
|
||||
//@InterfaceList( value = { @Interface( iface = "ic2.api.energy.tile.IEnergySink", iname = "IC2" ), @Interface( iface = "ic2.api.energy.tile.IEnergySource", iname = "IC2" ) } )
|
||||
//import java.util.LinkedList;
|
||||
//
|
||||
//import net.minecraft.init.Blocks;
|
||||
//import net.minecraft.item.ItemStack;
|
||||
//import net.minecraft.nbt.NBTTagCompound;
|
||||
//import net.minecraft.tileentity.TileEntity;
|
||||
//import net.minecraft.util.IIcon;
|
||||
//import net.minecraftforge.common.util.ForgeDirection;
|
||||
//
|
||||
//import cpw.mods.fml.relauncher.Side;
|
||||
//import cpw.mods.fml.relauncher.SideOnly;
|
||||
//
|
||||
//import appeng.api.config.PowerUnits;
|
||||
//import appeng.integration.IntegrationType;
|
||||
//import appeng.me.GridAccessException;
|
||||
//import appeng.me.cache.helpers.TunnelCollection;
|
||||
//import appeng.transformer.annotations.Integration.Interface;
|
||||
//import appeng.transformer.annotations.Integration.InterfaceList;
|
||||
//import appeng.util.Platform;
|
||||
//
|
||||
//
|
||||
//@InterfaceList( value = { @Interface( iface = "ic2.api.energy.tile.IEnergySink", iname = IntegrationType.IC2 ), @Interface( iface = "ic2.api.energy.tile.IEnergySource", iname = IntegrationType.IC2 ) } )
|
||||
//public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements ic2.api.energy.tile.IEnergySink, ic2.api.energy.tile.IEnergySource
|
||||
//{
|
||||
//
|
||||
|
@ -37,7 +58,7 @@ package appeng.parts.p2p;
|
|||
//
|
||||
// @Override
|
||||
// @SideOnly( Side.CLIENT )
|
||||
// public TextureAtlasSprite getTypeTexture()
|
||||
// public IIcon getTypeTexture()
|
||||
// {
|
||||
// return Blocks.diamond_block.getBlockTextureFromSide( 0 );
|
||||
// }
|
||||
|
|
|
@ -52,9 +52,9 @@ import appeng.util.inv.WrapperChainedInventory;
|
|||
import appeng.util.inv.WrapperMCISidedInventory;
|
||||
|
||||
|
||||
// TODO: BC Integration
|
||||
//@Integration.Interface( iface = "buildcraft.api.transport.IPipeConnection", iname = "BuildCraftTransport" )
|
||||
public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements ISidedInventory, IGridTickable
|
||||
// TODO: BC Integration
|
||||
//@Interface( iface = "buildcraft.api.transport.IPipeConnection", iname = IntegrationType.BuildCraftTransport )
|
||||
public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipeConnection,*/ ISidedInventory, IGridTickable
|
||||
{
|
||||
|
||||
final LinkedList<IInventory> which = new LinkedList<IInventory>();
|
||||
|
@ -370,12 +370,18 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements ISidedI
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getField(
|
||||
int id )
|
||||
public int getField( int id )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @Method( iname = IntegrationType.BuildCraftTransport )
|
||||
// public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void setField(
|
||||
int id,
|
||||
|
|
|
@ -54,7 +54,7 @@ package appeng.parts.p2p;
|
|||
//import appeng.util.IWorldCallable;
|
||||
//
|
||||
//
|
||||
//@InterfaceList( value = { @Interface( iface = "li.cil.oc.api.network.Environment", iname = "OpenComputers" ), @Interface( iface = "li.cil.oc.api.network.SidedEnvironment", iname = "OpenComputers" ) } )
|
||||
//@InterfaceList( value = { @Interface( iface = "li.cil.oc.api.network.Environment", iname = IntegrationType.OpenComputers ), @Interface( iface = "li.cil.oc.api.network.SidedEnvironment", iname = IntegrationType.OpenComputers ) } )
|
||||
//public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenComputers> implements IGridTickable, Environment, SidedEnvironment
|
||||
//{
|
||||
// @Nullable
|
||||
|
|
|
@ -38,11 +38,12 @@ package appeng.parts.p2p;
|
|||
//import appeng.api.networking.ticking.TickRateModulation;
|
||||
//import appeng.api.networking.ticking.TickingRequest;
|
||||
//import appeng.core.settings.TickRates;
|
||||
//import appeng.integration.IntegrationType;
|
||||
//import appeng.transformer.annotations.Integration.Interface;
|
||||
//import appeng.util.Platform;
|
||||
//
|
||||
//
|
||||
//@Interface( iface = "pneumaticCraft.api.tileentity.ISidedPneumaticMachine", iname = "PneumaticCraft" )
|
||||
//@Interface( iface = "pneumaticCraft.api.tileentity.ISidedPneumaticMachine", iname = IntegrationType.PneumaticCraft )
|
||||
//public final class PartP2PPressure extends PartP2PTunnel<PartP2PPressure> implements ISidedPneumaticMachine, IGridTickable
|
||||
//{
|
||||
// private static final String PRESSURE_NBT_TAG = "pneumaticCraft";
|
||||
|
|
|
@ -19,7 +19,29 @@
|
|||
package appeng.parts.p2p;
|
||||
|
||||
|
||||
//@InterfaceList( value = { @Interface( iface = "cofh.api.energy.IEnergyReceiver", iname = "RF" ) } )
|
||||
//import java.util.Stack;
|
||||
//
|
||||
//import net.minecraft.init.Blocks;
|
||||
//import net.minecraft.item.ItemStack;
|
||||
//import net.minecraft.tileentity.TileEntity;
|
||||
//import net.minecraft.util.IIcon;
|
||||
//import net.minecraftforge.common.util.ForgeDirection;
|
||||
//
|
||||
//import cpw.mods.fml.relauncher.Side;
|
||||
//import cpw.mods.fml.relauncher.SideOnly;
|
||||
//
|
||||
//import cofh.api.energy.IEnergyReceiver;
|
||||
//
|
||||
//import appeng.api.config.PowerUnits;
|
||||
//import appeng.integration.IntegrationType;
|
||||
//import appeng.integration.modules.helpers.NullRFHandler;
|
||||
//import appeng.me.GridAccessException;
|
||||
//import appeng.transformer.annotations.Integration.Interface;
|
||||
//import appeng.transformer.annotations.Integration.InterfaceList;
|
||||
//import appeng.util.Platform;
|
||||
//
|
||||
//
|
||||
//@InterfaceList( value = { @Interface( iface = "cofh.api.energy.IEnergyReceiver", iname = IntegrationType.RF ) } )
|
||||
//public final class PartP2PRFPower extends PartP2PTunnel<PartP2PRFPower> implements IEnergyReceiver
|
||||
//{
|
||||
// private static final ThreadLocal<Stack<PartP2PRFPower>> THREAD_STACK = new ThreadLocal<Stack<PartP2PRFPower>>();
|
||||
|
@ -37,7 +59,7 @@ package appeng.parts.p2p;
|
|||
//
|
||||
// @Override
|
||||
// @SideOnly( Side.CLIENT )
|
||||
// public TextureAtlasSprite getTypeTexture()
|
||||
// public IIcon getTypeTexture()
|
||||
// {
|
||||
// return Blocks.iron_block.getBlockTextureFromSide( 0 );
|
||||
// }
|
||||
|
@ -148,7 +170,7 @@ package appeng.parts.p2p;
|
|||
// if( !this.cachedTarget )
|
||||
// {
|
||||
// TileEntity self = this.getTile();
|
||||
// TileEntity te = self.getWorld().getTileEntity( self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ );
|
||||
// TileEntity te = self.getWorldObj().getTileEntity( self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ );
|
||||
// this.outputTarget = te instanceof IEnergyReceiver ? (IEnergyReceiver) te : null;
|
||||
// this.cachedTarget = true;
|
||||
// }
|
||||
|
|
|
@ -19,7 +19,22 @@
|
|||
package appeng.tile.powersink;
|
||||
|
||||
|
||||
//@Interface( iname = "IC2", iface = "ic2.api.energy.tile.IEnergySink" )
|
||||
//import java.util.EnumSet;
|
||||
//
|
||||
//import net.minecraft.tileentity.TileEntity;
|
||||
//import net.minecraftforge.common.util.ForgeDirection;
|
||||
//
|
||||
//import ic2.api.energy.tile.IEnergySink;
|
||||
//
|
||||
//import appeng.api.config.PowerUnits;
|
||||
//import appeng.integration.IntegrationRegistry;
|
||||
//import appeng.integration.IntegrationType;
|
||||
//import appeng.integration.abstraction.IIC2;
|
||||
//import appeng.transformer.annotations.Integration.Interface;
|
||||
//import appeng.util.Platform;
|
||||
//
|
||||
//
|
||||
//@Interface( iname = IntegrationType.IC2, iface = "ic2.api.energy.tile.IEnergySink" )
|
||||
//public abstract class IC2 extends AERootPoweredTile implements IEnergySink
|
||||
//{
|
||||
//
|
||||
|
|
|
@ -19,7 +19,16 @@
|
|||
package appeng.tile.powersink;
|
||||
|
||||
|
||||
//@Interface( iname = "Mekanism", iface = "mekanism.api.energy.IStrictEnergyAcceptor" )
|
||||
//import net.minecraftforge.common.util.ForgeDirection;
|
||||
//
|
||||
//import mekanism.api.energy.IStrictEnergyAcceptor;
|
||||
//
|
||||
//import appeng.api.config.PowerUnits;
|
||||
//import appeng.integration.IntegrationType;
|
||||
//import appeng.transformer.annotations.Integration.Interface;
|
||||
//
|
||||
//
|
||||
//@Interface( iname = IntegrationType.Mekanism, iface = "mekanism.api.energy.IStrictEnergyAcceptor" )
|
||||
//public abstract class MekJoules extends RedstoneFlux implements IStrictEnergyAcceptor
|
||||
//{
|
||||
//
|
||||
|
|
|
@ -19,7 +19,16 @@
|
|||
package appeng.tile.powersink;
|
||||
|
||||
|
||||
//@Interface( iname = "RF", iface = "cofh.api.energy.IEnergyReceiver" )
|
||||
//import net.minecraftforge.common.util.ForgeDirection;
|
||||
//
|
||||
//import cofh.api.energy.IEnergyReceiver;
|
||||
//
|
||||
//import appeng.api.config.PowerUnits;
|
||||
//import appeng.integration.IntegrationType;
|
||||
//import appeng.transformer.annotations.Integration.Interface;
|
||||
//
|
||||
//
|
||||
//@Interface( iname = IntegrationType.RF, iface = "cofh.api.energy.IEnergyReceiver" )
|
||||
//public abstract class RedstoneFlux extends RotaryCraft implements IEnergyReceiver
|
||||
//{
|
||||
// @Override
|
||||
|
|
|
@ -19,7 +19,24 @@
|
|||
package appeng.tile.powersink;
|
||||
|
||||
|
||||
//@InterfaceList( value = { @Interface( iname = "RotaryCraft", iface = "Reika.RotaryCraft.API.Power.AdvancedShaftPowerReceiver" ), @Interface( iname = "RotaryCraft", iface = "Reika.RotaryCraft.API.Interfaces.Transducerable") } )
|
||||
//import java.util.ArrayList;
|
||||
//
|
||||
//import net.minecraft.world.World;
|
||||
//import net.minecraftforge.common.util.ForgeDirection;
|
||||
//
|
||||
//import Reika.RotaryCraft.API.Interfaces.Transducerable;
|
||||
//import Reika.RotaryCraft.API.Power.AdvancedShaftPowerReceiver;
|
||||
//
|
||||
//import appeng.api.config.PowerUnits;
|
||||
//import appeng.integration.IntegrationType;
|
||||
//import appeng.tile.TileEvent;
|
||||
//import appeng.tile.events.TileEventType;
|
||||
//import appeng.transformer.annotations.Integration.Interface;
|
||||
//import appeng.transformer.annotations.Integration.InterfaceList;
|
||||
//import appeng.transformer.annotations.Integration.Method;
|
||||
//
|
||||
//
|
||||
//@InterfaceList( value = { @Interface( iname = IntegrationType.RotaryCraft, iface = "Reika.RotaryCraft.API.Power.AdvancedShaftPowerReceiver" ), @Interface( iname = IntegrationType.RotaryCraft, iface = "Reika.RotaryCraft.API.Interfaces.Transducerable" ) } )
|
||||
//public abstract class RotaryCraft extends IC2 implements AdvancedShaftPowerReceiver, Transducerable
|
||||
//{
|
||||
//
|
||||
|
@ -31,7 +48,7 @@ package appeng.tile.powersink;
|
|||
// private long currentPower = 0;
|
||||
//
|
||||
// @TileEvent( TileEventType.TICK )
|
||||
// @Method( iname = "RotaryCraft" )
|
||||
// @Method( iname = IntegrationType.RotaryCraft )
|
||||
// public void Tick_RotaryCraft()
|
||||
// {
|
||||
// if( this.worldObj != null && !this.worldObj.isRemote && this.currentPower > 0 )
|
||||
|
@ -144,24 +161,23 @@ package appeng.tile.powersink;
|
|||
// public final ArrayList<String> getMessages( World world, int x, int y, int z, int side )
|
||||
// {
|
||||
// String out;
|
||||
// if( power >= 1000000000 )
|
||||
// if( this.power >= 1000000000 )
|
||||
// {
|
||||
// out = String.format( "Receiving %.3f GW @ %d rad/s.", power / 1000000000.0D, omega );
|
||||
// out = String.format( "Receiving %.3f GW @ %d rad/s.", this.power / 1000000000.0D, this.omega );
|
||||
// }
|
||||
// else if( power >= 1000000 )
|
||||
// else if( this.power >= 1000000 )
|
||||
// {
|
||||
// out = String.format( "Receiving %.3f MW @ %d rad/s.", power / 1000000.0D, omega );
|
||||
// out = String.format( "Receiving %.3f MW @ %d rad/s.", this.power / 1000000.0D, this.omega );
|
||||
// }
|
||||
// else if( power >= 1000 )
|
||||
// else if( this.power >= 1000 )
|
||||
// {
|
||||
// out = String.format( "Receiving %.3f kW @ %d rad/s.", power / 1000.0D, omega );
|
||||
// out = String.format( "Receiving %.3f kW @ %d rad/s.", this.power / 1000.0D, this.omega );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// out = String.format( "Receiving %d W @ %d rad/s.", power, omega );
|
||||
// out = String.format( "Receiving %d W @ %d rad/s.", this.power, this.omega );
|
||||
// }
|
||||
//
|
||||
//
|
||||
// ArrayList<String> messages = new ArrayList<String>( 1 );
|
||||
// messages.add( out );
|
||||
// return messages;
|
||||
|
|
|
@ -24,6 +24,8 @@ import java.lang.annotation.Retention;
|
|||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import appeng.integration.IntegrationType;
|
||||
|
||||
|
||||
public @interface Integration
|
||||
{
|
||||
|
@ -41,7 +43,7 @@ public @interface Integration
|
|||
{
|
||||
String iface();
|
||||
|
||||
String iname();
|
||||
IntegrationType iname();
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,6 +51,6 @@ public @interface Integration
|
|||
@Target( ElementType.METHOD )
|
||||
@interface Method
|
||||
{
|
||||
String iname();
|
||||
IntegrationType iname();
|
||||
}
|
||||
}
|
|
@ -183,11 +183,11 @@ public final class ASMIntegration implements IClassTransformer
|
|||
|
||||
if( an.values.get( 0 ).equals( "iname" ) )
|
||||
{
|
||||
iName = (String) an.values.get( 1 );
|
||||
iName = ( (String[]) an.values.get( 1 ) )[1];
|
||||
}
|
||||
else if( an.values.get( 2 ).equals( "iname" ) )
|
||||
{
|
||||
iName = (String) an.values.get( 3 );
|
||||
iName = ( (String[]) an.values.get( 3 ) )[1];
|
||||
}
|
||||
|
||||
if( iName != null && iFace != null )
|
||||
|
@ -223,7 +223,7 @@ public final class ASMIntegration implements IClassTransformer
|
|||
|
||||
if( an.values.get( 0 ).equals( "iname" ) )
|
||||
{
|
||||
iName = (String) an.values.get( 1 );
|
||||
iName = ( (String[]) an.values.get( 1 ) )[1];
|
||||
}
|
||||
|
||||
if( iName != null )
|
||||
|
|
Loading…
Reference in New Issue