Class PapiExpansionService
java.lang.Object
com.zetaplugins.zetacore.services.papi.PapiExpansionService
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty PapiExpansionService.PapiExpansionService(String identifier, String author, String version, Logger logger) Creates a new PapiExpansionService with the given identifier, author, and version.PapiExpansionService(JavaPlugin plugin) Creates a new PapiExpansionService using the given plugin's information. -
Method Summary
Modifier and TypeMethodDescriptionAdds annotated placeholders from the given object.addPlaceholder(String key, PlaceholderFunction function) Adds a placeholder to the expansion.static booleanhasPapi()Checks if PlaceholderAPI is installedbooleanregister()Registers the expansion with PlaceholderAPIsetIdentifier(String identifier) setPlaceholders(Map<String, PlaceholderFunction> placeholders) Sets the placeholders for the expansion.setPlayerNotFoundMessage(@Nullable String playerNotFoundMessage) Sets the message to return when a player is not found.setPlayerNotOnlineMessage(@Nullable String playerNotOnlineMessage) Sets the message to return when a player is not online.setVersion(String version)
-
Constructor Details
-
PapiExpansionService
public PapiExpansionService()Creates a new empty PapiExpansionService. -
PapiExpansionService
Creates a new PapiExpansionService with the given identifier, author, and version.- Parameters:
identifier- The identifier of the expansionauthor- The author of the expansionversion- The version of the expansion
-
PapiExpansionService
Creates a new PapiExpansionService using the given plugin's information.- Parameters:
plugin- The plugin to use for the expansion information
-
-
Method Details
-
getIdentifier
-
setIdentifier
-
getAuthor
-
setAuthor
-
getVersion
-
setVersion
-
getLogger
-
setLogger
-
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
-
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
-
setPlaceholders
Sets the placeholders for the expansion.- Parameters:
placeholders- The map of placeholders- Returns:
- The PapiExpansionService instance
-
addPlaceholder
Adds a placeholder to the expansion.- Parameters:
key- The key of the placeholderfunction- The function to execute for the placeholder- Returns:
- The PapiExpansionService instance
-
addAnnotatedPlaceholders
Adds annotated placeholders from the given object. Methods annotated withPapiwill 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
Registers the expansion with PlaceholderAPI- Returns:
- True if the expansion was registered successfully, false otherwise
- Throws:
IllegalStateException
-