mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 16:50:17 +01:00
812618deba
Unintended side effects in recent versions, this patch has likely outlived its usefulness. Closes GH-452
34 lines
1.7 KiB
Diff
34 lines
1.7 KiB
Diff
From 4920562b7fa90aae47dc8b2ede5bd9457f1f5689 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 526a608..c0c60a7 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.3
|
|
|