public class PacketProcessor
extends java.lang.Object
This class is mainly used to send packets, but it can also be used to retreive ping or other things.
Reflection| Constructor and Description |
|---|
PacketProcessor(@NotNull Reflection reflection)
Creates instance of the packet processor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.invoke.MethodHandle |
getGetHandleHandle() |
int |
getPing(@NotNull org.bukkit.entity.Player player)
Gets ping of a player
|
java.lang.invoke.MethodHandle |
getPingHandle() |
java.lang.Object |
getPlayerConnection(@NotNull org.bukkit.entity.Player player)
Gets player connection of a player used to send packets or other things.
|
java.lang.invoke.MethodHandle |
getPlayerConnectionHandle() |
Reflection |
getReflection() |
java.lang.invoke.MethodHandle |
getSendPacketHandle() |
boolean |
sendPacket(@NotNull org.bukkit.entity.Player player,
@NotNull java.lang.Object packet)
Sends packet to a player
|
public PacketProcessor(@NotNull
@NotNull Reflection reflection)
throws java.lang.IllegalArgumentException
reflection - Reflection this packet processor should use.java.lang.IllegalArgumentException - If the reflection is invalid.public boolean sendPacket(@NotNull
@NotNull org.bukkit.entity.Player player,
@NotNull
@NotNull java.lang.Object packet)
player - the playerpacket - the packetpublic java.lang.Object getPlayerConnection(@NotNull
@NotNull org.bukkit.entity.Player player)
throws java.lang.IllegalStateException
player - the playerjava.lang.IllegalStateException - if something went wrongpublic int getPing(@NotNull
@NotNull org.bukkit.entity.Player player)
player - the playerjava.lang.IllegalStateException - if something went wrongpublic java.lang.invoke.MethodHandle getGetHandleHandle()
public java.lang.invoke.MethodHandle getPlayerConnectionHandle()
public java.lang.invoke.MethodHandle getSendPacketHandle()
public java.lang.invoke.MethodHandle getPingHandle()
public Reflection getReflection()