mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-12-22 14:34:59 +01:00
API: Expose a GeyserConnection's protocol version (#5083)
* Add protocolVersion() to GeyserConnection * specify which protocol
This commit is contained in:
parent
264a914d41
commit
d94c6ffcb6
3 changed files with 11 additions and 1 deletions
|
@ -70,6 +70,11 @@ public interface GeyserConnection extends Connection, CommandSource {
|
|||
*/
|
||||
void closeForm();
|
||||
|
||||
/**
|
||||
* Gets the Bedrock protocol version of the player.
|
||||
*/
|
||||
int protocolVersion();
|
||||
|
||||
/**
|
||||
* @param javaId the Java entity ID to look up.
|
||||
* @return a {@link GeyserEntity} if present in this connection's entity tracker.
|
||||
|
|
|
@ -2229,6 +2229,11 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||
return (int) Math.floor(rakSessionCodec.getPing());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int protocolVersion() {
|
||||
return upstream.getProtocolVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeForm() {
|
||||
if (!GameProtocol.isPre1_21_2(this)) {
|
||||
|
|
|
@ -8,5 +8,5 @@ org.gradle.vfs.watch=false
|
|||
|
||||
group=org.geysermc
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue