2014-09-29 22:36:56 +02:00
|
|
|
package resonantinduction.mechanical.mech.turbine
|
|
|
|
|
|
|
|
import net.minecraftforge.common.util.ForgeDirection
|
2014-11-13 03:22:46 +01:00
|
|
|
import resonantinduction.mechanical.mech.grid.NodeMechanical
|
2014-09-29 22:36:56 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Turbine's Mechanical node
|
|
|
|
* Turbines always face forward and connect from behind.
|
|
|
|
*
|
|
|
|
* @author Calclavia, Darkguardsman
|
|
|
|
*/
|
2014-11-14 17:22:38 +01:00
|
|
|
class TurbineNode(parent: TileTurbine) extends NodeMechanical(parent)
|
2014-09-29 22:36:56 +02:00
|
|
|
{
|
|
|
|
|
2014-11-14 17:22:38 +01:00
|
|
|
/**
|
|
|
|
* Moment of inertia = m * r * r
|
|
|
|
* Where "m" is the mass and "r" is the radius of the object.
|
|
|
|
*/
|
|
|
|
override def momentOfInertia = parent.multiBlockRadius * parent.multiBlockRadius
|
|
|
|
|
2014-10-26 15:41:40 +01:00
|
|
|
def turbine: TileTurbine =
|
|
|
|
{
|
|
|
|
return getParent.asInstanceOf[TileTurbine]
|
|
|
|
}
|
2014-09-29 22:36:56 +02:00
|
|
|
|
2014-11-04 15:06:08 +01:00
|
|
|
override def canConnect[B](other: B, from: ForgeDirection): Boolean =
|
2014-10-26 15:41:40 +01:00
|
|
|
{
|
2014-11-13 03:22:46 +01:00
|
|
|
return turbine.getMultiBlock.isPrimary && other.isInstanceOf[NodeMechanical] && !(other.isInstanceOf[TurbineNode]) && from == turbine.getDirection
|
2014-10-26 15:41:40 +01:00
|
|
|
}
|
2014-09-29 22:36:56 +02:00
|
|
|
|
2014-11-10 12:28:36 +01:00
|
|
|
/**
|
2014-10-26 15:41:40 +01:00
|
|
|
override def inverseRotation(dir: ForgeDirection): Boolean =
|
|
|
|
{
|
|
|
|
return dir == turbine.getDirection.getOpposite
|
2014-11-14 17:22:38 +01:00
|
|
|
} */
|
2014-09-29 22:36:56 +02:00
|
|
|
}
|