3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 00:00:41 +01:00

API: Expose a GeyserConnection's protocol version (#5083)

* Add protocolVersion() to GeyserConnection

* specify which protocol
Dieser Commit ist enthalten in:
chris 2024-10-23 03:49:04 +08:00 committet von GitHub
Ursprung 264a914d41
Commit d94c6ffcb6
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
3 geänderte Dateien mit 11 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -70,6 +70,11 @@ public interface GeyserConnection extends Connection, CommandSource {
*/ */
void closeForm(); void closeForm();
/**
* Gets the Bedrock protocol version of the player.
*/
int protocolVersion();
/** /**
* @param javaId the Java entity ID to look up. * @param javaId the Java entity ID to look up.
* @return a {@link GeyserEntity} if present in this connection's entity tracker. * @return a {@link GeyserEntity} if present in this connection's entity tracker.

Datei anzeigen

@ -2229,6 +2229,11 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
return (int) Math.floor(rakSessionCodec.getPing()); return (int) Math.floor(rakSessionCodec.getPing());
} }
@Override
public int protocolVersion() {
return upstream.getProtocolVersion();
}
@Override @Override
public void closeForm() { public void closeForm() {
if (!GameProtocol.isPre1_21_2(this)) { if (!GameProtocol.isPre1_21_2(this)) {

Datei anzeigen

@ -8,5 +8,5 @@ org.gradle.vfs.watch=false
group=org.geysermc group=org.geysermc
id=geyser id=geyser
version=2.4.3-SNAPSHOT version=2.4.4-SNAPSHOT
description=Allows for players from Minecraft: Bedrock Edition to join Minecraft: Java Edition servers. description=Allows for players from Minecraft: Bedrock Edition to join Minecraft: Java Edition servers.