Class CustomBags

java.lang.Object
valorless.havenbags.features.CustomBags

public class CustomBags extends Object
  • Field Details

    • file

      public static valorless.valorlessutils.config.Config file
    • bags

      public static HashMap<String,org.bukkit.inventory.ItemStack> bags
  • Constructor Details

    • CustomBags

      public CustomBags()
  • Method Details

    • initiate

      public static void initiate()
    • list

      public static List<String> list()
    • give

      public static void give(org.bukkit.entity.Player player, String value)
    • requiresPlayer

      public static boolean requiresPlayer(String key)
      Checks if a custom bag key requires a player context when created via get(String, Player).

      Returns true when the bag has predefined/custom content and needs a player to initialize owner-bound data.

      Parameters:
      key - custom bag key
      Returns:
      true if a player is required for this bag key
    • get

      public static org.bukkit.inventory.ItemStack get(String key, @Nullable org.bukkit.entity.Player player)
      Creates a custom bag item for the provided key.

      The player argument is only used when requiresPlayer(String) returns true for the provided key. If it returns false, the player value is not used for predefined content initialization.

      Parameters:
      key - custom bag key
      player - player context; only required/used when requiresPlayer(String) is true
      Returns:
      the created and configured bag ItemStack
      Throws:
      NullPointerException - if a player context is required but player is null
      IllegalArgumentException - if the provided key does not exist in the custom bags configuration