Paper/patches/unapplied/server/0589-Don-t-ignore-result-of-PlayerEditBookEvent.patch
2023-03-14 18:11:24 +01:00

20 lines
1.1 KiB
Diff

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 dd8bbf54f2b58d4e0ab7769640c1f76cdda55804..54ecd6cc439fcd2e2dfd6c46abff5cbae3ff47d3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1282,7 +1282,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
itemstack.addTagElement("pages", nbttaglist);
- CraftEventFactory.handleEditBookEvent(player, slot, handItem, itemstack); // CraftBukkit
+ this.player.getInventory().setItem(slot, CraftEventFactory.handleEditBookEvent(player, slot, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent)
}
@Override