electrodynamics/src/main/scala/edx/mechanical/mech/process/grinder/NodeGrinder.scala

21 lines
965 B
Scala

package edx.mechanical.mech.process.grinder
import edx.core.interfaces.TNodeMechanical
import edx.mechanical.mech.gear.NodeGear
import edx.mechanical.mech.grid.NodeMechanical
import net.minecraftforge.common.util.ForgeDirection
/**
* @author Calclavia
*/
class NodeGrinder(parent: TileGrindingWheel) extends NodeMechanical(parent: TileGrindingWheel)
{
override def inertia = 1000d * Math.abs(angularVelocity)
override def canConnect[B <: NodeMechanical](other: B, from: ForgeDirection): Boolean = parent.getDirection == from || parent.getDirection.getOpposite == from
override def inverseRotation(other: TNodeMechanical): Boolean = if (other.isInstanceOf[NodeGear]) (toVectorWorld - other.asInstanceOf[NodeMechanical].toVectorWorld).toArray.sum < 0 else false
override def inverseNext(other: TNodeMechanical): Boolean = if (other.isInstanceOf[NodeGear]) (toVectorWorld - other.asInstanceOf[NodeMechanical].toVectorWorld).toArray.sum < 0 else false
}