Expose client protocol version and virtual host

This commit is contained in:
Minecrell
2017-10-10 18:45:20 +02:00
parent 70e24c1b60
commit 8838089321
4 changed files with 83 additions and 8 deletions

View File

@@ -341,6 +341,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().transferCookieConnection.sendPacket(new ClientboundTransferPacket(host, port));
}
// Paper start - Implement NetworkClient
@Override
public int getProtocolVersion() {
if (getHandle().connection == null) return -1;
return getHandle().connection.connection.protocolVersion;
}
@Override
public InetSocketAddress getVirtualHost() {
if (getHandle().connection == null) return null;
return getHandle().connection.connection.virtualHost;
}
// Paper end
@Override
public double getEyeHeight(boolean ignorePose) {
if (ignorePose) {