SPIGOT-1806: Add HumanEntity#getMainHand

By: Matthew <stteg@hotmail.com>
This commit is contained in:
Bukkit/Spigot 2016-03-11 13:02:00 -05:00
parent b10b2605b1
commit fe152f147f
2 changed files with 17 additions and 0 deletions

View File

@ -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;
@ -36,6 +37,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.

View File

@ -0,0 +1,9 @@
package org.bukkit.inventory;
/**
* Represents the chosen main hand of a player
*/
public enum MainHand {
LEFT,
RIGHT
}