blob: ddf97dbbcd7fad70a000621bdb580fb1fb3d940c [file] [log] [blame] [raw]
package li.cil.oc.common.tileentity
import cpw.mods.fml.common.network.Player
import li.cil.oc.api.{INetworkNode, INetworkMessage}
class TileEntityKeyboard extends TileEntityRotatable with INetworkNode {
override def receive(message: INetworkMessage) = message.data match {
case Array(name: String, p: Player, c: Character) if name == "keyboard.keyDown" => {
// TODO check if player is close enough and only consume message if so
network.sendToAll(this, "signal", "key_down", c)
message.cancel()
None
}
case Array(name: String, p: Player, c: Character) if name == "keyboard.keyUp" => {
// TODO check if player is close enough and only consume message if so
network.sendToAll(this, "signal", "key_up", c)
message.cancel()
None
}
case _ => None
}
}