public class NmsUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.Object |
clientCommandPacketInstance |
static java.lang.reflect.Method |
craftPlayer_getHandle |
static boolean |
newOnlinePlayersMethod |
static java.lang.reflect.Field |
playerConnection |
static java.lang.reflect.Method |
playerConnection_a_packetPlayInClientCommand |
static java.lang.reflect.Method |
playerConnection_sendPacket |
static boolean |
SPECTATOR_SUPPORT |
Constructor and Description |
---|
NmsUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Class<?> |
getCraftClass(java.lang.String name)
Retrieves a class by the given name from the package
org.bukkit.craftbukkit . |
static java.lang.String |
getLocale(org.bukkit.entity.Player player)
Gets the current client locale of the given player.
|
static java.lang.Class<?> |
getNmsClass(java.lang.String name)
Retrieves a class by the given name from the package
net.minecraft.server . |
static java.util.Collection<? extends org.bukkit.entity.Player> |
getOnlinePlayers()
Version-independent getOnlinePlayers() method.
|
static void |
sendRespawnPacket(org.bukkit.entity.Player player)
Sends a PlayInClientCommand packet to the given player.
|
static void |
uninitialize()
Unsets all static objects in this class.
|
public static final boolean SPECTATOR_SUPPORT
public static java.lang.reflect.Method craftPlayer_getHandle
public static java.lang.reflect.Field playerConnection
public static java.lang.reflect.Method playerConnection_sendPacket
public static java.lang.reflect.Method playerConnection_a_packetPlayInClientCommand
public static java.lang.Object clientCommandPacketInstance
public static boolean newOnlinePlayersMethod
public static java.lang.Class<?> getNmsClass(java.lang.String name) throws java.lang.ClassNotFoundException
net.minecraft.server
.name
- the class to retrievenet.minecraft.server
java.lang.ClassNotFoundException
- if the class does not exist in the
packagepublic static java.lang.Class<?> getCraftClass(java.lang.String name) throws java.lang.ClassNotFoundException
org.bukkit.craftbukkit
.name
- the class to retrieveorg.bukkit.craftbukkit
java.lang.ClassNotFoundException
- if the class does not exist in the
packagepublic static void sendRespawnPacket(org.bukkit.entity.Player player) throws java.lang.Exception
player
- the Player
to send the packet tojava.lang.Exception
- if an exception occurs while sending the packetpublic static java.util.Collection<? extends org.bukkit.entity.Player> getOnlinePlayers()
public static java.lang.String getLocale(org.bukkit.entity.Player player)
player
- The player to get a locale frompublic static void uninitialize()
java.lang.UnsupportedOperationException
- if MGLib is not currently disabling