From 949b0c0023937e9c7f5d3b10c98ffdb27d358eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Tue, 18 Feb 2014 22:52:23 +0100 Subject: [PATCH] updated to UE 3.1 api, closes #122 --- .../java/li/cil/oc/common/tileentity/PowerConverter.scala | 4 ++-- .../universalelectricity/api/net/IConnectable.java | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/li/cil/oc/common/tileentity/PowerConverter.scala b/src/main/java/li/cil/oc/common/tileentity/PowerConverter.scala index 4540709ba..e72f4b024 100644 --- a/src/main/java/li/cil/oc/common/tileentity/PowerConverter.scala +++ b/src/main/java/li/cil/oc/common/tileentity/PowerConverter.scala @@ -24,6 +24,8 @@ import universalelectricity.api.energy.{IEnergyContainer, IEnergyInterface} abstract class PowerConverterBase extends TileEntity with network.Environment with IEnergyInterface with IEnergyContainer { override def node: Connector + override def canConnect(direction: ForgeDirection, source: AnyRef) = direction != null && direction != ForgeDirection.UNKNOWN + override def onReceiveEnergy(from: ForgeDirection, receive: Long, doReceive: Boolean) = { if (!Settings.get.ignorePower && node != null) { val energy = fromUE(receive) @@ -63,8 +65,6 @@ class PowerConverter extends PowerConverterBase with Analyzable { override def onAnalyze(player: EntityPlayer, side: Int, hitX: Float, hitY: Float, hitZ: Float) = null - override def canConnect(direction: ForgeDirection) = direction != null && direction != ForgeDirection.UNKNOWN - // ----------------------------------------------------------------------- // override def updateEntity() { diff --git a/src/main/optional/universalelectricity/api/net/IConnectable.java b/src/main/optional/universalelectricity/api/net/IConnectable.java index c971d4335..a87e77e84 100644 --- a/src/main/optional/universalelectricity/api/net/IConnectable.java +++ b/src/main/optional/universalelectricity/api/net/IConnectable.java @@ -9,10 +9,11 @@ import net.minecraftforge.common.ForgeDirection; public interface IConnectable { /** - * Can this TileEntity connect with another? + * Can this object connect with another? * + * @param from - The direction the connection is coming from. + * @param source - The source calling canConnect onto this object. * @return Return true, if the connection is possible. */ - @Deprecated - public boolean canConnect(ForgeDirection direction); + public boolean canConnect(ForgeDirection from, Object source); }