updated to UE 3.1 api, closes #122

This commit is contained in:
Florian Nücke 2014-02-18 22:52:23 +01:00
parent f2b128b3fb
commit 949b0c0023
2 changed files with 6 additions and 5 deletions

View File

@ -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() {

View File

@ -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);
}