Class ScriptPlaceholder
java.lang.Object
me.clip.placeholderapi.PlaceholderHook
me.clip.placeholderapi.expansion.PlaceholderExpansion
dev.magicmq.pyspigot.bukkit.manager.placeholder.ScriptPlaceholder
- All Implemented Interfaces:
me.clip.placeholderapi.expansion.Relational
public class ScriptPlaceholder
extends me.clip.placeholderapi.expansion.PlaceholderExpansion
implements me.clip.placeholderapi.expansion.Relational
A class that represents a script placeholder expansion.
A ScriptPlaceholder can have multiple individual placeholders. For example, a script with the name "test.py" could have "%script:test_placeholder1%" and "%script:test_placeholder2%". It will be up to the script to handle each individual placeholder.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class me.clip.placeholderapi.expansion.PlaceholderExpansion
me.clip.placeholderapi.expansion.PlaceholderExpansion.Type -
Field Summary
Fields inherited from class me.clip.placeholderapi.expansion.PlaceholderExpansion
expansionType -
Constructor Summary
ConstructorsConstructorDescriptionScriptPlaceholder(dev.magicmq.pyspigot.manager.script.Script script, PyFunction function, PyFunction relFunction, String author, String version) -
Method Summary
Modifier and TypeMethodDescriptionGet the author of this ScriptPlaceholder.Get the identifier of this ScriptPlaceholder.dev.magicmq.pyspigot.manager.script.ScriptGet the script associated with this ScriptPlaceholder.Get the version of this ScriptPlaceholder.onPlaceholderRequest(Player playerOne, Player playerTwo, String identifier) Called internally when the ScriptPlaceholder is used in a relational fashion.onRequest(OfflinePlayer player, String params) Called internally when the ScriptPlaceholder is used.booleanpersist()Indicates that the ScriptPlaceholder should persist when PlaceholderAPI is reloaded.Methods inherited from class me.clip.placeholderapi.expansion.PlaceholderExpansion
canRegister, configurationContains, equals, get, getBoolean, getConfigSection, getConfigSection, getDescription, getDouble, getExpansionType, getInt, getLink, getLong, getName, getPlaceholderAPI, getPlaceholders, getPlugin, getRequiredPlugin, getString, getStringList, info, isRegistered, log, log, register, setExpansionType, severe, severe, toString, unregister, warningMethods inherited from class me.clip.placeholderapi.PlaceholderHook
onPlaceholderRequest
-
Constructor Details
-
ScriptPlaceholder
public ScriptPlaceholder(dev.magicmq.pyspigot.manager.script.Script script, PyFunction function, PyFunction relFunction, String author, String version) - Parameters:
script- The script associated with this ScriptPlaceholderfunction- The function to call when the placeholder is usedrelFunction- The function to call when the relational placeholder is usedauthor- The author of this ScriptPlaceholderversion- The version of this ScriptPlaceholder
-
-
Method Details
-
getScript
public dev.magicmq.pyspigot.manager.script.Script getScript()Get the script associated with this ScriptPlaceholder.- Returns:
- The script associated with this ScriptPlaceholder
-
getAuthor
Get the author of this ScriptPlaceholder.- Specified by:
getAuthorin classme.clip.placeholderapi.expansion.PlaceholderExpansion- Returns:
- The author of this ScriptPlaceholder
-
getVersion
Get the version of this ScriptPlaceholder.- Specified by:
getVersionin classme.clip.placeholderapi.expansion.PlaceholderExpansion- Returns:
- The version of this ScriptPlaceholder
-
getIdentifier
Get the identifier of this ScriptPlaceholder.This is used to identify the script's placeholder. It will be in the format "script:name", where "name" is the name of the script (without the file extension, .py). For example, for a script named "test.py", the placeholder identifier will be "script:test".
- Specified by:
getIdentifierin classme.clip.placeholderapi.expansion.PlaceholderExpansion- Returns:
- The identifier of this ScriptPlaceholder
-
persist
public boolean persist()Indicates that the ScriptPlaceholder should persist when PlaceholderAPI is reloaded.- Overrides:
persistin classme.clip.placeholderapi.expansion.PlaceholderExpansion- Returns:
- True
-
onRequest
Called internally when the ScriptPlaceholder is used.- Overrides:
onRequestin classme.clip.placeholderapi.PlaceholderHook- Parameters:
player- TheOfflinePlayerassociated with the placeholder, or null if there is noneparams- The specific placeholder that was used (the ScriptPlaceholder expansion can have multiple individual placeholders. Scripts will handle each specific placeholder on their own)- Returns:
- The replaced text
-
onPlaceholderRequest
Called internally when the ScriptPlaceholder is used in a relational fashion.- Specified by:
onPlaceholderRequestin interfaceme.clip.placeholderapi.expansion.Relational- Parameters:
playerOne- The firstPlayerused for the placeholder.playerTwo- The secondPlayerused for the placeholder.identifier- The specific placeholder that was used, right after the relational aspect.- Returns:
- The replaced text
-