From 538cd29d9325d2479eb0f56ae55a857312cde5dd Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Sat, 14 Jan 2017 02:11:12 -0600 Subject: [PATCH] Update upstream B/CB --- ...dated-Build-Download-URL-to-Paper-CI.patch | 2 +- .../Custom-replacement-for-eaten-items.patch | 29 +++++++++++++++---- work/Bukkit | 2 +- work/CraftBukkit | 2 +- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Spigot-Server-Patches/Change-Outdated-Build-Download-URL-to-Paper-CI.patch b/Spigot-Server-Patches/Change-Outdated-Build-Download-URL-to-Paper-CI.patch index 8364a6ca65..1bfc7bf0e5 100644 --- a/Spigot-Server-Patches/Change-Outdated-Build-Download-URL-to-Paper-CI.patch +++ b/Spigot-Server-Patches/Change-Outdated-Build-Download-URL-to-Paper-CI.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { - deadline.add(Calendar.DAY_OF_YEAR, -7); + deadline.add(Calendar.DAY_OF_YEAR, -10); if (buildDate.before(deadline.getTime())) { System.err.println("*** Error, this build is outdated ***"); - System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/ ***"); diff --git a/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch b/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch index 958bd078bc..8f85d649c8 100644 --- a/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch +++ b/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch @@ -5,20 +5,37 @@ Subject: [PATCH] Custom replacement for eaten items diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index bf8fbac4e..21603953c 100644 +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { - ItemStack itemstack = (craftItem.equals(event.getItem())) ? this.activeItem.a(this.world, this) : CraftItemStack.asNMSCopy(event.getItem()).a(world, this); - this.a(this.cz(), itemstack); - // CraftBukkit end -+ + + protected void v() { + if (!this.activeItem.isEmpty() && this.isHandRaised()) { ++ PlayerItemConsumeEvent event = null; // Paper + this.a(this.activeItem, 16); + // CraftBukkit start - fire PlayerItemConsumeEvent + ItemStack itemstack; + if (this instanceof EntityPlayer) { + org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.activeItem); +- PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem); ++ event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem); // Paper + world.getServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { +@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { + itemstack = this.activeItem.a(this.world, this); + } + + // Paper start - save the default replacement item and change it if necessary + final ItemStack defaultReplacement = itemstack; -+ if (event.getReplacement() != null) { ++ if (event != null && event.getReplacement() != null) { + itemstack = CraftItemStack.asNMSCopy(event.getReplacement()); + } + // Paper end ++ + this.a(this.cz(), itemstack); + // CraftBukkit end + this.cF(); + diff --git a/work/Bukkit b/work/Bukkit index 59b32ee3f3..39c5d6b4a1 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 59b32ee3f35b2b8d55337df9a86f2b480e23c39d +Subproject commit 39c5d6b4a11b3e7c2eeb12a8bae5495f95ccc247 diff --git a/work/CraftBukkit b/work/CraftBukkit index d5e7885c2e..775f1e1f7f 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit d5e7885c2e3c6a9bf6ba2af51896800d748877ad +Subproject commit 775f1e1f7f5783860ccb16feaf8c0cc53a6f9c18