mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-11-21 22:36:18 +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();
|
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.
|
||||||
|
|
|
@ -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)) {
|
||||||
|
|
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue