public class PingEvent
extends java.lang.Object
Constructor and Description |
---|
PingEvent(PingReply reply)
Created a new PingEvent instance
|
Modifier and Type | Method and Description |
---|---|
void |
cancelPong(boolean cancel)
Prevents the PacketStatusOutPong packet from being sent
The PacketStatusOutPong packet closes the connection and must be cancelled to create animations
|
ServerInfoPacket |
createNewPacket(PingReply reply)
Creates a new ServerInfoPacket from a PingReply instance
|
PingReply |
getReply()
Returns the PingReply instance
|
boolean |
isCancelled()
Returns whether the event has been cancelled
|
boolean |
isPongCancelled()
Returns whether the PacketStatusOutPong packet has been cancelled
|
void |
sendPong()
Sends a pong packet to the client which closes the connection
The pong packet changes the icon to the right of the player count from red to green
|
void |
setCancelled(boolean cancel)
Cancels the event
|
public PingEvent(PingReply reply)
reply
- The replypublic PingReply getReply()
public void setCancelled(boolean cancel)
cancel
- A booleanpublic void cancelPong(boolean cancel)
cancel
- A booleanpublic boolean isCancelled()
public boolean isPongCancelled()
public ServerInfoPacket createNewPacket(PingReply reply)
reply
- The replypublic void sendPong()