Class PapiExpansionService

java.lang.Object
com.zetaplugins.zetacore.services.papi.PapiExpansionService

public class PapiExpansionService extends Object
  • Constructor Details

    • PapiExpansionService

      public PapiExpansionService()
      Creates a new empty PapiExpansionService.
    • PapiExpansionService

      public PapiExpansionService(String identifier, String author, String version, Logger logger)
      Creates a new PapiExpansionService with the given identifier, author, and version.
      Parameters:
      identifier - The identifier of the expansion
      author - The author of the expansion
      version - The version of the expansion
    • PapiExpansionService

      public PapiExpansionService(JavaPlugin plugin)
      Creates a new PapiExpansionService using the given plugin's information.
      Parameters:
      plugin - The plugin to use for the expansion information
  • Method Details

    • getIdentifier

      public String getIdentifier()
    • setIdentifier

      public PapiExpansionService setIdentifier(String identifier)
    • getAuthor

      public String getAuthor()
    • setAuthor

      public PapiExpansionService setAuthor(String author)
    • getVersion

      public String getVersion()
    • setVersion

      public PapiExpansionService setVersion(String version)
    • getLogger

      public Logger getLogger()
    • setLogger

      public PapiExpansionService setLogger(Logger logger)
    • getPlayerNotFoundMessage

      public String getPlayerNotFoundMessage()
    • setPlayerNotFoundMessage

      public PapiExpansionService setPlayerNotFoundMessage(@Nullable @Nullable String playerNotFoundMessage)
      Sets the message to return when a player is not found.
      Parameters:
      playerNotFoundMessage - The message to set (default: "PlayerNotFound")
      Returns:
      The PapiExpansionService instance
    • getPlayerNotOnlineMessage

      public String getPlayerNotOnlineMessage()
    • setPlayerNotOnlineMessage

      public PapiExpansionService setPlayerNotOnlineMessage(@Nullable @Nullable String playerNotOnlineMessage)
      Sets the message to return when a player is not online.
      Parameters:
      playerNotOnlineMessage - The message to set (default: "PlayerNotOnline")
      Returns:
      The PapiExpansionService instance
    • getPlaceholders

      public Map<String,PlaceholderFunction> getPlaceholders()
    • setPlaceholders

      public PapiExpansionService setPlaceholders(Map<String,PlaceholderFunction> placeholders)
      Sets the placeholders for the expansion.
      Parameters:
      placeholders - The map of placeholders
      Returns:
      The PapiExpansionService instance
    • addPlaceholder

      public PapiExpansionService addPlaceholder(String key, PlaceholderFunction function)
      Adds a placeholder to the expansion.
      Parameters:
      key - The key of the placeholder
      function - The function to execute for the placeholder
      Returns:
      The PapiExpansionService instance
    • addAnnotatedPlaceholders

      public PapiExpansionService addAnnotatedPlaceholders(Object obj)
      Adds annotated placeholders from the given object. Methods annotated with Papi will be registered as placeholders.
      Parameters:
      obj - The object containing annotated methods
      Returns:
      The PapiExpansionService instance
    • hasPapi

      public static boolean hasPapi()
      Checks if PlaceholderAPI is installed
      Returns:
      True if PlaceholderAPI is installed, false otherwise
    • register

      public boolean register() throws IllegalStateException
      Registers the expansion with PlaceholderAPI
      Returns:
      True if the expansion was registered successfully, false otherwise
      Throws:
      IllegalStateException