electrodynamics/src/main/scala/edx/mechanical/mech/turbine/TurbineMBlockHandler.scala

21 lines
734 B
Scala
Raw Normal View History

2015-01-14 12:06:03 +01:00
package edx.mechanical.mech.turbine
import net.minecraft.tileentity.TileEntity
2015-01-26 12:40:32 +01:00
import resonantengine.lib.transform.vector.Vector3
2015-01-26 13:29:32 +01:00
import resonantengine.prefab.block.multiblock.MultiBlockHandler
2015-01-14 12:06:03 +01:00
class TurbineMBlockHandler(wrapper: TileTurbine) extends MultiBlockHandler[TileTurbine](wrapper)
{
override def getWrapperAt(position: Vector3): TileTurbine =
{
val tile: TileEntity = position.getTileEntity(this.tile.getWorld)
if (tile != null && wrapperClass.isAssignableFrom(tile.getClass))
{
if (tile.asInstanceOf[TileTurbine].getDirection == this.tile.getDirection && tile.asInstanceOf[TileTurbine].tier == this.tile.tier)
{
return tile.asInstanceOf[TileTurbine]
}
}
return null
}
}