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
This commit is contained in:
Nassim Jahnke
2024-06-16 12:56:00 +02:00
parent fc90ea0624
commit 78a67f00ea
4 changed files with 9 additions and 28 deletions

View File

@@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ 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 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ 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;
+ }
+ }