9
0
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:
jhqwqmc
2025-04-26 21:04:07 +08:00
parent 9182acbe79
commit f4c5d2d1cd
3 changed files with 620 additions and 614 deletions

View File

@@ -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) {

View File

@@ -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) {
}