v2.7.8 Add 1.21.6 support

This commit is contained in:
nulli0n committed 2025-06-18 23:06:26 +05:00
1 parent 1321573296
commit 9257973247
8 files changed
+85 -36

No files matched your search

+2 -2
View File
@@ -6,7 +6,7 @@
<parent>
<groupId>su.nightexpress.nightcore</groupId>
<artifactId>nightcore</artifactId>
<version>2.7.7</version>
<version>2.7.8</version>
</parent>
<artifactId>bridge</artifactId>
@@ -35,7 +35,7 @@
<dependency>
<groupId>su.nightexpress.nightcore</groupId>
<artifactId>utils</artifactId>
<version>2.7.7</version>
<version>2.7.8</version>
</dependency>
</dependencies>
@@ -127,6 +127,11 @@ public class Reflex {
}
}
public static Object getFieldValue(@NotNull Object source, @NotNull String realName, @NotNull String obfName) {
Object byName = getFieldValue(source, realName);
return byName == null ? getFieldValue(source, obfName) : byName;
}
public static Object getFieldValue(@NotNull Object source, @NotNull String name) {
try {
Class<?> clazz = source instanceof Class<?> ? (Class<?>) source : source.getClass();
@@ -160,6 +165,11 @@ public class Reflex {
return false;
}
public static Method getMethod(@NotNull Class<?> source, @NotNull String realName, @NotNull String obfName, @NotNull Class<?>... params) {
Method byName = getMethod(source, realName, params);
return byName == null ? getMethod(source, obfName, params) : byName;
}
public static Method getMethod(@NotNull Class<?> source, @NotNull String name, @NotNull Class<?>... params) {
try {
return source.getDeclaredMethod(name, params);