Make Player#kickPlayer function asynchronously

We have made disconnect() mt-safe, so there is no need for
this check anymore.
This commit is contained in:
Spottedleaf 2023-03-07 13:22:53 -08:00
parent 7af86e656d
commit 0e4358fb7e

View File

@ -22155,9 +22155,18 @@ index 78f53ee557276de85f0431ebcb146445b1f4fb92..91a11cfa430c63455e2d54125d6e1bd4
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0351eb67bac6ce257f820af60aa3bba9f45da687..88006751825515966dcea1f779ac5452c8ddd964 100644 index 0351eb67bac6ce257f820af60aa3bba9f45da687..7b29843302d7aba8e64a2533a4b2203e9f30ecca 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -563,7 +563,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void kickPlayer(String message) {
- org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot
+ //org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot // Folia - thread-safe now, as it will simply delay the kick
if (this.getHandle().connection == null) return;
this.getHandle().connection.disconnect(message == null ? "" : message, org.bukkit.event.player.PlayerKickEvent.Cause.PLUGIN); // Paper - kick event cause
@@ -1702,7 +1702,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1702,7 +1702,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private void unregisterEntity(Entity other) { private void unregisterEntity(Entity other) {
// Paper end // Paper end