mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-03 14:22:25 +00:00
refactor(core): 重构反射
This commit is contained in:
@@ -75,8 +75,8 @@ public final class BukkitReflectionUtils {
|
||||
}
|
||||
|
||||
public static Class<?> findReobfOrMojmapClass(String reobf, String mojmap, Function<String, String> classDecorator) {
|
||||
if (VersionHelper.isMojmap()) return ReflectionUtils.getClazz(classDecorator.apply(reobf));
|
||||
else return ReflectionUtils.getClazz(classDecorator.apply(mojmap));
|
||||
if (VersionHelper.isMojmap()) return ReflectionUtils.getClazz(classDecorator.apply(mojmap));
|
||||
else return ReflectionUtils.getClazz(classDecorator.apply(reobf));
|
||||
}
|
||||
|
||||
public static Class<?> findReobfOrMojmapClass(List<String> reobf, String mojmap) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -67,7 +67,7 @@ public class VersionHelper {
|
||||
private static boolean checkMojMap() {
|
||||
// Check if the server is Mojmap
|
||||
try {
|
||||
Class.forName("net.minecraft.network.protocol.game.ClientboundBossEventPacket");
|
||||
Class.forName("net.neoforged.art.internal.RenamerImpl");
|
||||
return true;
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user