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

    Constructors
    Constructor
    Description
    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 Type
    Method
    Description
    boolean
    Because this is a internal class, this check is not needed and we can simply return true
    The 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.
    boolean
    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

    Methods 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, warning

    Methods inherited from class me.clip.placeholderapi.PlaceholderHook

    onRequest

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • QuestPlaceholders

      public QuestPlaceholders(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.
      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:
      persist in class me.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 return true
      Overrides:
      canRegister in class me.clip.placeholderapi.expansion.PlaceholderExpansion
      Returns:
      Always true since it's an internal class.
    • getAuthor

      public String 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:
      getAuthor in class me.clip.placeholderapi.expansion.PlaceholderExpansion
      Returns:
      The name of the author as a String.
    • getIdentifier

      public 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:
      getIdentifier in class me.clip.placeholderapi.expansion.PlaceholderExpansion
      Returns:
      The identifier in %<identifier>_<value>% as String.
    • getVersion

      public 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:
      getVersion in class me.clip.placeholderapi.expansion.PlaceholderExpansion
      Returns:
      The version as a String.
    • onPlaceholderRequest

      public String 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.
      We specify the value identifier in this method.
      Since version 2.9.1 can you use OfflinePlayers in your requests.
      Overrides:
      onPlaceholderRequest in class me.clip.placeholderapi.PlaceholderHook
      Parameters:
      identifier - A String containing the identifier/value.
      Returns:
      possibly-null String of the requested identifier.