Remove the item from the correct hand when spawn egg depletes

This commit is contained in:
Aikar 2016-06-18 03:44:11 -04:00
parent bf40dd5557
commit c8643cef2e
2 changed files with 36 additions and 2 deletions

View File

@ -1,4 +1,4 @@
From 31d6804e83b8c5f6100c0d1c3625f296ae721ee0 Mon Sep 17 00:00:00 2001
From 4c0a4516fb82d1b4436faa124c595d28c46d3f02 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@outlook.com>
Date: Sat, 18 Jun 2016 01:01:37 -0500
Subject: [PATCH] Make entities look for hoppers
@ -358,5 +358,5 @@ index 8717ae1..cefd659 100644
if (!list.isEmpty()) {
--
2.8.3
2.9.0

View File

@ -0,0 +1,34 @@
From 51086b7a0e474b8832ac8dd7e4ec5e2a21be1cfb Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 18 Jun 2016 01:49:22 -0400
Subject: [PATCH] Remove the item from the correct hand when spawn egg depletes
diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java
index 6092346..c1e9cbf 100644
--- a/src/main/java/net/minecraft/server/EntityAgeable.java
+++ b/src/main/java/net/minecraft/server/EntityAgeable.java
@@ -63,7 +63,7 @@ public abstract class EntityAgeable extends EntityCreature {
--itemstack.count;
// CraftBukkit start - allow less than 0 stacks as "infinite"
if (itemstack.count == 0) {
- entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
+ entityhuman.setHeldItem(enumhand, null); // Paper
}
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 22333ea..4e424aa 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1407,6 +1407,7 @@ public abstract class EntityLiving extends Entity {
}
}
+ public void setHeldItem(EnumHand enumhand, @Nullable ItemStack itemstack) { a(enumhand, itemstack); } // Paper // OBFHELPER
public void a(EnumHand enumhand, @Nullable ItemStack itemstack) {
if (enumhand == EnumHand.MAIN_HAND) {
this.setSlot(EnumItemSlot.MAINHAND, itemstack);
--
2.9.0