From 8d26bacb7303d360f18706a41187b89df9156c00 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 27 Jul 2017 03:13:13 -0400 Subject: [PATCH] Fix a bug in recipe books that prevented them from working as they should --- Spigot-Server-Patches/Fix-Recipe-Books.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Spigot-Server-Patches/Fix-Recipe-Books.patch b/Spigot-Server-Patches/Fix-Recipe-Books.patch index 7c701b7d77..ba3ed18621 100644 --- a/Spigot-Server-Patches/Fix-Recipe-Books.patch +++ b/Spigot-Server-Patches/Fix-Recipe-Books.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix Recipe Books diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 682211cdd..0b0a34508 100644 +index 682211cdd..1fed465bf 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -27,8 +27,9 @@ index 682211cdd..0b0a34508 100644 itemstack = this.player.activeContainer.getSlot(packetplayinautorecipe_a.b).getItem(); - if (this.a(packetplayinautorecipe_a.a, itemstack)) { + // Paper start - improve validation -+ ItemStack to = this.player.activeContainer.getSlot(packetplayinautorecipe_a.c).getItem(); -+ if (this.a(packetplayinautorecipe_a.a, itemstack) && (to.isEmpty() || this.a(packetplayinautorecipe_a.a, to))) { ++ ItemStack to = this.player.inventory.getItem(packetplayinautorecipe_a.c); ++ ItemStack ref = packetplayinautorecipe_a.a; ++ if (this.a(ref, itemstack) && (to.isEmpty() || this.a(ref, to)) && (ref.getCount() + to.getCount() <= ref.getMaxStackSize())) { + // Paper end i = packetplayinautorecipe_a.a.getCount(); if (packetplayinautorecipe_a.c == -1) {