From 489fda430a491669e00f6c3c574c076684171a47 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 30 Jul 2017 18:41:08 -0400 Subject: [PATCH] Update Upstream --- .../PlayerPickupItemEvent-setFlyAtPlayer.patch | 2 +- Spigot-Server-Patches/Fix-Recipe-Books.patch | 17 +++++++++++++---- work/Bukkit | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Spigot-API-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch b/Spigot-API-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch index 54d10b94e3..015e5782fc 100644 --- a/Spigot-API-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/Spigot-API-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer diff --git a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java -index 29f03f5d..da19009b 100644 +index c76f423e..46c6d519 100644 --- a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java @@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityPickupItemEvent; diff --git a/Spigot-Server-Patches/Fix-Recipe-Books.patch b/Spigot-Server-Patches/Fix-Recipe-Books.patch index bd6d809ea9..847bd7a9de 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..5b9021939 100644 +index 682211cdd..034081cbe 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,13 +27,22 @@ index 682211cdd..5b9021939 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.inventory.getItem(packetplayinautorecipe_a.c); ++ int toSlot = packetplayinautorecipe_a.c; ++ ItemStack to = toSlot != -1 ? this.player.inventory.getItem(toSlot) : ItemStack.a; + 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) { - this.player.drop(packetplayinautorecipe_a.a, true); +- this.player.drop(packetplayinautorecipe_a.a, true); ++ // Paper start ++ this.player.drop(itemstack, true); ++ this.player.activeContainer.setItem(packetplayinautorecipe_a.b, ItemStack.a); ++ continue; ++ // Paper end + } else { + ItemStack itemstack1 = this.player.inventory.getItem(packetplayinautorecipe_a.c); + @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { itemstack.subtract(i); } @@ -55,7 +64,7 @@ index 682211cdd..5b9021939 100644 + // Paper start + ItemStack ref = packetplayinautorecipe_a.a; + ItemStack to = this.player.activeContainer.getSlot(packetplayinautorecipe_a.b).getItem(); -+ if (this.a(ref, itemstack) && (ref.getCount() + to.getCount() <= ref.getMaxStackSize())) { ++ 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 (itemstack.getCount() == i) { diff --git a/work/Bukkit b/work/Bukkit index a4b56a40cf..0ce77bc4b3 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit a4b56a40cf4830115938b1caf9e33c087edefd2d +Subproject commit 0ce77bc4b3825b1665b34f7dd6dc4b01a02e9443