Class GravesXAPI

java.lang.Object
dev.cwhead.GravesX.api.GravesXAPI

public final class GravesXAPI extends Object
Facade exposing the modular GravesX APIs. Obtain from your plugin on enable and keep a reference.
  • Field Details

    • gravesCreate

      public final GraveCreationAPI gravesCreate
      Grave creation operations.
    • gravesManage

      public final GraveManagementAPI gravesManage
      Grave management operations.
    • world

      public final LocationAPI world
      World/location helpers.
    • inventory

      public final InventoryAPI inventory
      Inventory helpers.
    • skin

      public final SkinAPI skin
      Skin/texture helpers.
    • addon

      public final AddonAPI addon
      Addon helpers.
    • util

      public final UtilAPI util
      Utilities (permissions, XP, colors, files, YAML, paste, etc.).
  • Constructor Details

    • GravesXAPI

      public GravesXAPI(@NotNull @NotNull Graves plugin)
      Initializes the GravesXAPI facade with all modular API components.

      This constructor sets up and wires together the modular API classes:

      • LocationAPI – helpers for world and location utilities
      • UtilAPI – general-purpose helpers (Base64, colors, XP, permissions, etc.)
      • InventoryAPI – helpers for inventories, conversions, and equipping players
      • SkinAPI – helpers for skins, skulls, and player textures
      • AddonAPI – helpers for managing addons and their configuration
      • GraveManagementAPI – operations for managing existing graves
      • GraveCreationAPI – operations for creating new graves

      Each sub-API is created and linked to the given Graves plugin instance. Consumers should obtain this facade once (e.g., in onEnable()) and re-use it for accessing all modular APIs.

      Parameters:
      plugin - The active Graves plugin instance used to initialize APIs
  • Method Details

    • getLocationAPI

      @NotNull public @NotNull LocationAPI getLocationAPI()
      Provides access to world and location utility methods.

      This includes helpers for converting between Location and string representations, rounding coordinates, working with chunks, and simplifying BlockFace values.

      Returns:
      the LocationAPI instance
    • getUtilAPI

      @NotNull public @NotNull UtilAPI getUtilAPI()
      Provides access to general-purpose utility methods.

      This includes helpers for Base64 encoding/decoding, colors, particles, permissions, experience calculations, materials, resources, files, YAML validation, reflection, and version updates.

      Returns:
      the UtilAPI instance
    • getInventoryAPI

      @NotNull public @NotNull InventoryAPI getInventoryAPI()
      Provides access to inventory utility methods.

      This includes helpers for converting inventories to and from strings, equipping players with armor or items, and determining valid inventory sizes.

      Returns:
      the InventoryAPI instance
    • getSkinAPI

      @NotNull public @NotNull SkinAPI getSkinAPI()
      Provides access to skin and texture utility methods.

      This includes helpers for retrieving and applying player skin textures, setting skull textures, and accessing GameProfile information for players.

      Returns:
      the SkinAPI instance
    • getAddonAPI

      @NotNull public @NotNull AddonAPI getAddonAPI()
      Provides access to addon management utility methods.

      This includes ensuring addon folders exist and exporting addon configuration files from packaged resources.

      Returns:
      the AddonAPI instance
    • getGravesManagementAPI

      @NotNull public @NotNull GraveManagementAPI getGravesManagementAPI()
      Provides access to grave management utility methods.

      This includes removing, breaking, looting, abandoning, and counting graves, as well as proximity checks.

      Returns:
      the GraveManagementAPI instance
    • getGravesCreationAPI

      @NotNull public @NotNull GraveCreationAPI getGravesCreationAPI()
      Provides access to grave creation utility methods.

      This includes creating new graves with various options such as equipment, items, experience, locations, protection, and custom causes.

      Returns:
      the GraveCreationAPI instance
    • plugin

      @NotNull public @NotNull Graves plugin()
      Underlying Graves plugin (advanced usage).