SteamWar/SpigotCore
Archiviert
13
0

Hotfix tinyprotocol

Dieser Commit ist enthalten in:
Lixfel 2021-09-14 21:04:38 +02:00
Ursprung 5017809c7e
Commit 2f91da922f

Datei anzeigen

@ -42,7 +42,16 @@ public abstract class TinyProtocol {
private static final Class<Object> serverConnectionClass = Reflection.getUntypedClass("{nms}.ServerConnection");
private static final FieldAccessor<Object> getMinecraftServer = Reflection.getField("{obc}.CraftServer", minecraftServerClass, 0);
private static final FieldAccessor<Object> getServerConnection = Reflection.getField(minecraftServerClass, serverConnectionClass, 0);
private static final MethodInvoker getNetworkMarkers = Reflection.getTypedMethod(serverConnectionClass, null, List.class, serverConnectionClass);
private static final MethodInvoker getNetworkMarkers;
static {
MethodInvoker networkMarkers;
try {
networkMarkers = Reflection.getTypedMethod(serverConnectionClass, null, List.class, serverConnectionClass);
} catch (IllegalStateException e) {
networkMarkers = Reflection.getTypedMethod(serverConnectionClass, null, Queue.class, serverConnectionClass);
}
getNetworkMarkers = networkMarkers;
}
// Packets we have to intercept
private static final Class<?> PACKET_LOGIN_IN_START = Reflection.getMinecraftClass("PacketLoginInStart");