Class AbstractPacket

java.lang.Object
ru.cwcode.cwutils.protocol.wrapper.AbstractPacket

public abstract class AbstractPacket extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.comphenix.protocol.events.PacketContainer
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractPacket(com.comphenix.protocol.events.PacketContainer handle, com.comphenix.protocol.PacketType type)
    Constructs a new strongly typed wrapper for the given packet.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Send the current packet to all online players.
    com.comphenix.protocol.events.PacketContainer
    Retrieve a handle to the raw packet data.
    void
    receivePacket(org.bukkit.entity.Player sender)
    Simulate receiving the current packet from the given sender.
    void
    recievePacket(org.bukkit.entity.Player sender)
    Deprecated.
    Misspelled. recieve to receive
    void
    sendPacket(org.bukkit.entity.Player receiver)
    Send the current packet to the given receiver.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • handle

      protected com.comphenix.protocol.events.PacketContainer handle
  • Constructor Details

    • AbstractPacket

      protected AbstractPacket(com.comphenix.protocol.events.PacketContainer handle, com.comphenix.protocol.PacketType type)
      Constructs a new strongly typed wrapper for the given packet.
      Parameters:
      handle - - handle to the raw packet data.
      type - - the packet type.
  • Method Details

    • getHandle

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

      public void sendPacket(org.bukkit.entity.Player receiver)
      Send the current packet to the given receiver.
      Parameters:
      receiver - - the receiver.
      Throws:
      RuntimeException - If the packet cannot be sent.
    • broadcastPacket

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

      @Deprecated public void recievePacket(org.bukkit.entity.Player sender)
      Deprecated.
      Misspelled. recieve to receive
      Simulate receiving the current packet from the given sender.
      Parameters:
      sender - - the sender.
      Throws:
      RuntimeException - If the packet cannot be received.
      See Also:
    • receivePacket

      public void receivePacket(org.bukkit.entity.Player sender)
      Simulate receiving the current packet from the given sender.
      Parameters:
      sender - - the sender.
      Throws:
      RuntimeException - if the packet cannot be received.