mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-15 14:13:56 +01:00
Implement OfflinePlayer#isConnected
This commit is contained in:
parent
badf809fef
commit
1fc4ca9178
2 changed files with 14 additions and 0 deletions
|
@ -54,6 +54,13 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
|||
return this.getPlayer() != null;
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
public boolean isConnected() {
|
||||
return false;
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
Player player = this.getPlayer();
|
||||
|
|
|
@ -261,6 +261,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||
return this.server.getPlayer(this.getUniqueId()) != null;
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
public boolean isConnected() {
|
||||
return !this.getHandle().hasDisconnected();
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getAddress() {
|
||||
if (this.getHandle().connection.protocol() == null) return null;
|
||||
|
|
Loading…
Reference in a new issue