blob: 6d405e973997f9adafbfd5edbb24059b56b3e3cf [file] [log] [blame] [raw]
package li.cil.oc.server.driver
import li.cil.oc.api.driver
import li.cil.oc.server.component
import li.cil.oc.util.RedstoneInMotion
import net.minecraft.world.World
object Carriage extends driver.Block {
def worksWith(world: World, x: Int, y: Int, z: Int) =
Option(world.getBlockTileEntity(x, y, z)) match {
case Some(entity) if RedstoneInMotion.isCarriageController(entity) => true
case _ => false
}
def createEnvironment(world: World, x: Int, y: Int, z: Int) =
world.getBlockTileEntity(x, y, z) match {
case entity if RedstoneInMotion.isCarriageController(entity) => new component.Carriage(entity)
case _ => null
}
}