mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
fix book page limit length (#4932)
This commit is contained in:
parent
ec665f60d2
commit
5583c8c007
@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ ItemStack testStack = packetplayinbedit.getBook();
|
+ ItemStack testStack = packetplayinbedit.getBook();
|
||||||
+ if (!server.isPrimaryThread() && !testStack.isEmpty() && testStack.getTag() != null) {
|
+ if (!server.isPrimaryThread() && !testStack.isEmpty() && testStack.getTag() != null) {
|
||||||
+ NBTTagList pageList = testStack.getTag().getList("pages", 8);
|
+ NBTTagList pageList = testStack.getTag().getList("pages", 8);
|
||||||
+ if (pageList.size() > 50) {
|
+ if (pageList.size() > 100) {
|
||||||
+ PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with too many pages");
|
+ PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with too many pages");
|
||||||
+ minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
|
+ minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
|
||||||
+ return;
|
+ return;
|
||||||
|
Loading…
Reference in New Issue
Block a user