From 71fe3c64f0321143dd61a9e7b3a99d966a459cae Mon Sep 17 00:00:00 2001 From: Emily <35617540+emilyy-dev@users.noreply.github.com> Date: Wed, 1 Jun 2022 22:56:24 -0300 Subject: [PATCH] Add numeric string completion suggestions as int suggestions (#6360) --- ...ent-suggestion-tooltips-in-AsyncTabC.patch | 9 ++--- ...fix-PlayerItemHeldEvent-firing-twice.patch | 4 +-- ...d-RespawnFlags-to-PlayerRespawnEvent.patch | 4 +-- ...ditions-to-PlayerGameModeChangeEvent.patch | 4 +-- .../0659-Add-PlayerKickEvent-causes.patch | 34 +++++++++---------- ...nect-for-book-edit-is-called-on-main.patch | 4 +-- .../0680-Adds-PlayerArmSwingEvent.patch | 4 +-- ...k-event-leave-message-not-being-sent.patch | 6 ++-- ...on-checking-in-player-move-packet-ha.patch | 10 +++--- .../0839-Kick-on-main-for-illegal-chars.patch | 4 +-- ...nt-tile-entity-copies-loading-chunks.patch | 4 +-- ...s-ServerLevel-for-gamerule-callbacks.patch | 4 +-- ...o-not-accept-invalid-client-settings.patch | 4 +-- 13 files changed, 48 insertions(+), 47 deletions(-) diff --git a/patches/server/0618-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch b/patches/server/0618-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch index 5598e16363..2ab758e5e5 100644 --- a/patches/server/0618-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch +++ b/patches/server/0618-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Allow for Component suggestion tooltips in diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 424b7df06f98bb5157b91026854e03cd8c4e3deb..c1a01129070f20bc7f17929b2683bd9ed1591961 100644 +index 424b7df06f98bb5157b91026854e03cd8c4e3deb..171fb8361c688080c2cf29788433c3d87bf3864e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -771,12 +771,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -24,7 +24,7 @@ index 424b7df06f98bb5157b91026854e03cd8c4e3deb..c1a01129070f20bc7f17929b2683bd9e // If the event isn't handled, we can assume that we have no completions, and so we'll ask the server if (!event.isHandled()) { if (!event.isCancelled()) { -@@ -795,10 +794,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -795,10 +794,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser }); } } else if (!completions.isEmpty()) { @@ -35,8 +35,9 @@ index 424b7df06f98bb5157b91026854e03cd8c4e3deb..c1a01129070f20bc7f17929b2683bd9e - completions.forEach(builder::suggest); + final com.mojang.brigadier.suggestion.SuggestionsBuilder builder = builder0.createOffset(builder0.getInput().lastIndexOf(' ') + 1); + completions.forEach(completion -> { -+ if (completion.tooltip() == null) { -+ builder.suggest(completion.suggestion()); ++ final Integer intSuggestion = com.google.common.primitives.Ints.tryParse(completion.suggestion()); ++ if (intSuggestion != null) { ++ builder.suggest(intSuggestion, PaperAdventure.asVanilla(completion.tooltip())); + } else { + builder.suggest(completion.suggestion(), PaperAdventure.asVanilla(completion.tooltip())); + } diff --git a/patches/server/0628-fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/0628-fix-PlayerItemHeldEvent-firing-twice.patch index 461994c910..d13ea0640b 100644 --- a/patches/server/0628-fix-PlayerItemHeldEvent-firing-twice.patch +++ b/patches/server/0628-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 c1a01129070f20bc7f17929b2683bd9ed1591961..6e5394d50309dbdfc378ac5d16e75d5cac99cd61 100644 +index 171fb8361c688080c2cf29788433c3d87bf3864e..b1e62c8c7f53ea30f190f689ebeac14212534181 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1963,6 +1963,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1964,6 +1964,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/0635-add-RespawnFlags-to-PlayerRespawnEvent.patch b/patches/server/0635-add-RespawnFlags-to-PlayerRespawnEvent.patch index 5e5415d7b0..334910b84e 100644 --- a/patches/server/0635-add-RespawnFlags-to-PlayerRespawnEvent.patch +++ b/patches/server/0635-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 6e5394d50309dbdfc378ac5d16e75d5cac99cd61..20a1c0e3926e3853c74e0d6484333bca02c76a2f 100644 +index b1e62c8c7f53ea30f190f689ebeac14212534181..f50c2d827504ce7ef724574dbd2126d5f8c960b3 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2501,7 +2501,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2502,7 +2502,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser case PERFORM_RESPAWN: if (this.player.wonGame) { this.player.wonGame = false; diff --git a/patches/server/0648-additions-to-PlayerGameModeChangeEvent.patch b/patches/server/0648-additions-to-PlayerGameModeChangeEvent.patch index c2647a86fe..7313a09aa0 100644 --- a/patches/server/0648-additions-to-PlayerGameModeChangeEvent.patch +++ b/patches/server/0648-additions-to-PlayerGameModeChangeEvent.patch @@ -126,10 +126,10 @@ index f97d97426144527cff9ebb91b26fe8541a9c6d9b..b6eef41079120fffd63f06f681378b1b } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 25b9a0327241c28738cd36ae7cfd031dff93f4cc..eab35ca61dd44d03ad0b9851d0e878480aba104a 100644 +index f50c2d827504ce7ef724574dbd2126d5f8c960b3..6ba3c1dcf797440e0677675a4869de25b567b945 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2510,7 +2510,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2511,7 +2511,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/0659-Add-PlayerKickEvent-causes.patch b/patches/server/0659-Add-PlayerKickEvent-causes.patch index 09bdeb5a8b..1eb96b6b01 100644 --- a/patches/server/0659-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0659-Add-PlayerKickEvent-causes.patch @@ -156,7 +156,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b return; } // Paper end -@@ -910,7 +918,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -911,7 +919,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // Paper start - validate pick item position if (!(packet.getSlot() >= 0 && packet.getSlot() < this.player.getInventory().items.size())) { ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString()); @@ -165,7 +165,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b return; } this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed -@@ -1075,7 +1083,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1076,7 +1084,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; if (byteLength > 256 * 4) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!"); @@ -174,7 +174,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b return; } byteTotal += byteLength; -@@ -1098,14 +1106,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1099,14 +1107,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser if (byteTotal > byteAllowed) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); @@ -191,7 +191,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b return; } this.lastBookTick = MinecraftServer.currentTick; -@@ -1229,7 +1237,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1230,7 +1238,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser public void handleMovePlayer(ServerboundMovePlayerPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) { @@ -200,7 +200,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b } else { ServerLevel worldserver = this.player.getLevel(); -@@ -1656,7 +1664,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1657,7 +1665,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.dropCount++; if (this.dropCount >= 20) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!"); @@ -209,7 +209,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b return; } } -@@ -1875,7 +1883,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1876,7 +1884,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) { ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName()); @@ -218,7 +218,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b } // Paper start PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()]; -@@ -1980,7 +1988,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1981,7 +1989,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.player.resetLastActionTime(); } else { ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString()); @@ -227,7 +227,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b } } -@@ -1996,7 +2004,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1997,7 +2005,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser for (int i = 0; i < s.length(); ++i) { if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) { @@ -236,7 +236,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b return; } } -@@ -2069,7 +2077,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2070,7 +2078,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser Waitable waitable = new Waitable() { @Override protected Object evaluate() { @@ -245,7 +245,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b return null; } }; -@@ -2084,7 +2092,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2085,7 +2093,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser throw new RuntimeException(e); } } else { @@ -254,7 +254,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b } // CraftBukkit end } -@@ -2357,7 +2365,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2358,7 +2366,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // Spigot Start if ( entity == this.player && !this.player.isSpectator() ) { @@ -263,7 +263,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b return; } // Spigot End -@@ -2452,7 +2460,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2453,7 +2461,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } // CraftBukkit end } else { @@ -272,7 +272,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString()); } } -@@ -2858,7 +2866,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2859,7 +2867,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // Paper start if (!org.bukkit.Bukkit.isPrimaryThread()) { if (recipeSpamPackets.addAndGet(com.destroystokyo.paper.PaperConfig.autoRecipeIncrement) > com.destroystokyo.paper.PaperConfig.autoRecipeLimit) { @@ -281,7 +281,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b return; } } -@@ -3046,7 +3054,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3047,7 +3055,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 eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b }); // Paper end } -@@ -3092,7 +3100,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3093,7 +3101,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex); @@ -299,7 +299,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b } } else if (packet.identifier.equals(CUSTOM_UNREGISTER)) { try { -@@ -3102,7 +3110,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3103,7 +3111,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex); @@ -308,7 +308,7 @@ index eab35ca61dd44d03ad0b9851d0e878480aba104a..b1a5df7e62bc2505bc95933cbdbf6e8b } } else { try { -@@ -3120,7 +3128,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3121,7 +3129,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/0676-Ensure-disconnect-for-book-edit-is-called-on-main.patch b/patches/server/0676-Ensure-disconnect-for-book-edit-is-called-on-main.patch index df8d44a9ad..c7168f2c59 100644 --- a/patches/server/0676-Ensure-disconnect-for-book-edit-is-called-on-main.patch +++ b/patches/server/0676-Ensure-disconnect-for-book-edit-is-called-on-main.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ensure disconnect for book edit is called on main diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7ad1b8b836d692b1168609e96e4eb72e037be4c9..9186a593c787afc40a69cd442a27622fef6fa986 100644 +index 9be0dbdd7d06568e9604fe18e5d4dd9f5d4a14be..d6279614b94afa8419a163305f5b23b1f36c10b2 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1113,7 +1113,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1114,7 +1114,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // Paper end // CraftBukkit start if (this.lastBookTick + 20 > MinecraftServer.currentTick) { diff --git a/patches/server/0680-Adds-PlayerArmSwingEvent.patch b/patches/server/0680-Adds-PlayerArmSwingEvent.patch index d130cd94d5..635b5f50c8 100644 --- a/patches/server/0680-Adds-PlayerArmSwingEvent.patch +++ b/patches/server/0680-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 9186a593c787afc40a69cd442a27622fef6fa986..f6c8ce420c8cbe977897c78f1575b917ee9632ac 100644 +index d6279614b94afa8419a163305f5b23b1f36c10b2..f14f8c4db697f0101158f0024c9c91814f4c942e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2261,7 +2261,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2262,7 +2262,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } // Arm swing animation diff --git a/patches/server/0681-Fixes-kick-event-leave-message-not-being-sent.patch b/patches/server/0681-Fixes-kick-event-leave-message-not-being-sent.patch index 202829d29a..c2504bda8f 100644 --- a/patches/server/0681-Fixes-kick-event-leave-message-not-being-sent.patch +++ b/patches/server/0681-Fixes-kick-event-leave-message-not-being-sent.patch @@ -17,7 +17,7 @@ index 7ae525803609f173c0a38b17d2ef86c1facbd5dc..3a44756d9e71a56293f41ec9aab141ba public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f6c8ce420c8cbe977897c78f1575b917ee9632ac..d9eec6be067b858001c31f25788a63f2d50051ce 100644 +index f14f8c4db697f0101158f0024c9c91814f4c942e..88416fe604ccc136230f8743ea7a789b15d6c46d 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -447,7 +447,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -37,7 +37,7 @@ index f6c8ce420c8cbe977897c78f1575b917ee9632ac..d9eec6be067b858001c31f25788a63f2 this.connection.setReadOnly(); MinecraftServer minecraftserver = this.server; Connection networkmanager = this.connection; -@@ -1908,6 +1907,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1909,6 +1908,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @Override public void onDisconnect(Component reason) { @@ -49,7 +49,7 @@ index f6c8ce420c8cbe977897c78f1575b917ee9632ac..d9eec6be067b858001c31f25788a63f2 // CraftBukkit start - Rarely it would send a disconnect line twice if (this.processedDisconnect) { return; -@@ -1924,7 +1928,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1925,7 +1929,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.player.disconnect(); // Paper start - Adventure diff --git a/patches/server/0808-Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/server/0808-Optimise-collision-checking-in-player-move-packet-ha.patch index 32c30b0f27..3b1fc4b2f2 100644 --- a/patches/server/0808-Optimise-collision-checking-in-player-move-packet-ha.patch +++ b/patches/server/0808-Optimise-collision-checking-in-player-move-packet-ha.patch @@ -88,7 +88,7 @@ index cc0adbd20bc069e61fc333e57c2e3ccbf8d5c888..fb15e7ec56b91541a4bff810d45edec5 } @Override -@@ -1251,7 +1285,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1252,7 +1286,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } if (this.awaitingPositionFromClient != null) { @@ -97,7 +97,7 @@ index cc0adbd20bc069e61fc333e57c2e3ccbf8d5c888..fb15e7ec56b91541a4bff810d45edec5 this.awaitingTeleportTime = this.tickCount; this.teleport(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); } -@@ -1345,7 +1379,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1346,7 +1380,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } } @@ -106,7 +106,7 @@ index cc0adbd20bc069e61fc333e57c2e3ccbf8d5c888..fb15e7ec56b91541a4bff810d45edec5 d7 = d0 - this.lastGoodX; // Paper - diff on change, used for checking large move vectors above d8 = d1 - this.lastGoodY; // Paper - diff on change, used for checking large move vectors above -@@ -1386,6 +1420,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1387,6 +1421,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser boolean flag1 = this.player.verticalCollisionBelow; this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9)); @@ -114,7 +114,7 @@ index cc0adbd20bc069e61fc333e57c2e3ccbf8d5c888..fb15e7ec56b91541a4bff810d45edec5 this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move // Paper start - prevent position desync if (this.awaitingPositionFromClient != null) { -@@ -1405,12 +1440,23 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1406,12 +1441,23 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser boolean flag2 = false; if (!this.player.isChangingDimension() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot @@ -140,7 +140,7 @@ index cc0adbd20bc069e61fc333e57c2e3ccbf8d5c888..fb15e7ec56b91541a4bff810d45edec5 this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet(), false); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet. } else { // CraftBukkit start - fire PlayerMoveEvent -@@ -1496,6 +1542,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1497,6 +1543,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } } diff --git a/patches/server/0839-Kick-on-main-for-illegal-chars.patch b/patches/server/0839-Kick-on-main-for-illegal-chars.patch index af41fa2288..cfcd3fa5f9 100644 --- a/patches/server/0839-Kick-on-main-for-illegal-chars.patch +++ b/patches/server/0839-Kick-on-main-for-illegal-chars.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Kick on main for illegal chars diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 761a87be91e82841632f4f46dec799ae28f05887..d18f8972d37dc56a8df786774a4f70b5c3b78ec4 100644 +index 09c86449f1e1fe06b75537251f91fc6063e7c7c4..4782ca794273c8a3fd53cf05732afd71ea376721 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2080,7 +2080,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2081,7 +2081,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser for (int i = 0; i < s.length(); ++i) { if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) { diff --git a/patches/server/0888-Prevent-tile-entity-copies-loading-chunks.patch b/patches/server/0888-Prevent-tile-entity-copies-loading-chunks.patch index 520df26df7..498549d220 100644 --- a/patches/server/0888-Prevent-tile-entity-copies-loading-chunks.patch +++ b/patches/server/0888-Prevent-tile-entity-copies-loading-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent tile entity copies loading chunks diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1d30776997dda6998d793541bde9410030e25db1..c087d7a1f5e560193f87a681101da8be1b60c8b3 100644 +index 428fb4e57956b52eb139c0f2e76c85f1c893920f..1ab83b8ef05ef8dfdabb17f33cffa728d631dff2 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2994,7 +2994,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2995,7 +2995,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser if (!itemstack.isEmpty() && nbttagcompound != null && nbttagcompound.contains("x") && nbttagcompound.contains("y") && nbttagcompound.contains("z") && this.player.getBukkitEntity().hasPermission("minecraft.nbt.copy")) { // Spigot BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound); diff --git a/patches/server/0891-Pass-ServerLevel-for-gamerule-callbacks.patch b/patches/server/0891-Pass-ServerLevel-for-gamerule-callbacks.patch index 84c8fa843b..c5f9393f5f 100644 --- a/patches/server/0891-Pass-ServerLevel-for-gamerule-callbacks.patch +++ b/patches/server/0891-Pass-ServerLevel-for-gamerule-callbacks.patch @@ -18,10 +18,10 @@ index e28e09aae1d95d9bed50a137e999e6d457e62478..257c94f7c1cb00c9a91ab82e311dfd8e if (dedicatedserverproperties.enableQuery) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index c087d7a1f5e560193f87a681101da8be1b60c8b3..1a87f61d534ed531132fb43a9d2a45a4b604a6fc 100644 +index 1ab83b8ef05ef8dfdabb17f33cffa728d631dff2..829842f40f5587aa4135ce4f2688e3acfe17a3da 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2603,7 +2603,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2604,7 +2604,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.player = this.server.getPlayerList().respawn(this.player, false); if (this.server.isHardcore()) { this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper diff --git a/patches/server/0904-Do-not-accept-invalid-client-settings.patch b/patches/server/0904-Do-not-accept-invalid-client-settings.patch index 1381f89d0b..a370d820c1 100644 --- a/patches/server/0904-Do-not-accept-invalid-client-settings.patch +++ b/patches/server/0904-Do-not-accept-invalid-client-settings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Do not accept invalid client settings diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1a87f61d534ed531132fb43a9d2a45a4b604a6fc..1a1f3664554ae1f2b0110f615e79fa0568407d17 100644 +index 0545c7fb227665dd23c7b5034a1520ed10f962b9..901fa17d0f0a3f66923f68f13f183bc4c17f7748 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3169,6 +3169,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3170,6 +3170,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @Override public void handleClientInformation(ServerboundClientInformationPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());