Class InventoryHelper

java.lang.Object
net.winmister332.libs.player.InventoryHelper

public final class InventoryHelper extends Object
A wrapper class for a players' inventory and items within said inventory.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.inventory.PlayerInventory
    getPlayerInventory(String playerNameOrID)
    Gets the inventory of the player with the specified name or UUID.
    static org.bukkit.inventory.PlayerInventory
    getPlayerInventory(org.bukkit.entity.Player player)
    Gets the inventory of the specified player.
    static boolean
    playerHasItem(org.bukkit.entity.Player player, org.bukkit.entity.Item item)
    Checks if a player has a specific item in their inventory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static org.bukkit.inventory.PlayerInventory getPlayerInventory(String playerNameOrID)
      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.