From 221508dce3904cf52a65aaf1e58a2ac3a4089080 Mon Sep 17 00:00:00 2001 From: LukBukkit Date: Sat, 19 Nov 2016 12:40:42 +0100 Subject: Fix cancelling PlayerEditBookEvent --- nms-patches/PlayerConnection.patch | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch index d52bdf5d..ad338f9a 100644 --- a/nms-patches/PlayerConnection.patch +++ b/nms-patches/PlayerConnection.patch @@ -1553,12 +1553,12 @@ } } else { String s1; -@@ -1062,10 +2139,12 @@ +@@ -1062,10 +2139,11 @@ } itemstack2.a("pages", (NBTBase) nbttaglist); +- this.player.setSlot(EnumItemSlot.MAINHAND, itemstack2); + CraftEventFactory.handleEditBookEvent(player, itemstack2); // CraftBukkit - this.player.setSlot(EnumItemSlot.MAINHAND, itemstack2); } } catch (Exception exception1) { PlayerConnection.LOGGER.error("Couldn\'t sign book", exception1); @@ -1566,7 +1566,7 @@ } } else if ("MC|TrSel".equals(s)) { try { -@@ -1077,6 +2156,7 @@ +@@ -1077,6 +2155,7 @@ } } catch (Exception exception2) { PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2); @@ -1574,7 +1574,7 @@ } } else { TileEntity tileentity; -@@ -1126,6 +2206,7 @@ +@@ -1126,6 +2205,7 @@ } } catch (Exception exception3) { PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3); @@ -1582,7 +1582,7 @@ } } else if ("MC|AutoCmd".equals(s)) { if (!this.minecraftServer.getEnableCommandBlock()) { -@@ -1193,6 +2274,7 @@ +@@ -1193,6 +2273,7 @@ } } catch (Exception exception4) { PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4); @@ -1590,7 +1590,7 @@ } } else { int k; -@@ -1216,6 +2298,7 @@ +@@ -1216,6 +2297,7 @@ } } catch (Exception exception5) { PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5); @@ -1598,7 +1598,7 @@ } } } else if ("MC|ItemName".equals(s)) { -@@ -1302,6 +2385,7 @@ +@@ -1302,6 +2384,7 @@ } } catch (Exception exception6) { PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6); @@ -1606,7 +1606,7 @@ } } else if ("MC|PickItem".equals(s)) { packetdataserializer = packetplayincustompayload.b(); -@@ -1316,9 +2400,31 @@ +@@ -1316,9 +2399,31 @@ PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7); } } -- cgit v1.2.3