3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 08:30:09 +01:00
Dieser Commit ist enthalten in:
Nassim Jahnke 2023-03-15 16:21:15 +01:00
Ursprung 81c4e530e9
Commit da7f8ea3b6
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -49,9 +49,6 @@ public class JoinListener implements Listener {
conn = findField(gh.getReturnType(), "PlayerConnection", "ServerGamePacketListenerImpl"); conn = findField(gh.getReturnType(), "PlayerConnection", "ServerGamePacketListenerImpl");
nm = findField(conn.getType(), "NetworkManager", "Connection"); nm = findField(conn.getType(), "NetworkManager", "Connection");
ch = findField(nm.getType(), "Channel"); ch = findField(nm.getType(), "Channel");
if (!Modifier.isPublic(nm.getModifiers())) {
nm.setAccessible(true);
}
} catch (NoSuchMethodException | NoSuchFieldException | ClassNotFoundException e) { } catch (NoSuchMethodException | NoSuchFieldException | ClassNotFoundException e) {
Via.getPlatform().getLogger().log( Via.getPlatform().getLogger().log(
Level.WARNING, Level.WARNING,
@ -70,6 +67,9 @@ public class JoinListener implements Listener {
for (Field field : cl.getDeclaredFields()) { for (Field field : cl.getDeclaredFields()) {
for (String type : types) { for (String type : types) {
if (field.getType().getSimpleName().equals(type)) { if (field.getType().getSimpleName().equals(type)) {
if (!Modifier.isPublic(field.getModifiers())) {
field.setAccessible(true);
}
return field; return field;
} }
} }