1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-01-30 19:40:37 +01:00

Update upstream B/CB

This commit is contained in:
Zach Brown 2017-01-14 02:11:12 -06:00
parent ce10eb73f0
commit 538cd29d93
4 changed files with 26 additions and 9 deletions

View file

@ -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/ ***");

View file

@ -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();
+

@ -1 +1 @@
Subproject commit 59b32ee3f35b2b8d55337df9a86f2b480e23c39d
Subproject commit 39c5d6b4a11b3e7c2eeb12a8bae5495f95ccc247

@ -1 +1 @@
Subproject commit d5e7885c2e3c6a9bf6ba2af51896800d748877ad
Subproject commit 775f1e1f7f5783860ccb16feaf8c0cc53a6f9c18