Paper/patches/server/0509-Don-t-ignore-result-of-PlayerEditBookEvent.patch

20 lines
1.3 KiB
Diff
Raw Normal View History

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
index 91f19079cefe3ff5d3defec3991b32225c283d8b..0f6f1b47f88f46f4d51704304b0504826cef3565 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-06-13 23:42:02 +02:00
@@ -1155,7 +1155,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)
}
}