Interface PlayerClass


public interface PlayerClass
Represents a read-only view of a player class configuration.

Player classes define starting equipment and passive abilities that players can select before or during a game. Each class provides a unique playstyle with different kit items and special abilities.

Example Usage


 ClassService classService = ZentrixProvider.get().getClassService();

 // Get a specific class
 Optional<PlayerClass> warrior = classService.getClass("warrior");
 warrior.ifPresent(pc -> {
     String name = pc.getDisplayName();
     String desc = pc.getDescription();
     Material icon = pc.getIconMaterial();

     player.sendMessage("Class: " + name);
     player.sendMessage("Description: " + desc);
 });
 
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    Gets a description of the class's passive ability.
    @Nullable String
    Gets the ability type for this class.
    @NotNull String
    Gets the description of this class.
    @NotNull String
    Gets the display name of this class.
    @NotNull org.bukkit.inventory.ItemStack
    Gets a clone of the icon ItemStack used in GUIs.
    @NotNull org.bukkit.Material
    Gets the icon material for this class.
    default int
    Gets the number of items in this class's kit.
    @NotNull List<org.bukkit.inventory.ItemStack>
    Gets clones of the kit items provided by this class.
    @NotNull List<String>
    Gets the lore lines displayed in the class selection GUI.
    @NotNull String
    Gets the unique type identifier for this class.
    boolean
    Checks if this class has a passive ability.
    default boolean
    Checks if this class has any kit items.
    default boolean
    Checks if this class has lore configured.
  • Method Details

    • getType

      @NotNull @NotNull String getType()
      Gets the unique type identifier for this class.

      This is the internal name used to identify the class (e.g., "WARRIOR", "ARCHER", "MINER").

      Returns:
      The class type identifier (never null)
    • getDisplayName

      @NotNull @NotNull String getDisplayName()
      Gets the display name of this class.

      This is the formatted name shown in GUIs and messages, including color codes.

      Returns:
      The display name (never null)
    • getDescription

      @NotNull @NotNull String getDescription()
      Gets the description of this class.

      A brief explanation of what this class does and its playstyle.

      Returns:
      The description (never null)
    • getIconMaterial

      @NotNull @NotNull org.bukkit.Material getIconMaterial()
      Gets the icon material for this class.

      This material is used to represent the class in selection GUIs.

      Returns:
      The icon material (never null)
    • getIconItem

      @NotNull @NotNull org.bukkit.inventory.ItemStack getIconItem()
      Gets a clone of the icon ItemStack used in GUIs.

      This may be a custom item with special display properties. Returns a clone to prevent modification of the original.

      Returns:
      A clone of the icon ItemStack (never null)
    • getLore

      @NotNull @NotNull List<String> getLore()
      Gets the lore lines displayed in the class selection GUI.

      These lines provide additional information about the class, such as ability details and kit contents.

      Returns:
      An unmodifiable list of lore lines (never null, may be empty)
    • getKitItems

      @NotNull @NotNull List<org.bukkit.inventory.ItemStack> getKitItems()
      Gets clones of the kit items provided by this class.

      These items are given to the player when the game starts if they have this class selected. Returns clones to prevent modification of the original items.

      Returns:
      An unmodifiable list of kit item clones (never null, may be empty)
    • getKitItemCount

      default int getKitItemCount()
      Gets the number of items in this class's kit.
      Returns:
      The kit item count
    • hasAbility

      boolean hasAbility()
      Checks if this class has a passive ability.
      Returns:
      true if an ability is configured
    • getAbilityType

      @Nullable @Nullable String getAbilityType()
      Gets the ability type for this class.

      Returns null if the class has no ability configured.

      Returns:
      The ability type, or null if none
    • getAbilityDescription

      @NotNull @NotNull String getAbilityDescription()
      Gets a description of the class's passive ability.

      Returns an empty string if no ability is configured.

      Returns:
      The ability description (never null)
    • hasKitItems

      default boolean hasKitItems()
      Checks if this class has any kit items.
      Returns:
      true if the class provides kit items
    • hasLore

      default boolean hasLore()
      Checks if this class has lore configured.
      Returns:
      true if lore lines are configured