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 boolean |
addPlayer(org.bukkit.entity.Player recipient,
org.bukkit.entity.Player subject)
Adds
subject to recipient 's tablist. |
static boolean |
addPlayers(org.bukkit.entity.Player recipient,
java.util.Collection<? extends org.bukkit.entity.Player> subjects)
Adds each player from
subjects to recipient 's
tablist. |
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.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 boolean |
removePlayer(org.bukkit.entity.Player recipient,
org.bukkit.entity.Player subject)
Removes
subject from recipient 's tablist. |
static boolean |
removePlayers(org.bukkit.entity.Player recipient,
java.util.Collection<? extends org.bukkit.entity.Player> subjects)
Removes each player from
subjects from
recipient 's tablist. |
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 boolean addPlayers(org.bukkit.entity.Player recipient, java.util.Collection<? extends org.bukkit.entity.Player> subjects)
subjects
to recipient
's
tablist.recipient
- the player whose tablist will be modifiedsubjects
- the players added to the tablistpublic static boolean addPlayer(org.bukkit.entity.Player recipient, org.bukkit.entity.Player subject)
subject
to recipient
's tablist.recipient
- the player whose tablist will be modifiedsubject
- the player added to the tablistpublic static boolean removePlayers(org.bukkit.entity.Player recipient, java.util.Collection<? extends org.bukkit.entity.Player> subjects)
subjects
from
recipient
's tablist.recipient
- the player whose tablist will be modifiedsubjects
- the players removed from the tablistpublic static boolean removePlayer(org.bukkit.entity.Player recipient, org.bukkit.entity.Player subject)
subject
from recipient
's tablist.recipient
- the player whose tablist will be modifiedsubject
- the player removed from the tablistpublic 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 void uninitialize()
java.lang.UnsupportedOperationException
- if MGLib is not currently disabling