Package net.winmister332.libs.player
Class InventoryHelper
java.lang.Object
net.winmister332.libs.player.InventoryHelper
A wrapper class for a players' inventory and items within said inventory.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.inventory.PlayerInventorygetPlayerInventory(String playerNameOrID) Gets the inventory of the player with the specified name or UUID.static org.bukkit.inventory.PlayerInventorygetPlayerInventory(org.bukkit.entity.Player player) Gets the inventory of the specified player.static booleanplayerHasItem(org.bukkit.entity.Player player, org.bukkit.entity.Item item) Checks if a player has a specific item in their inventory.
-
Constructor Details
-
InventoryHelper
public InventoryHelper()
-
-
Method Details
-
getPlayerInventory
public static org.bukkit.inventory.PlayerInventory getPlayerInventory(org.bukkit.entity.Player player) Gets the inventory of the specified player.- Parameters:
player- The player.- Returns:
- The inventory of the specified player.
-
getPlayerInventory
Gets the inventory of the player with the specified name or UUID.- Parameters:
playerNameOrID- The name or UUID of the player.- Returns:
- The inventory of the player with the specified name or UUID.
-
playerHasItem
public static boolean playerHasItem(org.bukkit.entity.Player player, org.bukkit.entity.Item item) Checks if a player has a specific item in their inventory.- Parameters:
player- The player to check.item- The item to check.- Returns:
- True if the item is in the specified players' inventory.
-