Class ScheduledPacket

java.lang.Object
com.comphenix.protocol.events.ScheduledPacket

public class ScheduledPacket extends Object
Represents a packet that is scheduled for transmission at a later stage.
  • Field Details

    • packet

      protected PacketContainer packet
    • target

      protected org.bukkit.entity.Player target
    • filtered

      protected boolean filtered
  • Constructor Details

    • ScheduledPacket

      public ScheduledPacket(PacketContainer packet, org.bukkit.entity.Player target, boolean filtered)
      Construct a new scheduled packet.

      Note that the sender is infered from the packet type.

      Parameters:
      packet - - the packet.
      target - - the target player.
      filtered - - whether or not to
  • Method Details

    • fromSilent

      public static ScheduledPacket fromSilent(PacketContainer packet, org.bukkit.entity.Player target)
      Construct a new scheduled packet that will not be processed by any packet listeners (except MONITOR).
      Parameters:
      packet - - the packet.
      target - - the target player.
      Returns:
      The scheduled packet.
    • fromFiltered

      public static ScheduledPacket fromFiltered(PacketContainer packet, org.bukkit.entity.Player target)
      Construct a new scheduled packet that will be processed by any packet listeners.
      Parameters:
      packet - - the packet.
      target - - the target player.
      Returns:
      The scheduled packet.
    • getPacket

      public PacketContainer getPacket()
      Retrieve the packet that will be sent or transmitted.
      Returns:
      The sent or received packet.
    • setPacket

      public void setPacket(PacketContainer packet)
      Set the packet that will be sent or transmitted.
      Parameters:
      packet - - the new packet, cannot be NULL.
    • getTarget

      public org.bukkit.entity.Player getTarget()
      Retrieve the target player.
      Returns:
      The target player.
    • setTarget

      public void setTarget(org.bukkit.entity.Player target)
      Set the target player.
      Parameters:
      target - - the new target, cannot be NULL.
    • isFiltered

      public boolean isFiltered()
      Determine if this packet will be processed by any of the packet listeners.
      Returns:
      TRUE if it will, FALSE otherwise.
    • setFiltered

      public void setFiltered(boolean filtered)
      Set whether or not this packet will be processed by packet listeners (except MONITOR listeners).
      Parameters:
      filtered - - TRUE if it should be processed by listeners, FALSE otherwise.
    • getSender

      public PacketType.Sender getSender()
      Retrieve the sender of this packet.
      Returns:
      The sender.
    • schedule

      public void schedule()
      Schedule the packet transmission or reception.
    • schedule

      public void schedule(PacketStream stream)
      Schedule the packet transmission or reception.
      Parameters:
      stream - - the packet stream.
    • toString

      public String toString()
      Overrides:
      toString in class Object