2024-04-24 15:46:45 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Mon, 5 Apr 2021 18:35:15 -0700
Subject: [PATCH] Don't ignore result of PlayerEditBookEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
2024-04-28 03:00:01 +02:00
index e385bad877dd7ab529e67a7dced5b53a0f55d795..8eef1b90b124d366970be0e90ff6c81581aaed29 100644
2024-04-24 15:46:45 +02:00
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
2024-04-25 23:21:18 +02:00
@@ -1152,7 +1152,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
2024-04-24 15:46:45 +02:00
List<Filterable<String>> list1 = pages.stream().map(this::filterableFromOutgoing).toList();
itemstack.set(DataComponents.WRITABLE_BOOK_CONTENT, new WritableBookContent(list1));
- CraftEventFactory.handleEditBookEvent(this.player, slotId, handItem, itemstack); // CraftBukkit
+ this.player.getInventory().setItem(slotId, CraftEventFactory.handleEditBookEvent(this.player, slotId, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent)
}
}