aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0864-Implement-OfflinePlayer-isConnected.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-10-27 18:11:15 +0100
committerNassim Jahnke <[email protected]>2024-10-27 18:39:30 +0100
commit02bca1e6558bf4ac0cbf928d48e90f497b10b0a3 (patch)
tree1144072e447f4c0b7e80b278fd769106227f016a /patches/server/0864-Implement-OfflinePlayer-isConnected.patch
parent12ed02105177f54906a7d4422b235929426bc264 (diff)
downloadPaper-02bca1e6558bf4ac0cbf928d48e90f497b10b0a3.tar.gz
Paper-02bca1e6558bf4ac0cbf928d48e90f497b10b0a3.zip
Remove timings impl
Diffstat (limited to 'patches/server/0864-Implement-OfflinePlayer-isConnected.patch')
-rw-r--r--patches/server/0864-Implement-OfflinePlayer-isConnected.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/patches/server/0864-Implement-OfflinePlayer-isConnected.patch b/patches/server/0864-Implement-OfflinePlayer-isConnected.patch
new file mode 100644
index 0000000000..ebef6c5101
--- /dev/null
+++ b/patches/server/0864-Implement-OfflinePlayer-isConnected.patch
@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Aeltumn <[email protected]>
+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
+index 2c2c4db31a746b4eb853dc04c6b3e5631bbfa034..4f4e3ee18d586f61706504218cddc06a38ca5580 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
+@@ -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();
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+index 1943cb7b691573d3f9755d21d4b5a4210c1cc329..3b2d7837486424a2d1759c4ba5d1b1d492e9ec48 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+@@ -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;