类 PCP.AbstractPacket

    • 字段概要

      字段 
      修饰符和类型 字段 说明
      protected com.comphenix.protocol.events.PacketContainer handle  
    • 构造器概要

      构造器 
      限定符 构造器 说明
      protected AbstractPacket​(com.comphenix.protocol.events.PacketContainer handle, com.comphenix.protocol.PacketType type)
      Constructs a new strongly typed wrapper for the given packet.
    • 字段详细资料

      • handle

        protected com.comphenix.protocol.events.PacketContainer handle
    • 构造器详细资料

      • AbstractPacket

        protected AbstractPacket​(com.comphenix.protocol.events.PacketContainer handle,
                                 com.comphenix.protocol.PacketType type)
        Constructs a new strongly typed wrapper for the given packet.
        参数:
        handle - - handle to the raw packet data.
        type - - the packet type.
    • 方法详细资料

      • getHandle

        public com.comphenix.protocol.events.PacketContainer getHandle()
        Retrieve a handle to the raw packet data.
        返回:
        Raw packet data.
      • sendPacket

        public void sendPacket​(Player receiver)
        Send the current packet to the given receiver.
        参数:
        receiver - - the receiver.
        抛出:
        RuntimeException - If the packet cannot be sent.
      • broadcastPacket

        public void broadcastPacket()
        Send the current packet to all online players.
      • recievePacket

        @Deprecated
        public void recievePacket​(Player sender)
        已过时。
        Misspelled. recieve to receive
        Simulate receiving the current packet from the given sender.
        参数:
        sender - - the sender.
        抛出:
        RuntimeException - If the packet cannot be received.
        另请参阅:
        receivePacket(Player)
      • receivePacket

        public void receivePacket​(Player sender)
        Simulate receiving the current packet from the given sender.
        参数:
        sender - - the sender.
        抛出:
        RuntimeException - if the packet cannot be received.