aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0530-Don-t-ignore-result-of-PlayerEditBookEvent.patch
blob: ff433de537624eac1737f7dd6a8e8bbe2e81a2d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 f455c7ab48accf581a8ecdbc78a12b055dbd19fa..0ff1e65df2b3c131ed65f8b769bbf369a76aa3d0 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1187,7 +1187,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
         }
 
         itemstack.addTagElement("pages", nbttaglist);
-        CraftEventFactory.handleEditBookEvent(this.player, slot, handItem, itemstack); // CraftBukkit
+        this.player.getInventory().setItem(slot, CraftEventFactory.handleEditBookEvent(this.player, slot, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent)
     }
 
     @Override