From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Mon, 25 Jan 2021 10:22:28 -0600
Subject: [PATCH] Fix PlayerEditBookEvent not saving new book


diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 9ff35aa827cf5b937b8dcbcabafd27301574c35d..f7a031920c68d5d5d505d86ab1b513ac53f5bf84 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1065,7 +1065,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
             list.stream().map(s -> s = color(s, hasPerm, false)).map(NBTTagString::a).forEach(nbttaglist::add); // Purpur - edit book
             ItemStack old = itemstack.cloneItemStack(); // CraftBukkit
             itemstack.a("pages", (NBTBase) nbttaglist);
-            CraftEventFactory.handleEditBookEvent(player, i, old, itemstack); // CraftBukkit
+            this.player.inventory.setItem(i, CraftEventFactory.handleEditBookEvent(player, i, old, itemstack)); // CraftBukkit // Purpur
         }
     }
 
