Class CraftBukkitReflection
java.lang.Object
cloud.commandframework.bukkit.internal.CraftBukkitReflection
Utilities for doing reflection on CraftBukkit, used by the cloud implementation.
This is not API to any extent, and as such, may break, change, or be removed without any notice.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanclassExists(@NonNull String className) static @Nullable Class<?>static @Nullable Fieldstatic @Nullable Class<?>findMCClass(@NonNull String name) static @Nullable MethodfindMethod(@NonNull Class<?> holder, @NonNull String name, @NonNull Class<?>... params) static @Nullable Class<?>findNMSClass(@NonNull String className) static @Nullable Class<?>findOBCClass(@NonNull String className) static <T> @Nullable TfirstNonNullOrNull(@Nullable T @NonNull ... elements) static <T> @NonNull TfirstNonNullOrThrow(@NonNull Supplier<@NonNull String> errorMessage, @Nullable T @NonNull ... elements) static @NonNull Class<?>static @NonNull Constructor<?>needConstructor(@NonNull Class<?> holder, @NonNull Class<?>... parameters) static @NonNull Fieldstatic @NonNull Class<?>needMCClass(@NonNull String name) static @NonNull MethodneedMethod(@NonNull Class<?> holder, @NonNull String name, @NonNull Class<?>... params) static @NonNull Class<?>needNMSClass(@NonNull String className) static @NonNull Class<?>needNMSClassOrElse(@NonNull String nms, @NonNull String... classNames) static @NonNull Class<?>needOBCClass(@NonNull String className) streamMethods(@NonNull Class<?> clazz)
-
Field Details
-
MAJOR_REVISION
public static final int MAJOR_REVISION
-
-
Method Details
-
firstNonNullOrNull
-
firstNonNullOrThrow
@SafeVarargs public static <T> @NonNull T firstNonNullOrThrow(@NonNull Supplier<@NonNull String> errorMessage, @Nullable T @NonNull ... elements) -
needNMSClassOrElse
public static @NonNull Class<?> needNMSClassOrElse(@NonNull String nms, @NonNull String... classNames) throws RuntimeException - Throws:
RuntimeException
-
needMCClass
- Throws:
RuntimeException
-
needNMSClass
- Throws:
RuntimeException
-
needOBCClass
- Throws:
RuntimeException
-
findMCClass
- Throws:
RuntimeException
-
findNMSClass
- Throws:
RuntimeException
-
findOBCClass
- Throws:
RuntimeException
-
needClass
- Throws:
RuntimeException
-
findClass
-
needField
public static @NonNull Field needField(@NonNull Class<?> holder, @NonNull String name) throws RuntimeException - Throws:
RuntimeException
-
findField
public static @Nullable Field findField(@NonNull Class<?> holder, @NonNull String name) throws RuntimeException - Throws:
RuntimeException
-
needConstructor
public static @NonNull Constructor<?> needConstructor(@NonNull Class<?> holder, @NonNull Class<?>... parameters) -
classExists
-
findMethod
public static @Nullable Method findMethod(@NonNull Class<?> holder, @NonNull String name, @NonNull Class<?>... params) throws RuntimeException - Throws:
RuntimeException
-
needMethod
public static @NonNull Method needMethod(@NonNull Class<?> holder, @NonNull String name, @NonNull Class<?>... params) throws RuntimeException - Throws:
RuntimeException
-
streamMethods
-