Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 00:22:51 +01:00
Fix SpongeViaInjector#getServerProtocolVersion()
for Sponge API-10+ (#3337)
Dieser Commit ist enthalten in:
Ursprung
28ba4afc27
Commit
bf825d5ef6
@ -32,7 +32,13 @@ public class SpongeViaInjector extends LegacyViaInjector {
|
||||
@Override
|
||||
public int getServerProtocolVersion() throws ReflectiveOperationException {
|
||||
MinecraftVersion version = Sponge.platform().minecraftVersion();
|
||||
|
||||
// 'protocolVersion' method was exposed to the API in a 1.19.4 build and 'getProtocol' no longer exists in the impl.
|
||||
try {
|
||||
return (int) version.getClass().getDeclaredMethod("getProtocol").invoke(version);
|
||||
} catch (NoSuchMethodException e) {
|
||||
return (int) version.getClass().getDeclaredMethod("protocolVersion").invoke(version);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren