public final class ServerReflection extends Object
Internal classes within the Minecraft server and CraftBukkit are relocated at build time to prevent developers from relying upon server internals. It is however sometimes useful to be able to interact with these classes (via reflection).
| Modifier and Type | Field and Description |
|---|---|
static String |
NMS
The nms prefix (without the version component)
|
static String |
OBC
The obc prefix (without the version component)
|
| Modifier and Type | Method and Description |
|---|---|
static NmsVersion |
getNmsVersion()
Gets the server "nms" version.
|
static String |
getServerVersion()
Gets the server "nms" version.
|
static String |
nms(String className)
Prepends the versioned
NMS prefix to the given class name |
static Class<?> |
nmsClass(String className)
Prepends the versioned
NMS prefix to the given class name |
static String |
obc(String className)
Prepends the versioned
OBC prefix to the given class name |
static Class<?> |
obcClass(String className)
Prepends the versioned
OBC prefix to the given class name |
public static final String NMS
public static final String OBC
@Nonnull public static String getServerVersion()
@Nonnull public static NmsVersion getNmsVersion()
@Nonnull public static String nms(String className)
NMS prefix to the given class nameclassName - the name of the class@Nonnull public static Class<?> nmsClass(String className) throws ClassNotFoundException
NMS prefix to the given class nameclassName - the name of the classClassNotFoundException@Nonnull public static String obc(String className)
OBC prefix to the given class nameclassName - the name of the class@Nonnull public static Class<?> obcClass(String className) throws ClassNotFoundException
OBC prefix to the given class nameclassName - the name of the classClassNotFoundExceptionCopyright © 2022. All rights reserved.