Houston, we got a patch (#2731)
* Houston, we got a patch * is this the end of the beginning or the beginning of the end
This commit is contained in:
@@ -5,11 +5,11 @@ Subject: [PATCH] Prevent consuming the wrong itemstack
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 31d14b19b..f675ad2f5 100644
|
||||
index 1b5acf77e..d04ea03bc 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 {
|
||||
this.datawatcher.set(EntityLiving.ar, (byte) j);
|
||||
this.datawatcher.set(EntityLiving.ao, (byte) j);
|
||||
}
|
||||
|
||||
- public void c(EnumHand enumhand) {
|
||||
@@ -22,25 +22,25 @@ index 31d14b19b..f675ad2f5 100644
|
||||
- if (!itemstack.isEmpty() && !this.isHandRaised()) {
|
||||
+ if (!itemstack.isEmpty() && !this.isHandRaised() || forceUpdate) { // Paper use override flag
|
||||
this.activeItem = itemstack;
|
||||
this.bo = itemstack.k();
|
||||
this.bl = itemstack.k();
|
||||
if (!this.world.isClientSide) {
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
protected void q() {
|
||||
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
|
||||
+ this.updateActiveItem(this.getRaisedHand(), true); // Paper
|
||||
PlayerItemConsumeEvent event = null; // Paper
|
||||
this.b(this.activeItem, 16);
|
||||
// CraftBukkit start - fire PlayerItemConsumeEvent
|
||||
this.clearActiveItem();
|
||||
} else {
|
||||
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
|
||||
+ this.updateActiveItem(this.getRaisedHand(), true); // Paper
|
||||
this.b(this.activeItem, 16);
|
||||
// CraftBukkit start - fire PlayerItemConsumeEvent
|
||||
ItemStack itemstack;
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
this.a(this.getRaisedHand(), itemstack);
|
||||
// CraftBukkit end
|
||||
this.dp();
|
||||
- // Paper start - if the replacement is anything but the default, update the client inventory
|
||||
- if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {
|
||||
+ // Paper start
|
||||
+ if (this instanceof EntityPlayer) {
|
||||
((EntityPlayer) this).getBukkitEntity().updateInventory();
|
||||
}
|
||||
// Paper end
|
||||
this.a(this.getRaisedHand(), itemstack);
|
||||
// CraftBukkit end
|
||||
this.dH();
|
||||
- // Paper start - if the replacement is anything but the default, update the client inventory
|
||||
- if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {
|
||||
+ // Paper start
|
||||
+ if (this instanceof EntityPlayer) {
|
||||
((EntityPlayer) this).getBukkitEntity().updateInventory();
|
||||
}
|
||||
// Paper end
|
||||
--
|
||||
Reference in New Issue
Block a user