First iteration of making integrations typesafe

This commit is contained in:
yueh
2015-08-06 16:01:56 +02:00
committed by thatsIch
parent cdcba63c2d
commit 0d25b76b77
45 changed files with 446 additions and 170 deletions
+16 -1
View File
@@ -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;