public class Reflection
extends java.lang.Object
This class is used to get classes that contains version in their package names.
It's easy to use and straightforward. This class is also used in PacketProcessor to send packets.
| Constructor and Description |
|---|
Reflection()
Creates an instace by detecting the version
|
Reflection(java.lang.String version)
Creates an instance with the entered version
|
| Modifier and Type | Method and Description |
|---|---|
static @NotNull java.lang.String |
detectVersion()
Detects the version of this server for NMS or CraftBukkit classes
|
@Nullable java.lang.Class<?> |
getCraftClass(@NotNull java.lang.String path)
Gets a CraftBukkit (org.bukkit.craftbukkit) class
|
@Nullable java.lang.Class<?> |
getNMSClass(@NotNull java.lang.String path)
Gets a NMS (net.minecraft.server) class
|
public Reflection(java.lang.String version)
version - the version for the reflectionpublic Reflection()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the version could not be detected@NotNull
public static @NotNull java.lang.String detectVersion()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the version could not be detected@Nullable
public @Nullable java.lang.Class<?> getNMSClass(@NotNull
@NotNull java.lang.String path)
path - path (name) of the class@Nullable
public @Nullable java.lang.Class<?> getCraftClass(@NotNull
@NotNull java.lang.String path)
path - path (name) of the class