fix book page limit length (#4932)

This commit is contained in:
Jake Potrebic 2020-12-23 14:52:56 -08:00
parent ec665f60d2
commit 5583c8c007

View file

@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ ItemStack testStack = packetplayinbedit.getBook();
+ if (!server.isPrimaryThread() && !testStack.isEmpty() && testStack.getTag() != null) {
+ 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");
+ minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
+ return;