Package com.comphenix.protocol.events
Class ScheduledPacket
java.lang.Object
com.comphenix.protocol.events.ScheduledPacket
Represents a packet that is scheduled for transmission at a later stage.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected PacketContainerprotected org.bukkit.entity.Player -
Constructor Summary
ConstructorsConstructorDescriptionScheduledPacket(PacketContainer packet, org.bukkit.entity.Player target, boolean filtered) Construct a new scheduled packet. -
Method Summary
Modifier and TypeMethodDescriptionstatic ScheduledPacketfromFiltered(PacketContainer packet, org.bukkit.entity.Player target) Construct a new scheduled packet that will be processed by any packet listeners.static ScheduledPacketfromSilent(PacketContainer packet, org.bukkit.entity.Player target) Construct a new scheduled packet that will not be processed by any packet listeners (except MONITOR).Retrieve the packet that will be sent or transmitted.Retrieve the sender of this packet.org.bukkit.entity.PlayerRetrieve the target player.booleanDetermine if this packet will be processed by any of the packet listeners.voidschedule()Schedule the packet transmission or reception.voidschedule(PacketStream stream) Schedule the packet transmission or reception.voidsetFiltered(boolean filtered) Set whether or not this packet will be processed by packet listeners (except MONITOR listeners).voidsetPacket(PacketContainer packet) Set the packet that will be sent or transmitted.voidsetTarget(org.bukkit.entity.Player target) Set the target player.toString()
-
Field Details
-
packet
-
target
protected org.bukkit.entity.Player target -
filtered
protected boolean filtered
-
-
Constructor Details
-
ScheduledPacket
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
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
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
Retrieve the packet that will be sent or transmitted.- Returns:
- The sent or received packet.
-
setPacket
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
Retrieve the sender of this packet.- Returns:
- The sender.
-
schedule
public void schedule()Schedule the packet transmission or reception. -
schedule
Schedule the packet transmission or reception.- Parameters:
stream- - the packet stream.
-
toString
-