PaperMC/Unmapped-Spigot-Server-Patches/0697-Don-t-ignore-result-of-PlayerEditBookEvent.patch

20 lines
1.2 KiB
Diff
Raw Normal View History

2021-04-06 03:46:31 +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/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 7d584e6d7b4e7b27ca0d51e0eb52a47169aa4b58..ed1e24f12590b8c37d2bd8e234f043bc30dd6cc8 100644
2021-04-06 03:46:31 +02:00
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -1146,7 +1146,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
2021-04-06 03:46:31 +02:00
list.stream().map(NBTTagString::a).forEach(nbttaglist::add);
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 // Paper - Don't ignore result (see other callsite for handleEditBookEvent)
}
}