public class MinecraftReflection extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
MINECRAFT_OBJECT
Deprecated.
|
static ReportType |
REPORT_CANNOT_FIND_MCPC_REMAPPER |
static ReportType |
REPORT_CANNOT_LOAD_CPC_REMAPPER |
static ReportType |
REPORT_NON_CRAFTBUKKIT_LIBRARY_PACKAGE |
| Modifier and Type | Method and Description |
|---|---|
static Class<?> |
getArrayClass(Class<?> componentType)
Retrieve the array class of a given component type.
|
static Class<?> |
getAttributeModifierClass()
Retrieve the attribute modifier class.
|
static Class<?> |
getAttributeSnapshotClass()
Retrieve the attribute snapshot class.
|
static Class<?> |
getBlockClass()
Retrieve the Block (NMS) class.
|
static Class<?> |
getBlockPositionClass()
Retrieves the BlockPosition class.
|
static Object |
getBukkitEntity(Object nmsObject)
Dynamically retrieve the Bukkit entity from a given entity.
|
static org.bukkit.inventory.ItemStack |
getBukkitItemStack(Object generic)
Retrieves the Bukkit equivalent of a NMS ItemStack.
|
static Class<?> |
getByteBufClass() |
static Class<?> |
getChatComponentTextClass()
Retrieve the NMS chat component text class.
|
static Class<?> |
getChatSerializerClass()
Attempt to find the ChatSerializer class.
|
static Class<?> |
getChunkCoordinatesClass()
Retrieve the ChunkCoordinates class.
|
static Class<?> |
getChunkCoordIntPair()
Retrieve the ChunkCoordIntPair class.
|
static Class<?> |
getChunkPositionClass()
Retrieves the ChunkPosition class.
|
static Class<?> |
getCraftBukkitClass(String className)
Retrieve the class object of a specific CraftBukkit class.
|
static String |
getCraftBukkitPackage()
Retrieve the name of the root CraftBukkit package.
|
static Class<?> |
getCraftChatMessage()
Retrieve the CraftChatMessage in Minecraft 1.7.2.
|
static Class<?> |
getCraftEntityClass()
Retrieve the CraftEntity class.
|
static Class<?> |
getCraftItemStackClass()
Retrieve the CraftItemStack class.
|
static Class<?> |
getCraftMessageClass()
Retrieve the CraftChatMessage introduced in 1.7.2
|
static Class<?> |
getCraftPlayerClass()
Retrieve the CraftPlayer class.
|
static Class<?> |
getCraftSoundClass() |
static Class<?> |
getCraftWorldClass()
Retrieve the CraftWorld class.
|
static Class<?> |
getDataWatcherClass()
Retrieve the DataWatcher class.
|
static Class<?> |
getDataWatcherItemClass()
Retrieve the DataWatcher Item class.
|
static Class<?> |
getDataWatcherObjectClass() |
static Class<?> |
getDataWatcherRegistryClass() |
static Class<?> |
getDataWatcherSerializerClass() |
static Class<?> |
getEntityClass()
Retrieve the entity (NMS) class.
|
static Class<?> |
getEntityHumanClass()
Retrieve the EntityHuman class.
|
static Class<?> |
getEntityPlayerClass()
Retrieve the EntityPlayer (NMS) class.
|
static Class<?> |
getEntityTrackerClass()
Retrieve the EntityTracker (NMS) class.
|
static Class<?> |
getEnumProtocolClass()
Retrieve the EnumProtocol class in 1.7.2.
|
static Class<?> |
getGameProfileClass()
Retrieve the GameProfile class in 1.7.2 and later.
|
static Class<?> |
getIBlockDataClass()
Retrieve the IBlockData class in 1.8.
|
static Class<?> |
getIChatBaseComponentArrayClass() |
static Class<?> |
getIChatBaseComponentClass()
Retrieve the IChatBaseComponent class.
|
static Class<?> |
getIntHashMapClass()
Retrieve the IntHashMap class.
|
static Class<?> |
getItemStackArrayClass()
Retrieve the ItemStack[] class.
|
static Class<?> |
getItemStackClass()
Retrieve the NMS ItemStack class.
|
static Class<?> |
getMinecraftClass(String className)
Retrieve the class object of a specific Minecraft class.
|
static Class<?> |
getMinecraftClass(String className,
String... aliases)
Retrieve the first class that matches a specified Minecraft name.
|
static Class<?> |
getMinecraftGsonClass()
Retrieve the Gson class used by Minecraft.
|
static Object |
getMinecraftItemStack(org.bukkit.inventory.ItemStack specific)
Retrieves the NMS equivalent of a Bukkit ItemStack.
|
static Class<?> |
getMinecraftKeyClass() |
static Class<?> |
getMinecraftLibraryClass(String className)
Retrieve the class object of a specific Minecraft library class.
|
static AbstractFuzzyMatcher<Class<?>> |
getMinecraftObjectMatcher()
Retrieve a abstract fuzzy class matcher for Minecraft objects.
|
static String |
getMinecraftObjectRegex()
Retrieve a regular expression that can match Minecraft package objects.
|
static String |
getMinecraftPackage()
Retrieve the name of the Minecraft server package.
|
static Class<?> |
getMinecraftServerClass()
Retrieve the MinecraftServer class.
|
static Class<?> |
getMobEffectClass()
Retrieve the net.minecraft.server.MobEffect class.
|
static Class<?> |
getMobEffectListClass() |
static Class<?> |
getMultiBlockChangeInfoArrayClass()
Retrieve the MultiBlockChangeInfo array class in 1.8.
|
static Class<?> |
getMultiBlockChangeInfoClass()
Retrieve the MultiBlockChangeInfo class in 1.8.
|
static Class<?> |
getNBTBaseClass()
Retrieve the NBT base class.
|
static Class<?> |
getNBTCompoundClass()
Retrieve the NBT Compound class.
|
static Class<?> |
getNbtCompressedStreamToolsClass()
Retrieve the NBTCompressedStreamTools class.
|
static Class<?> |
getNBTReadLimiterClass()
Retrieve the NBT read limiter class.
|
static Class<?> |
getNetHandlerClass()
Retrieve the NetHandler class (or Connection)
|
static Class<?> |
getNetLoginHandlerClass()
Retrieve the NetLoginHandler class (or PendingConnection)
|
static String |
getNetLoginHandlerName()
Dynamically retrieve the name of the current NetLoginHandler.
|
static Class<?> |
getNetworkListenThreadClass()
Retrieve the NetworkListenThread class (NMS).
|
static Class<?> |
getNetworkManagerClass()
Retrieve the NetworkManager class or its interface.
|
static String |
getNetworkManagerName()
Dynamically retrieve the NetworkManager name.
|
static Class<?> |
getNmsWorldClass()
Retrieve the World (NMS) class.
|
static Class<?> |
getNonNullListClass() |
static String |
getPackageVersion()
Retrieve the package version of the underlying CraftBukkit server.
|
static Class<?> |
getPacketClass()
Retrieve the packet class.
|
static Object |
getPacketDataSerializer(Object buffer)
Retrieve an instance of the packet data serializer wrapper.
|
static Class<?> |
getPacketDataSerializerClass()
Retrieve the packet data serializer class that overrides ByteBuf.
|
static Class<?> |
getPlayerConnectionClass()
Retrieve the PlayerConnection class (or NetServerHandler)
|
static Class<?> |
getPlayerInfoDataClass()
Retrieve the PlayerInfoData class in 1.8.
|
static Class<?> |
getPlayerListClass()
Retrieve the player list class (or ServerConfigurationManager),
|
static Class<?> |
getServerConnectionClass()
Retrieve the ServerConnection abstract class.
|
static Class<?> |
getServerPingClass()
Retrieve the ServerPing class in Minecraft 1.7.2.
|
static Class<?> |
getServerPingPlayerSampleClass()
Retrieve the ServerPingPlayerSample class in Minecraft 1.7.2.
|
static Class<?> |
getServerPingServerDataClass()
Retrieve the ServerPingServerData class in Minecraft 1.7.2.
|
static Class<?> |
getSoundEffectClass() |
static Class<?> |
getStatisticClass()
Retrieve the NMS statistics class.
|
static Class<?> |
getStatisticListClass()
Retrieve the NMS statistic list class.
|
static Class<?> |
getTileEntityClass()
Retrieve the NMS tile entity class.
|
static Class<?> |
getVec3DClass()
Retrieves the Vec3D class.
|
static Class<?> |
getWatchableObjectClass()
Deprecated.
Replaced by
getDataWatcherItemClass() |
static Class<?> |
getWorldServerClass()
Retrieve the WorldServer (NMS) class.
|
static Class<?> |
getWorldTypeClass()
Retrieve the WorldType class.
|
static boolean |
is(Class<?> clazz,
Object object)
Determine if a given Object is compatible with a given Class.
|
static boolean |
isBlockPosition(Object obj)
Determine if a given object is a BlockPosition.
|
static boolean |
isChunkCoordinates(Object obj)
Determine if a given object is a ChunkCoordinate.
|
static boolean |
isChunkCoordIntPair(Object obj)
Determine if the given object is an NMS ChunkCoordIntPar.
|
static boolean |
isChunkPosition(Object obj)
Determine if a given object is a ChunkPosition.
|
static boolean |
isCraftItemStack(Object obj)
Determine if the given object is a CraftItemStack instancey.
|
static boolean |
isCraftPlayer(Object value)
Determine if the given object is a CraftPlayer class.
|
static boolean |
isDataWatcher(Object obj)
Determine if the given object is a data watcher object.
|
static boolean |
isIntHashMap(Object obj)
Determine if the given object is an IntHashMap object.
|
static boolean |
isItemStack(Object value)
Determine if the given object is a NMS ItemStack.
|
static boolean |
isLoginHandler(Object obj)
Determine if the given object is a NetLoginHandler (PendingConnection)
|
static boolean |
isMinecraftClass(Class<?> clazz)
Determine if the given class is found within the package net.minecraft.server, or any equivalent package.
|
static boolean |
isMinecraftEntity(Object obj)
Determine if the given object is actually a Minecraft packet.
|
static boolean |
isMinecraftObject(Object obj)
Determine if a given object can be found within the package net.minecraft.server.
|
static boolean |
isMinecraftObject(Object obj,
String className)
Determine if a given object is found in net.minecraft.server, and has the given name.
|
static boolean |
isMinecraftPlayer(Object obj)
Determine if the given object is a Minecraft player entity.
|
static boolean |
isPacketClass(Object obj)
Determine if the given object is actually a Minecraft packet.
|
static boolean |
isPlayerInfoData(Object obj)
Determine if the given object is a PlayerInfoData.
|
static boolean |
isServerHandler(Object obj)
Determine if the given object is assignable to a NetServerHandler (PlayerConnection)
|
static boolean |
isUsingNetty()
Determine if this Minecraft version is using Netty.
|
static boolean |
isWatchableObject(Object obj)
Determine if the given object is a watchable object.
|
static void |
setMinecraftPackage(String minecraftPackage,
String craftBukkitPackage)
Used during debugging and testing.
|
static boolean |
signUpdateExists() |
static boolean |
watcherObjectExists() |
public static final ReportType REPORT_CANNOT_FIND_MCPC_REMAPPER
public static final ReportType REPORT_CANNOT_LOAD_CPC_REMAPPER
public static final ReportType REPORT_NON_CRAFTBUKKIT_LIBRARY_PACKAGE
@Deprecated public static final String MINECRAFT_OBJECT
Replaced by the method getMinecraftObjectRegex().
public static String getMinecraftObjectRegex()
public static AbstractFuzzyMatcher<Class<?>> getMinecraftObjectMatcher()
public static String getMinecraftPackage()
public static String getPackageVersion()
public static void setMinecraftPackage(String minecraftPackage, String craftBukkitPackage)
minecraftPackage - - the current Minecraft package.craftBukkitPackage - - the current CraftBukkit package.public static String getCraftBukkitPackage()
public static Object getBukkitEntity(Object nmsObject)
nmsObject - - the NMS entity.RuntimeException - If we were unable to retrieve the Bukkit entity.public static boolean isMinecraftObject(@Nonnull Object obj)
obj - - the object to test.public static boolean isMinecraftClass(@Nonnull Class<?> clazz)
clazz - - the class to test.public static boolean isMinecraftObject(@Nonnull Object obj, String className)
obj - - the object to test.className - - the class name to test.public static boolean is(Class<?> clazz, Object object)
clazz - Class to test for, may be nullobject - the Object to test, may be nullClass.isAssignableFrom(Class)public static boolean isChunkPosition(Object obj)
obj - - the object to test.public static boolean isBlockPosition(Object obj)
obj - - the object to test.public static boolean isChunkCoordIntPair(Object obj)
obj - - the object.public static boolean isChunkCoordinates(Object obj)
obj - - the object to test.public static boolean isPacketClass(Object obj)
obj - - the given object.public static boolean isLoginHandler(Object obj)
obj - - the given object.public static boolean isServerHandler(Object obj)
obj - - the given object.public static boolean isMinecraftEntity(Object obj)
obj - - the given object.public static boolean isItemStack(Object value)
value - - the given object.public static boolean isCraftPlayer(Object value)
value - - the given object.public static boolean isMinecraftPlayer(Object obj)
obj - - the given object.public static boolean isWatchableObject(Object obj)
obj - - the given object.public static boolean isDataWatcher(Object obj)
obj - - the given object.public static boolean isIntHashMap(Object obj)
obj - - the given object.public static boolean isCraftItemStack(Object obj)
obj - - the given object.public static Class<?> getEntityPlayerClass()
public static Class<?> getEntityHumanClass()
public static Class<?> getGameProfileClass()
IllegalStateException - If we are running 1.6.4 or earlier.public static Class<?> getEntityClass()
public static Class<?> getCraftChatMessage()
public static Class<?> getWorldServerClass()
public static Class<?> getNmsWorldClass()
public static Class<?> getPacketClass()
public static Class<?> getByteBufClass()
public static Class<?> getEnumProtocolClass()
public static Class<?> getIChatBaseComponentClass()
public static Class<?> getIChatBaseComponentArrayClass()
public static Class<?> getChatComponentTextClass()
public static Class<?> getChatSerializerClass()
IllegalStateException - If the class could not be found or deduced.public static Class<?> getServerPingClass()
public static Class<?> getServerPingServerDataClass()
public static Class<?> getServerPingPlayerSampleClass()
public static boolean isUsingNetty()
Spigot is ignored in this consideration.
public static Class<?> getMinecraftServerClass()
public static Class<?> getStatisticClass()
public static Class<?> getStatisticListClass()
public static Class<?> getPlayerListClass()
public static Class<?> getNetLoginHandlerClass()
public static Class<?> getPlayerConnectionClass()
public static Class<?> getNetworkManagerClass()
public static Class<?> getNetHandlerClass()
public static Class<?> getItemStackClass()
public static Class<?> getBlockClass()
public static Class<?> getWorldTypeClass()
public static Class<?> getDataWatcherClass()
public static Class<?> getChunkPositionClass()
public static Class<?> getBlockPositionClass()
public static Class<?> getVec3DClass()
public static Class<?> getChunkCoordinatesClass()
public static Class<?> getChunkCoordIntPair()
@Deprecated public static Class<?> getWatchableObjectClass()
getDataWatcherItemClass()public static Class<?> getDataWatcherItemClass()
public static Class<?> getDataWatcherObjectClass()
public static boolean watcherObjectExists()
public static Class<?> getDataWatcherSerializerClass()
public static Class<?> getDataWatcherRegistryClass()
public static Class<?> getMinecraftKeyClass()
public static Class<?> getMobEffectListClass()
public static Class<?> getSoundEffectClass()
public static Class<?> getServerConnectionClass()
public static Class<?> getNBTBaseClass()
public static Class<?> getNBTReadLimiterClass()
This is only supported in 1.7.8 (released 2014) and higher.
public static Class<?> getNBTCompoundClass()
public static Class<?> getEntityTrackerClass()
public static Class<?> getNetworkListenThreadClass()
Note that this class was removed after Minecraft 1.3.1.
public static Class<?> getAttributeSnapshotClass()
This stores the final value of an attribute, along with all the associated computational steps.
public static Class<?> getIntHashMapClass()
public static Class<?> getAttributeModifierClass()
public static Class<?> getMobEffectClass()
public static Class<?> getPacketDataSerializerClass()
public static Class<?> getNbtCompressedStreamToolsClass()
public static Class<?> getTileEntityClass()
public static Class<?> getMinecraftGsonClass()
public static Class<?> getItemStackArrayClass()
public static Class<?> getArrayClass(Class<?> componentType)
componentType - - type of each element in the array.public static Class<?> getCraftItemStackClass()
public static Class<?> getCraftPlayerClass()
public static Class<?> getCraftWorldClass()
public static Class<?> getCraftEntityClass()
public static Class<?> getCraftMessageClass()
public static Class<?> getPlayerInfoDataClass()
public static boolean isPlayerInfoData(Object obj)
obj - - the given object.public static Class<?> getIBlockDataClass()
public static Class<?> getMultiBlockChangeInfoClass()
public static Class<?> getMultiBlockChangeInfoArrayClass()
public static boolean signUpdateExists()
public static Class<?> getNonNullListClass()
public static Class<?> getCraftSoundClass()
public static org.bukkit.inventory.ItemStack getBukkitItemStack(Object generic)
generic - NMS ItemStackpublic static Object getMinecraftItemStack(org.bukkit.inventory.ItemStack specific)
specific - Bukkit ItemStackpublic static Class<?> getCraftBukkitClass(String className)
className - - the specific CraftBukkit class.RuntimeException - If we are unable to find the given class.public static Class<?> getMinecraftClass(String className)
className - - the specific Minecraft class.RuntimeException - If we are unable to find the given class.public static Class<?> getMinecraftClass(String className, String... aliases)
className - - the specific Minecraft class.aliases - - alternative names for this Minecraft class.RuntimeException - If we are unable to find any of the given classes.public static Class<?> getMinecraftLibraryClass(String className)
className - - the specific library Minecraft class.RuntimeException - If we are unable to find the given class.public static String getNetworkManagerName()
public static String getNetLoginHandlerName()
Copyright © 2012–2017 Comphenix and dmulloy2. Licensed under the GNU GPL v2.