From 810d200bb4c6d73687526ce7ec6b739bc1e674cc Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 11 Sep 2021 22:18:44 +0200 Subject: [PATCH] Improve interact distance check (#6591) --- ...ove-range-check-for-block-placing-up.patch | 28 +++++++++++++++---- patches/server/0504-Brand-support.patch | 8 +++--- .../server/0565-Limit-recipe-packets.patch | 4 +-- ...-event-not-being-called-in-adventure.patch | 6 ++-- ...-using-signs-inside-spawn-protection.patch | 4 +-- ...fix-PlayerItemHeldEvent-firing-twice.patch | 4 +-- ...d-RespawnFlags-to-PlayerRespawnEvent.patch | 4 +-- ...ditions-to-PlayerGameModeChangeEvent.patch | 4 +-- .../0693-Add-PlayerKickEvent-causes.patch | 28 +++++++++---------- .../0715-Adds-PlayerArmSwingEvent.patch | 4 +-- ...k-event-leave-message-not-being-sent.patch | 6 ++-- 11 files changed, 58 insertions(+), 42 deletions(-) diff --git a/patches/server/0493-Move-range-check-for-block-placing-up.patch b/patches/server/0493-Move-range-check-for-block-placing-up.patch index 89a6189814..85a552e41d 100644 --- a/patches/server/0493-Move-range-check-for-block-placing-up.patch +++ b/patches/server/0493-Move-range-check-for-block-placing-up.patch @@ -5,17 +5,33 @@ Subject: [PATCH] Move range check for block placing up diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 36a69fb0a9cd81ceb0f9cbe6549fc89bd643c77c..7f4673bb2809729e3722300173a10ec5922fcc76 100644 +index 36a69fb0a9cd81ceb0f9cbe6549fc89bd643c77c..7bf9f2b85c51424b53c08166b6ba3943f1abe0fe 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1673,17 +1673,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1661,6 +1661,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser + } + // Spigot end + ++ // Paper start ++ private boolean isOutsideOfReach(double x, double y, double z) { ++ Location eyeLoc = this.getCraftPlayer().getEyeLocation(); ++ double reachDistance = NumberConversions.square(eyeLoc.getX() - x) + NumberConversions.square(eyeLoc.getY() - y) + NumberConversions.square(eyeLoc.getZ() - z); ++ return reachDistance > (this.getCraftPlayer().getGameMode() == org.bukkit.GameMode.CREATIVE ? CREATIVE_PLACE_DISTANCE_SQUARED : SURVIVAL_PLACE_DISTANCE_SQUARED); ++ } ++ // Paper end ++ + @Override + public void handleUseItemOn(ServerboundUseItemOnPacket packet) { + PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); +@@ -1673,17 +1681,22 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser BlockPos blockposition = movingobjectpositionblock.getBlockPos(); Direction enumdirection = movingobjectpositionblock.getDirection(); -+ // Paper start - move check up -+ Location eyeLoc = this.getCraftPlayer().getEyeLocation(); -+ double reachDistance = NumberConversions.square(eyeLoc.getX() - blockposition.getX()) + NumberConversions.square(eyeLoc.getY() - blockposition.getY()) + NumberConversions.square(eyeLoc.getZ() - blockposition.getZ()); -+ if (reachDistance > (this.getCraftPlayer().getGameMode() == org.bukkit.GameMode.CREATIVE ? CREATIVE_PLACE_DISTANCE_SQUARED : SURVIVAL_PLACE_DISTANCE_SQUARED)) { ++ // Paper start - move check up and check actual location as well ++ final Vec3 clickedLocation = movingobjectpositionblock.getLocation(); ++ if (isOutsideOfReach(blockposition.getX(), blockposition.getY(), blockposition.getZ()) ++ || !Double.isFinite(clickedLocation.x) || !Double.isFinite(clickedLocation.y) || !Double.isFinite(clickedLocation.z) ++ || isOutsideOfReach(clickedLocation.x, clickedLocation.y, clickedLocation.z)) { + return; + } + // Paper end - move check up diff --git a/patches/server/0504-Brand-support.patch b/patches/server/0504-Brand-support.patch index 65b7edbc16..e401114549 100644 --- a/patches/server/0504-Brand-support.patch +++ b/patches/server/0504-Brand-support.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Brand support diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7f4673bb2809729e3722300173a10ec5922fcc76..c05ced79e5bf6d2900f0479db3150e76e3874ba0 100644 +index 121b612a80f7a6f6a52d916d61c9f46f91ffb1f1..b6a7a129b0357ab7d25037e646960aee152a9261 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -4,6 +4,7 @@ import com.google.common.collect.Lists; @@ -33,7 +33,7 @@ index 7f4673bb2809729e3722300173a10ec5922fcc76..c05ced79e5bf6d2900f0479db3150e76 public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { this.server = server; this.connection = connection; -@@ -2982,6 +2986,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2991,6 +2995,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private static final ResourceLocation CUSTOM_REGISTER = new ResourceLocation("register"); private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister"); @@ -42,7 +42,7 @@ index 7f4673bb2809729e3722300173a10ec5922fcc76..c05ced79e5bf6d2900f0479db3150e76 @Override public void handleCustomPayload(ServerboundCustomPayloadPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); -@@ -3009,6 +3015,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3018,6 +3024,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser try { byte[] data = new byte[packet.data.readableBytes()]; packet.data.readBytes(data); @@ -58,7 +58,7 @@ index 7f4673bb2809729e3722300173a10ec5922fcc76..c05ced79e5bf6d2900f0479db3150e76 this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data); } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); -@@ -3018,6 +3033,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3027,6 +3042,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } diff --git a/patches/server/0565-Limit-recipe-packets.patch b/patches/server/0565-Limit-recipe-packets.patch index f9b187d4ac..c8b4517fb3 100644 --- a/patches/server/0565-Limit-recipe-packets.patch +++ b/patches/server/0565-Limit-recipe-packets.patch @@ -23,7 +23,7 @@ index 4747eb55decd797c7872028997f4e22d15c5a661..ff337f7f5317f30b65e1b40c11c17834 public static boolean velocityOnlineMode; public static byte[] velocitySecretKey; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 19f2751ed35ea7157b5f4b8c30b3328710967be6..cda4fba2003fc35021b0cece9ade9cf8e3fce422 100644 +index 4224cf13528c2c2deeb1c1ffeadc954e166d3f61..ecb62a1fd7d0458bd2e7dbbf54c3a415a6889832 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -231,6 +231,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -42,7 +42,7 @@ index 19f2751ed35ea7157b5f4b8c30b3328710967be6..cda4fba2003fc35021b0cece9ade9cf8 /* Use thread-safe field access instead if (this.chatSpamTickCount > 0) { --this.chatSpamTickCount; -@@ -2792,6 +2794,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2801,6 +2803,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @Override public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { diff --git a/patches/server/0582-Fix-interact-event-not-being-called-in-adventure.patch b/patches/server/0582-Fix-interact-event-not-being-called-in-adventure.patch index 4d887b62a4..71daa7d325 100644 --- a/patches/server/0582-Fix-interact-event-not-being-called-in-adventure.patch +++ b/patches/server/0582-Fix-interact-event-not-being-called-in-adventure.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix interact event not being called in adventure Call PlayerInteractEvent when left-clicking on a block in adventure mode diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index cda4fba2003fc35021b0cece9ade9cf8e3fce422..9141b04fd67522cfcea26b3b740d1ea4eebd2dbe 100644 +index ecb62a1fd7d0458bd2e7dbbf54c3a415a6889832..cd2494a8396ef7f4372207ab89271386efdffa4f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1725,7 +1725,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1734,7 +1734,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser MutableComponent ichatmutablecomponent = (new TranslatableComponent("build.tooHigh", new Object[]{i - 1})).withStyle(ChatFormatting.RED); this.player.sendMessage((Component) ichatmutablecomponent, ChatType.GAME_INFO, Util.NIL_UUID); @@ -18,7 +18,7 @@ index cda4fba2003fc35021b0cece9ade9cf8e3fce422..9141b04fd67522cfcea26b3b740d1ea4 this.player.swing(enumhand, true); } } -@@ -2197,7 +2197,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2206,7 +2206,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser Vec3 vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3); HitResult movingobjectposition = this.player.level.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, this.player)); diff --git a/patches/server/0636-Allow-using-signs-inside-spawn-protection.patch b/patches/server/0636-Allow-using-signs-inside-spawn-protection.patch index 7a944ac598..5d24598f09 100644 --- a/patches/server/0636-Allow-using-signs-inside-spawn-protection.patch +++ b/patches/server/0636-Allow-using-signs-inside-spawn-protection.patch @@ -20,10 +20,10 @@ index e53b6515ca427b90f21441cf142ecde6e986058d..1da69d56f0b58708d4c85e76307b7252 } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9141b04fd67522cfcea26b3b740d1ea4eebd2dbe..b06e38f916434dc585f24c041f359b532002cc3c 100644 +index cd2494a8396ef7f4372207ab89271386efdffa4f..35ccf3b784c114df269151ec9beed3de6b294319 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1714,7 +1714,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1723,7 +1723,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser int i = this.player.level.getMaxBuildHeight(); if (blockposition.getY() < i) { diff --git a/patches/server/0659-fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/0659-fix-PlayerItemHeldEvent-firing-twice.patch index 947645bd3d..4f47496a55 100644 --- a/patches/server/0659-fix-PlayerItemHeldEvent-firing-twice.patch +++ b/patches/server/0659-fix-PlayerItemHeldEvent-firing-twice.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix PlayerItemHeldEvent firing twice diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7543354f18a46c52022b90318373071fe7da913c..7ea60ced8fc10430c2564913ac80bee47b395326 100644 +index a32f5f3618aa6b4c7257eb082d54a590f01437ac..08c7eeb53266fe003be1c86bb3afe33c7335f0f8 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1918,6 +1918,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1927,6 +1927,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (this.player.isImmobile()) return; // CraftBukkit if (packet.getSlot() >= 0 && packet.getSlot() < Inventory.getSelectionSize()) { diff --git a/patches/server/0666-add-RespawnFlags-to-PlayerRespawnEvent.patch b/patches/server/0666-add-RespawnFlags-to-PlayerRespawnEvent.patch index 3ca9c9c09e..43f7160e83 100644 --- a/patches/server/0666-add-RespawnFlags-to-PlayerRespawnEvent.patch +++ b/patches/server/0666-add-RespawnFlags-to-PlayerRespawnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] add RespawnFlags to PlayerRespawnEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7ea60ced8fc10430c2564913ac80bee47b395326..9070424222daacd2174da71b898ee90dea0ea3c5 100644 +index 08c7eeb53266fe003be1c86bb3afe33c7335f0f8..18c36a21d3ef1f439fa7ef625609a5eb59e63ae9 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2452,7 +2452,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2461,7 +2461,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser case PERFORM_RESPAWN: if (this.player.wonGame) { this.player.wonGame = false; diff --git a/patches/server/0679-additions-to-PlayerGameModeChangeEvent.patch b/patches/server/0679-additions-to-PlayerGameModeChangeEvent.patch index aba44435cf..e93164987f 100644 --- a/patches/server/0679-additions-to-PlayerGameModeChangeEvent.patch +++ b/patches/server/0679-additions-to-PlayerGameModeChangeEvent.patch @@ -126,10 +126,10 @@ index da2ae74b6f5875200e22c42ed07431016a90845e..35d05cc4bddea5b168a6498add1de9bc } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9070424222daacd2174da71b898ee90dea0ea3c5..06bdfd91167de980b30463bd4ba972e39f441193 100644 +index 18c36a21d3ef1f439fa7ef625609a5eb59e63ae9..5f7abfba4154a3191d56eddb6dc75f26d3da3ca9 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2461,7 +2461,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2470,7 +2470,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.player = this.server.getPlayerList().respawn(this.player, false); if (this.server.isHardcore()) { diff --git a/patches/server/0693-Add-PlayerKickEvent-causes.patch b/patches/server/0693-Add-PlayerKickEvent-causes.patch index 659e49b732..8715fa4207 100644 --- a/patches/server/0693-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0693-Add-PlayerKickEvent-causes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerKickEvent causes diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2855749701f9fe6d3284e6f072e0971b46816e2a..154b0dd9bcfefbd7e7eae8c2f28bbabcd0fde531 100644 +index 22edac5278efc495885a5fc34677f26ea67ae9ca..b7beb5c778c010d37e737f09cc9f0e7af3b47cef 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -2125,7 +2125,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop com.destroystokyo.paper.PaperConfig.autoRecipeLimit) { @@ -281,7 +281,7 @@ index 06bdfd91167de980b30463bd4ba972e39f441193..93826caece07029911a90919361b773e return; } } -@@ -2992,7 +3000,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3001,7 +3009,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } else if (!this.isSingleplayerOwner()) { // Paper start - This needs to be handled on the main thread for plugins server.submit(() -> { @@ -290,7 +290,7 @@ index 06bdfd91167de980b30463bd4ba972e39f441193..93826caece07029911a90919361b773e }); // Paper end } -@@ -3038,7 +3046,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3047,7 +3055,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex); @@ -299,7 +299,7 @@ index 06bdfd91167de980b30463bd4ba972e39f441193..93826caece07029911a90919361b773e } } else if (packet.identifier.equals(CUSTOM_UNREGISTER)) { try { -@@ -3048,7 +3056,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3057,7 +3065,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex); @@ -308,7 +308,7 @@ index 06bdfd91167de980b30463bd4ba972e39f441193..93826caece07029911a90919361b773e } } else { try { -@@ -3066,7 +3074,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3075,7 +3083,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data); } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); diff --git a/patches/server/0715-Adds-PlayerArmSwingEvent.patch b/patches/server/0715-Adds-PlayerArmSwingEvent.patch index 4ec1d8b9d6..2c31625cb7 100644 --- a/patches/server/0715-Adds-PlayerArmSwingEvent.patch +++ b/patches/server/0715-Adds-PlayerArmSwingEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Adds PlayerArmSwingEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 640ee1b8ca4ba7308d94832fc23b0c57c81a99e1..a8fa5d4b13fe439aef00cc15272f0342984c4de1 100644 +index 07f9b6269fa156672ed8a6572ec5dd72ca08419f..3a562f0c2c851e190ca9a681bbd33721df46a06a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2216,7 +2216,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2225,7 +2225,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } // Arm swing animation diff --git a/patches/server/0716-Fixes-kick-event-leave-message-not-being-sent.patch b/patches/server/0716-Fixes-kick-event-leave-message-not-being-sent.patch index 539fd8682e..81eb6c1fcd 100644 --- a/patches/server/0716-Fixes-kick-event-leave-message-not-being-sent.patch +++ b/patches/server/0716-Fixes-kick-event-leave-message-not-being-sent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fixes kick event leave message not being sent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a8fa5d4b13fe439aef00cc15272f0342984c4de1..1c7d0f4b594cc0e0ae28c89514fa21f7d42f2644 100644 +index 3a562f0c2c851e190ca9a681bbd33721df46a06a..6a0b473e3ae663644b15e3921b87e3cb28621b31 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -457,7 +457,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -17,7 +17,7 @@ index a8fa5d4b13fe439aef00cc15272f0342984c4de1..1c7d0f4b594cc0e0ae28c89514fa21f7 this.connection.setReadOnly(); MinecraftServer minecraftserver = this.server; Connection networkmanager = this.connection; -@@ -1863,6 +1863,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1872,6 +1872,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @Override public void onDisconnect(Component reason) { @@ -29,7 +29,7 @@ index a8fa5d4b13fe439aef00cc15272f0342984c4de1..1c7d0f4b594cc0e0ae28c89514fa21f7 // CraftBukkit start - Rarely it would send a disconnect line twice if (this.processedDisconnect) { return; -@@ -1879,7 +1884,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1888,7 +1893,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.player.disconnect(); // Paper start - Adventure