Paper/Remapped-Spigot-Server-Patches/0697-Don-t-ignore-result-of-PlayerEditBookEvent.patch

20 lines
1.2 KiB
Diff
Raw Normal View History

2021-06-11 13:56:17 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: jmp <jasonpenilla2@me.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 1add53082ab9382cb2e90dc8305b8c71ef1c6a46..65afc23f4791aca19bff78ed86b3b0d31fa81977 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1144,7 +1144,7 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener {
list.stream().map(StringTag::valueOf).forEach(nbttaglist::add);
ItemStack old = itemstack.copy(); // CraftBukkit
itemstack.addTagElement("pages", (Tag) nbttaglist);
- CraftEventFactory.handleEditBookEvent(player, i, old, itemstack); // CraftBukkit
+ this.player.inventory.setItem(i, CraftEventFactory.handleEditBookEvent(player, i, old, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent)
}
}