Archiviert
13
0

Remove bad server.scheduleOnMain disconnect calls from old patches

The new behavior of disconnect to block the current thread until the disconnect succeeded is better than throwing it off to happen at some point
Dieser Commit ist enthalten in:
Nassim Jahnke 2024-06-16 12:56:00 +02:00
Ursprung 752f957e12
Commit dc684c60d1
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
478 geänderte Dateien mit 55 neuen und 74 gelöschten Zeilen

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Book Size Limits
Puts some limits on the size of books.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9b255f9551fa66efa21944e284a40a03aefc3040..23f033e16e2210970e6b01672873670578f426f4 100644
index 9b255f9551fa66efa21944e284a40a03aefc3040..519ba39c5ff2c7782a88adc4212a7aca6788e09d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1043,6 +1043,45 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -24,7 +24,7 @@ index 9b255f9551fa66efa21944e284a40a03aefc3040..23f033e16e2210970e6b016728736705
+ 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!");
+ server.scheduleOnMain(() -> this.disconnect(Component.literal("Book too large!")));
+ this.disconnect(Component.literal("Book too large!"));
+ return;
+ }
+ byteTotal += byteLength;
@ -47,7 +47,7 @@ index 9b255f9551fa66efa21944e284a40a03aefc3040..23f033e16e2210970e6b016728736705
+
+ 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());
+ server.scheduleOnMain(() -> this.disconnect(Component.literal("Book too large!")));
+ this.disconnect(Component.literal("Book too large!"));
+ return;
+ }
+ }

Datei anzeigen

@ -119,7 +119,7 @@ index a05aea8561ac102476ee1b3068942b095950a86a..2b5235aea933462ca711abb5b59b6715
if (commandnode2.canUse(source)) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 23f033e16e2210970e6b01672873670578f426f4..cb6c447899d7080f14abecdb0cc84dc256a5bceb 100644
index 519ba39c5ff2c7782a88adc4212a7aca6788e09d..f0fb981c46229c2498061ab6b3adff2db886f7f6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -769,19 +769,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -22,7 +22,7 @@ it only impacts data sent from the client.
Set -DPaper.maxSignLength=XX to change limit or -1 to disable
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index cb6c447899d7080f14abecdb0cc84dc256a5bceb..39e273ada6225a4a5deb4830185a957e4ae9ab0d 100644
index f0fb981c46229c2498061ab6b3adff2db886f7f6..5db66f34c8010331765f2a75af6f8f19c6855e51 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -299,6 +299,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Validate PickItem Packet and kick for invalid
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 39e273ada6225a4a5deb4830185a957e4ae9ab0d..9ca934b6f24d6a8d5e32f6c4cf728bee4b3f3e36 100644
index 5db66f34c8010331765f2a75af6f8f19c6855e51..451f443a11e93b1d4a00490fd3459156289ff614 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -895,7 +895,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Prevent teleporting dead entities
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9ca934b6f24d6a8d5e32f6c4cf728bee4b3f3e36..ebeada0d62a71123e70fbafe3cb3232866e915f1 100644
index 451f443a11e93b1d4a00490fd3459156289ff614..0cdb3af5e89b9934257fc26e619b5086711c3486 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1553,6 +1553,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -13,7 +13,7 @@ behaviour, we need to move all of this dangerous logic outside
of the move call and into an appropriate place in the tick method.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ebeada0d62a71123e70fbafe3cb3232866e915f1..97059c8199bc80f3982556a4094f02b03138dc6c 100644
index 0cdb3af5e89b9934257fc26e619b5086711c3486..49f3cc0cf7ee20f754442fc1cbccb66132fbe794 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1350,6 +1350,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerRecipeBookClickEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 97059c8199bc80f3982556a4094f02b03138dc6c..c210c7632efd40a81432faa51bedabeac095e5c6 100644
index 49f3cc0cf7ee20f754442fc1cbccb66132fbe794..0fa1cf3694424b81fe40fbaa701a29da73eca8ea 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3058,16 +3058,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -18,7 +18,7 @@ index da9e864520150acd8027545672aa476be414bb4d..d4bd44210d58b30696feeea48e190947
return false;
} else if (this.player.blockActionRestricted(this.level, pos, this.gameModeForPlayer)) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c210c7632efd40a81432faa51bedabeac095e5c6..d823d32285b84c3775361d28f39b2c321b6b2f66 100644
index 0fa1cf3694424b81fe40fbaa701a29da73eca8ea..e7e12f6b7b9c34b9ab4bb934a9a45ad58269981d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -806,7 +806,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -76,7 +76,7 @@ index d6dc8c983d26ce89f17a990be4284fdc78ad164b..2b1d7a2360a9ee7bca9d93a2dc8c61d1
@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d823d32285b84c3775361d28f39b2c321b6b2f66..ad8b76b4b39442500de82653fe736bec32330ca0 100644
index e7e12f6b7b9c34b9ab4bb934a9a45ad58269981d..9b597e3840260c5fad3682bb5e1e135ce81235d3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3261,7 +3261,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -5,7 +5,7 @@ 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 ad8b76b4b39442500de82653fe736bec32330ca0..602991cc2a2fbbca990a6c35137bdd01f1027d6c 100644
index 9b597e3840260c5fad3682bb5e1e135ce81235d3..cf77e704a1f7b27cae0b5f1a930c9fca045793e0 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3253,6 +3253,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -9,7 +9,7 @@ as this is how Vanilla teleports entities.
Cancel any pending motion when teleported.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 602991cc2a2fbbca990a6c35137bdd01f1027d6c..28a210e76ba9f61ca88dea345e6d89f73e2a1ceb 100644
index cf77e704a1f7b27cae0b5f1a930c9fca045793e0..1f11efcef80f9915006cc68b5e8938b393d115ee 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -679,7 +679,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Fix for large move vectors crashing server
Check movement distance also based on current position.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 28a210e76ba9f61ca88dea345e6d89f73e2a1ceb..e03d49f10f624cf09b65f5c43afcc70c4ccb4900 100644
index 1f11efcef80f9915006cc68b5e8938b393d115ee..d8cd5bcc8d8c07eb4582030ca2703f9171743bd8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -492,9 +492,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Limit recipe packets
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e03d49f10f624cf09b65f5c43afcc70c4ccb4900..caf21de44bf2a39e28080f9cb9a9f2c658964633 100644
index d8cd5bcc8d8c07eb4582030ca2703f9171743bd8..291c85c823a24b86235bf7581761c1686f609b82 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -266,6 +266,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -31,7 +31,7 @@ index e03d49f10f624cf09b65f5c43afcc70c4ccb4900..caf21de44bf2a39e28080f9cb9a9f2c6
+ // Paper start - auto recipe limit
+ if (!org.bukkit.Bukkit.isPrimaryThread()) {
+ if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
+ this.server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam")));
+ this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam"));
+ return;
+ }
+ }

