From 88cf954f4e5ce57f91da095525d9b79df5796843 Mon Sep 17 00:00:00 2001
From: CraftBukkit/Spigot <noreply+git-craftbukkit@papermc.io>
Date: Sat, 15 Jan 2011 19:33:28 -0800
Subject: [PATCH] Added item-in-hand related API.

By: sk89q <the.sk89q@gmail.com>
---
 .../org/bukkit/craftbukkit/entity/CraftHumanEntity.java   | 4 ++++
 .../craftbukkit/inventory/CraftInventoryPlayer.java       | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index ef09a416ab..38b9f575ce 100644
--- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -40,6 +40,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
         return getInventory().getItemInHand();
     }
 
+    public void setItemInHand(ItemStack item) {
+        getInventory().setItemInHand(item);
+    }
+
     @Override
     public String toString() {
         return "CraftHumanEntity{" + "id=" + getEntityId() + "name=" + getName() + '}';
diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
index 7140d36f15..af222f3c63 100644
--- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
+++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
@@ -22,6 +22,14 @@ public class CraftInventoryPlayer extends CraftInventory implements PlayerInvent
         return new CraftItemStack( getInventory().e() );
     }
 
+    public void setItemInHand(ItemStack stack) {
+        setItem( getHeldItemSlot(), stack );
+    }
+
+    public int getHeldItemSlot() {
+        return getInventory().c;
+    }
+
     public CraftItemStack getHelmet() {
         return getItem( getSize() + 0 );
     }