aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0926-Implement-OfflinePlayer-isConnected.patch
diff options
context:
space:
mode:
authormaxcom1 <[email protected]>2024-03-23 22:26:17 +0100
committerGitHub <[email protected]>2024-03-23 17:26:17 -0400
commitb6001403e9703cadaa6e8c8558e732b91c3c6d6e (patch)
treea8c57bbc334a8ad48d4ad2b43db335667b142bee /patches/server/0926-Implement-OfflinePlayer-isConnected.patch
parent9ec7dfcbc41c6e625de0050b6997160a75df9f44 (diff)
downloadPaper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.tar.gz
Paper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.zip
Add methods to change entity physics (#10334)
Diffstat (limited to 'patches/server/0926-Implement-OfflinePlayer-isConnected.patch')
-rw-r--r--patches/server/0926-Implement-OfflinePlayer-isConnected.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/patches/server/0926-Implement-OfflinePlayer-isConnected.patch b/patches/server/0926-Implement-OfflinePlayer-isConnected.patch
new file mode 100644
index 0000000000..50c30ac481
--- /dev/null
+++ b/patches/server/0926-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 96408d505ce80799868ff84554a3b0b25adabb22..4a875bce9563f3b9351ebecde9b0eb1287beb50e 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 458c7039bddf63a0affbf14c24ba73d66cc13fac..5b5167947c82ca66a89aab456a2eb5b523887d33 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+@@ -243,6 +243,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 == null) return null;