Datei anzeigen

@ -11,7 +11,7 @@ Subject: [PATCH] Fix interact event not being called sometimes
Co-authored-by: Moulberry <james.jenour@protonmail.com>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index caf21de44bf2a39e28080f9cb9a9f2c658964633..c0e42aafb33df84275938eccf9dd40c01cdf5404 100644
index 291c85c823a24b86235bf7581761c1686f609b82..48ebf9e606079fc091f1c4eed37001bbd0100e55 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1771,7 +1771,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Allow using signs inside spawn protection
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c0e42aafb33df84275938eccf9dd40c01cdf5404..21544ad90171e3705ee23174a6fbff173a3ef23c 100644
index 48ebf9e606079fc091f1c4eed37001bbd0100e55..91f19079cefe3ff5d3defec3991b32225c283d8b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1759,8 +1759,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Don't ignore result of PlayerEditBookEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 21544ad90171e3705ee23174a6fbff173a3ef23c..e89a87500c81da73a8a8b698303c4300c49fd95a 100644
index 91f19079cefe3ff5d3defec3991b32225c283d8b..0f6f1b47f88f46f4d51704304b0504826cef3565 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1155,7 +1155,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -5,7 +5,7 @@ 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 e89a87500c81da73a8a8b698303c4300c49fd95a..98798ede3297312ca2bb164a6320f26f8169f4a5 100644
index 0f6f1b47f88f46f4d51704304b0504826cef3565..a31f15acc53ab63b601b8de340beeeba92d5ed64 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1934,6 +1934,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -134,7 +134,7 @@ index 5de472df78940d1b8320f73d18b2edf3a796227e..073cf184a0e7af41048ae67a9b17b4cd
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 98798ede3297312ca2bb164a6320f26f8169f4a5..9acceb918c8e390d8b132a2ffb181f1cede34667 100644
index a31f15acc53ab63b601b8de340beeeba92d5ed64..17ba9988b6d7fbed2675291781ae28643cd0e6f5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2732,7 +2732,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -5,7 +5,7 @@ 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 9acceb918c8e390d8b132a2ffb181f1cede34667..0ca2cb7b3daacc55308e12604344214cc83a4084 100644
index 17ba9988b6d7fbed2675291781ae28643cd0e6f5..f1eea721a2ab664c1b52384313941e46cb8f1a11 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1746,6 +1746,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -87,7 +87,7 @@ index d6d7f1c446ba5507f67038ff27775ba75156f4a7..c63c194c44646e6bc1a5942655278701
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0ca2cb7b3daacc55308e12604344214cc83a4084..1b9d530de9e69935eafe86c56e07b80e1128d680 100644
index f1eea721a2ab664c1b52384313941e46cb8f1a11..9fb437fe46741edb4ffb7c3d1f0c1bf791ba2283 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2551,6 +2551,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -218,7 +218,7 @@ index 24bf661e76fb421a8be565d9ea68edf7205254d2..feb529adf2168025c785ab92d95a3246
if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1b9d530de9e69935eafe86c56e07b80e1128d680..6feee492addc939015c6c16c2aaa2c1c4a42bde3 100644
index 9fb437fe46741edb4ffb7c3d1f0c1bf791ba2283..1c76c6f8b60c65f73efdb30f695c2387a7e6fe1b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -349,7 +349,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -288,8 +288,8 @@ index 1b9d530de9e69935eafe86c56e07b80e1128d680..6feee492addc939015c6c16c2aaa2c1c
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!");
- server.scheduleOnMain(() -> this.disconnect(Component.literal("Book too large!")));
+ server.scheduleOnMain(() -> this.disconnect(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause
- this.disconnect(Component.literal("Book too large!"));
+ this.disconnect(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
return;
}
byteTotal += byteLength;
@ -297,8 +297,8 @@ index 1b9d530de9e69935eafe86c56e07b80e1128d680..6feee492addc939015c6c16c2aaa2c1c
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());
- server.scheduleOnMain(() -> this.disconnect(Component.literal("Book too large!")));
+ server.scheduleOnMain(() -> this.disconnect(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause
- this.disconnect(Component.literal("Book too large!"));
+ this.disconnect(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
return;
}
}
@ -404,8 +404,8 @@ index 1b9d530de9e69935eafe86c56e07b80e1128d680..6feee492addc939015c6c16c2aaa2c1c
// Paper start - auto recipe limit
if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
- this.server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam")));
+ this.server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
- this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam"));
+ this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause
return;
}
}

