Package com.comphenix.protocol.utility
Class MinecraftFields
java.lang.Object
com.comphenix.protocol.utility.MinecraftFields
Retrieve the content of well-known fields in Minecraft.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectgetNetworkManager(org.bukkit.entity.Player player) Retrieve the network manager associated with a particular player.static ObjectgetPlayerConnection(Object nmsPlayer) Retrieve the PlayerConnection (or NetServerHandler) associated with a player.static ObjectgetPlayerConnection(org.bukkit.entity.Player player) Retrieve the PlayerConnection (or NetServerHandler) associated with a player.static ObjectgetPlayerFromConnection(Object playerConnection) Retrieves the EntityPlayer player field from a PlayerConnection.
-
Method Details
-
getNetworkManager
Retrieve the network manager associated with a particular player.- Parameters:
player- - the player.- Returns:
- The network manager, or NULL if no network manager has been associated yet.
-
getPlayerConnection
Retrieve the PlayerConnection (or NetServerHandler) associated with a player.- Parameters:
player- - the player.- Returns:
- The player connection.
-
getPlayerConnection
Retrieve the PlayerConnection (or NetServerHandler) associated with a player.- Parameters:
nmsPlayer- - the NMS player.- Returns:
- The player connection.
-
getPlayerFromConnection
Retrieves the EntityPlayer player field from a PlayerConnection.- Parameters:
playerConnection- The PlayerConnection object from which to retrieve the EntityPlayer field.- Returns:
- The value of the EntityPlayer field in the PlayerConnection.
-