mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 8a29f5894 [Auto] Updated Upstream (Bukkit/CraftBukkit) 8756d232c Expose server protocol version (#5416) 4492bc4cc remove l4j class no longer in existence from preload list be1370517 Updated Upstream (CraftBukkit) (#5484) d560151ec Bump mysql-connector-java to 8.0.23 (Fixes #5473) (#5474) 61f400f11 Update log4j to 2.11.2 for JDK 9+ compat (#5400) a98196585 Updated Upstream (Bukkit/CraftBukkit) de138fac4 [Auto] Updated Upstream (Bukkit) 304a216ba [CI-SKIP] Ignore gitignore when adding files in automation d8e384a16 [CI-SKIP] Drop `Allow PlayerEditBookEvent to fire for off hand` (#5471) Tuinity Changes: d5261ad29 Do not load chunks for getCubes by default da9cf9828 Don't read neighbor chunk data off disk when converting chunks a0aa5ab07 Do not load 1 radius neighbors for lighting 5ccfa52a2 Fix terrible patch times af53d703a Stop large move vectors in player packet handling from killing the server 6e56ee735 Fix OBFHELPER for flushHeaderin RegionFile 995d05c1c Do not update TE's in generating chunks Airplane Changes: 8de8e82a2 Update upstream (Tuinity)
35 lines
2.6 KiB
Diff
35 lines
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <blake.galbreath@gmail.com>
|
|
Date: Wed, 23 Dec 2020 00:43:59 -0600
|
|
Subject: [PATCH] PlayerBookTooLargeEvent
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
index e39e46cf3cb646dd100b698cbc6d4f9b6896696d..f9a232cbc5dc55f3de2286037ca526b15c0842ba 100644
|
|
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
@@ -1121,6 +1121,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
NBTTagList pageList = testStack.getTag().getList("pages", 8);
|
|
if (pageList.size() > 100) {
|
|
PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with too many pages");
|
|
+ net.pl3x.purpur.event.player.PlayerBookTooLargeEvent event = new net.pl3x.purpur.event.player.PlayerBookTooLargeEvent(player.getBukkitEntity(), testStack.asBukkitCopy()); if (event.shouldKickPlayer()) // Purpur
|
|
minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
|
|
return;
|
|
}
|
|
@@ -1133,6 +1134,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
|
|
if (byteLength > 256 * 4) {
|
|
PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with with a page too large!");
|
|
+ net.pl3x.purpur.event.player.PlayerBookTooLargeEvent event = new net.pl3x.purpur.event.player.PlayerBookTooLargeEvent(player.getBukkitEntity(), testStack.asBukkitCopy()); if (event.shouldKickPlayer()) // Purpur
|
|
minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
|
|
return;
|
|
}
|
|
@@ -1156,6 +1158,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
|
|
if (byteTotal > byteAllowed) {
|
|
PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
|
|
+ net.pl3x.purpur.event.player.PlayerBookTooLargeEvent event = new net.pl3x.purpur.event.player.PlayerBookTooLargeEvent(player.getBukkitEntity(), testStack.asBukkitCopy()); if (event.shouldKickPlayer()) // Purpur
|
|
minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
|
|
return;
|
|
}
|