diff options
author | Matthew <stteg@hotmail.com> | 2016-03-11 13:02:00 -0500 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-03-12 08:14:54 +1100 |
commit | 032d1ff804d2a123e1a10d1917ba4c955a910e1e (patch) | |
tree | d5be2b3ab20715438e53d3505f22ff93c22faf3a /src/main | |
parent | 0c042936d8219121ae44d93c4fe0071ce7a9b50a (diff) | |
download | bukkit-032d1ff804d2a123e1a10d1917ba4c955a910e1e.tar bukkit-032d1ff804d2a123e1a10d1917ba4c955a910e1e.tar.gz bukkit-032d1ff804d2a123e1a10d1917ba4c955a910e1e.tar.lz bukkit-032d1ff804d2a123e1a10d1917ba4c955a910e1e.tar.xz bukkit-032d1ff804d2a123e1a10d1917ba4c955a910e1e.zip |
SPIGOT-1806: Add HumanEntity#getMainHand
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/entity/HumanEntity.java | 8 | ||||
-rw-r--r-- | src/main/java/org/bukkit/inventory/MainHand.java | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java index 3d216770..1ceb0728 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -2,6 +2,7 @@ package org.bukkit.entity; import org.bukkit.GameMode; import org.bukkit.Location; +import org.bukkit.inventory.MainHand; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.InventoryView; @@ -37,6 +38,13 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv public Inventory getEnderChest(); /** + * Gets the players selected main hand + * + * @return the players main hand + */ + public MainHand getMainHand(); + + /** * If the player currently has an inventory window open, this method will * set a property of that window, such as the state of a progress bar. * diff --git a/src/main/java/org/bukkit/inventory/MainHand.java b/src/main/java/org/bukkit/inventory/MainHand.java new file mode 100644 index 00000000..75f12f15 --- /dev/null +++ b/src/main/java/org/bukkit/inventory/MainHand.java @@ -0,0 +1,9 @@ +package org.bukkit.inventory; + +/** + * Represents the chosen main hand of a player + */ +public enum MainHand { + LEFT, + RIGHT +} |