Update upstream B/CB
This commit is contained in:
@@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
@@ -0,0 +0,0 @@ public class Main {
|
@@ -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())) {
|
if (buildDate.before(deadline.getTime())) {
|
||||||
System.err.println("*** Error, this build is outdated ***");
|
System.err.println("*** Error, this build is outdated ***");
|
||||||
- System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/ ***");
|
- System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/ ***");
|
||||||
|
|||||||
@@ -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
|
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
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
+++ b/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 {
|
@@ -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);
|
protected void v() {
|
||||||
// CraftBukkit end
|
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
|
+ // Paper start - save the default replacement item and change it if necessary
|
||||||
+ final ItemStack defaultReplacement = itemstack;
|
+ final ItemStack defaultReplacement = itemstack;
|
||||||
+ if (event.getReplacement() != null) {
|
+ if (event != null && event.getReplacement() != null) {
|
||||||
+ itemstack = CraftItemStack.asNMSCopy(event.getReplacement());
|
+ itemstack = CraftItemStack.asNMSCopy(event.getReplacement());
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
+
|
||||||
|
this.a(this.cz(), itemstack);
|
||||||
|
// CraftBukkit end
|
||||||
+
|
+
|
||||||
this.cF();
|
this.cF();
|
||||||
+
|
+
|
||||||
|
|||||||
Submodule work/Bukkit updated: 59b32ee3f3...39c5d6b4a1
Submodule work/CraftBukkit updated: d5e7885c2e...775f1e1f7f
Reference in New Issue
Block a user