2023-08-24 13:44:31 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Aeltumn <daniel@goossens.ch>
|
|
|
|
Date: Thu, 24 Aug 2023 13:05:30 +0200
|
|
|
|
Subject: [PATCH] Implement OfflinePlayer#isConnected
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
2024-04-25 00:36:49 +02:00
|
|
|
index 4d654c4f0b6210a9841427789ba70ce5d1d308be..9d93130f23addb18b97d7f5ec013faef17a74529 100644
|
2023-08-24 13:44:31 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
2024-01-26 20:17:06 +01:00
|
|
|
@@ -54,6 +54,13 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
2023-08-24 13:44:31 +02:00
|
|
|
return this.getPlayer() != null;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public boolean isConnected() {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public String getName() {
|
|
|
|
Player player = this.getPlayer();
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2024-08-09 22:05:50 +02:00
|
|
|
index 78dcc656807cafa52707ef4139fe6176f6f16021..a2dd33a9bb61427005e1edb1dcb1dfa23030d0ee 100644
|
2023-08-24 13:44:31 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2024-06-14 10:17:11 +02:00
|
|
|
@@ -256,6 +256,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2023-10-27 01:34:58 +02:00
|
|
|
return this.server.getPlayer(this.getUniqueId()) != null;
|
2023-08-24 13:44:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public boolean isConnected() {
|
|
|
|
+ return !this.getHandle().hasDisconnected();
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public InetSocketAddress getAddress() {
|
2024-04-25 00:36:49 +02:00
|
|
|
if (this.getHandle().connection.protocol() == null) return null;
|