mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-27 14:34:57 +01:00
SPIGOT-1806: Implement HumanEntity#getMainHand
This commit is contained in:
parent
7d73fbba6e
commit
1fefbf9b98
1 changed files with 5 additions and 0 deletions
|
@ -7,6 +7,7 @@ import net.minecraft.server.*;
|
|||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.inventory.MainHand;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
|
@ -60,6 +61,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||
return enderChest;
|
||||
}
|
||||
|
||||
public MainHand getMainHand() {
|
||||
return getHandle().cr() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT; // PAIL Rename cr()->getMainHand()
|
||||
}
|
||||
|
||||
public ItemStack getItemInHand() {
|
||||
return getInventory().getItemInHand();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue