Class QuestPlaceholders
java.lang.Object
me.clip.placeholderapi.PlaceholderHook
me.clip.placeholderapi.expansion.PlaceholderExpansion
rocks.gravili.notquests.spigot.placeholders.QuestPlaceholders
public class QuestPlaceholders
extends me.clip.placeholderapi.expansion.PlaceholderExpansion
This class will be registered through the register-method in the
plugins onEnable-method.
-
Constructor Summary
ConstructorsConstructorDescriptionQuestPlaceholders(NotQuests main) Since we register the expansion inside our own plugin, we can simply use this method here to get an instance of our plugin. -
Method Summary
Modifier and TypeMethodDescriptionbooleanBecause this is a internal class, this check is not needed and we can simply returntrueThe name of the person who created this expansion should go here.The placeholder identifier should go here.This is the version of the expansion.onPlaceholderRequest(org.bukkit.entity.Player player, String identifier) This is the method called when a placeholder with our identifier is found and needs a value.booleanpersist()Because this is an internal class, you must override this method to let PlaceholderAPI know to not unregister your expansion class when PlaceholderAPI is reloadedMethods inherited from class me.clip.placeholderapi.expansion.PlaceholderExpansion
configurationContains, equals, get, getBoolean, getConfigSection, getConfigSection, getDescription, getDouble, getInt, getLink, getLong, getName, getPlaceholderAPI, getPlaceholders, getPlugin, getRequiredPlugin, getString, getStringList, info, isRegistered, log, log, register, severe, severe, toString, unregister, warningMethods inherited from class me.clip.placeholderapi.PlaceholderHook
onRequest
-
Constructor Details
-
QuestPlaceholders
Since we register the expansion inside our own plugin, we can simply use this method here to get an instance of our plugin.- Parameters:
main- The instance of our plugin.
-
-
Method Details
-
persist
public boolean persist()Because this is an internal class, you must override this method to let PlaceholderAPI know to not unregister your expansion class when PlaceholderAPI is reloaded- Overrides:
persistin classme.clip.placeholderapi.expansion.PlaceholderExpansion- Returns:
- true to persist through reloads
-
canRegister
public boolean canRegister()Because this is a internal class, this check is not needed and we can simply returntrue- Overrides:
canRegisterin classme.clip.placeholderapi.expansion.PlaceholderExpansion- Returns:
- Always true since it's an internal class.
-
getAuthor
The name of the person who created this expansion should go here.
For convienience do we return the author from the plugin.yml- Specified by:
getAuthorin classme.clip.placeholderapi.expansion.PlaceholderExpansion- Returns:
- The name of the author as a String.
-
getIdentifier
The placeholder identifier should go here.
This is what tells PlaceholderAPI to call our onRequest method to obtain a value if a placeholder starts with our identifier.
The identifier has to be lowercase and can't contain _ or %- Specified by:
getIdentifierin classme.clip.placeholderapi.expansion.PlaceholderExpansion- Returns:
- The identifier in
%<identifier>_<value>%as String.
-
getVersion
This is the version of the expansion.
You don't have to use numbers, since it is set as a String.For convienience do we return the version from the plugin.yml
- Specified by:
getVersionin classme.clip.placeholderapi.expansion.PlaceholderExpansion- Returns:
- The version as a String.
-
onPlaceholderRequest
This is the method called when a placeholder with our identifier is found and needs a value.
We specify the value identifier in this method.
Since version 2.9.1 can you use OfflinePlayers in your requests.- Overrides:
onPlaceholderRequestin classme.clip.placeholderapi.PlaceholderHook- Parameters:
identifier- A String containing the identifier/value.- Returns:
- possibly-null String of the requested identifier.
-