First iteration of making integrations typesafe
This commit is contained in:
@@ -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;
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user