blob: b2e54e9401397348312be497c48f2db75aa1a0e0 [file] [log] [blame] [raw]
package li.cil.oc.integration.computercraft
import dan200.computercraft.api.ComputerCraftAPI
import dan200.computercraft.api.peripheral.IPeripheralProvider
import li.cil.oc.common.tileentity.Switch
import net.minecraft.world.World
object PeripheralProvider extends IPeripheralProvider {
def init() {
ComputerCraftAPI.registerPeripheralProvider(this)
}
override def getPeripheral(world: World, x: Int, y: Int, z: Int, side: Int) = world.getTileEntity(x, y, z) match {
case switch: Switch => new SwitchPeripheral(switch)
case _ => null
}
}