Class AbstractPacket
java.lang.Object
ru.cwcode.cwutils.protocol.wrapper.AbstractPacket
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPacket(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 TypeMethodDescriptionvoidSend the current packet to all online players.com.comphenix.protocol.events.PacketContainerRetrieve a handle to the raw packet data.voidreceivePacket(org.bukkit.entity.Player sender) Simulate receiving the current packet from the given sender.voidrecievePacket(org.bukkit.entity.Player sender) Deprecated.Misspelled. recieve to receivevoidsendPacket(org.bukkit.entity.Player receiver) Send the current packet to the given receiver.
-
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.Misspelled. recieve to receiveSimulate 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.
-