Datei anzeigen

@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 22 Jun 2021 19:58:53 +0100
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 6feee492addc939015c6c16c2aaa2c1c4a42bde3..014b8357f430309bc0d32c7f4e1a5d689305a917 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1118,7 +1118,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper end - Book size limits
// CraftBukkit start
if (this.lastBookTick + 20 > MinecraftServer.currentTick) {
- this.disconnect(Component.literal("Book edited too quickly!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
+ server.scheduleOnMain(() -> this.disconnect(Component.literal("Book edited too quickly!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause // Paper - Also ensure this is called on main
return;
}
this.lastBookTick = MinecraftServer.currentTick;

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerArmSwingEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 014b8357f430309bc0d32c7f4e1a5d689305a917..6da81426bf358ccc80ab3cff4b96dc0ed6e068c9 100644
index 1c76c6f8b60c65f73efdb30f695c2387a7e6fe1b..4e96a2a41f3e467e1595cc99ed6a4ce88a98672c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2413,7 +2413,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -55,7 +55,7 @@ index feb529adf2168025c785ab92d95a3246e73c0236..b43f87ff4b9853b5d4bbea5ff9686d64
MinecraftServer minecraftserver = this.server;
Connection networkmanager = this.connection;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 6da81426bf358ccc80ab3cff4b96dc0ed6e068c9..444584160d0d0fdbe359b31851028a65cbd09a8c 100644
index 4e96a2a41f3e467e1595cc99ed6a4ce88a98672c..e55b783ea9fcdf300346409f19c6973fb1d40a48 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1895,6 +1895,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Prevent AFK kick while watching end credits
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 444584160d0d0fdbe359b31851028a65cbd09a8c..dc84854a94d4ba83645aa03e81b9b07a4a4ebc0d 100644
index e55b783ea9fcdf300346409f19c6973fb1d40a48..045f510cf6ee120e00a13b2306d0c0ae9086b7fa 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -397,7 +397,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -17,7 +17,7 @@ Async catch modifications to critical entity state
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index dc84854a94d4ba83645aa03e81b9b07a4a4ebc0d..5757e26cad9d53ab80865bb0d113555c6aa158c2 100644
index 045f510cf6ee120e00a13b2306d0c0ae9086b7fa..147f2faac16e9dcaa6c63ff660978638567109ca 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1578,6 +1578,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Don't respond to ServerboundCommandSuggestionPacket when
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 5757e26cad9d53ab80865bb0d113555c6aa158c2..c72153d59c5c444706173dcd8daf85dd57bc56dd 100644
index 147f2faac16e9dcaa6c63ff660978638567109ca..c645dae6ba4fe15c1548300854a73e2ef9dca353 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -748,6 +748,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen