[<expansion name>]
}
*
* @param level The Level at which the message should be logged with
* @param msg The message to log
*/
public void log(Level level, String msg) {
getPlaceholderAPI().getLogger().log(level, "[" + getName() + "] " + msg);
}
/**
* Logs the provided message and Throwable with the provided Level in the console.
* [<expansion name>]
}
*
* @param level The Level at which the message should be logged with
* @param msg The message to log
* @param throwable The Throwable to log
*/
public void log(Level level, String msg, Throwable throwable) {
getPlaceholderAPI().getLogger().log(level, "[" + getName() + "] " + msg, throwable);
}
/**
* Logs the provided message with Level "info".
* [<expansion name>]
}
*
* @param msg The message to log
*/
public void info(String msg) {
log(Level.INFO, msg);
}
/**
* Logs the provided message with Level "warning".
* [<expansion name>]
}
*
* @param msg The message to log
*/
public void warning(String msg) {
log(Level.WARNING, msg);
}
/**
* Logs the provided message with Level "severe" (error).
* [<expansion name>]
}
*
* @param msg The message to log
*/
public void severe(String msg) {
log(Level.SEVERE, msg);
}
/**
* Logs the provided message and Throwable with Level "severe" (error).
* [<expansion name>]
}
*
* @param msg The message to log
* @param throwable The Throwable to log
*/
public void severe(String msg, Throwable throwable) {
log(Level.SEVERE, msg, throwable);
}
/**
* Whether the provided Object is an instance of this PlaceholderExpansion.
* To use this method in your PlaceholderExpansion, override it and return either a String or {@code null}.
*
When {@code null} is returned will PlaceholderAPI see it as an "invalid placeholder" and return
* the content as-is in the final String.
*
* @param player The OfflinePlayer to use.
* @param params The parameters of the placeholder, right after the first underscore.
* @return Parsed placeholder, or null depending on the Expansion's handling of it.
*/
@Nullable
public String parsePlaceholders(@Nullable OfflinePlayer player, @NotNull String params) {
return this.onRequest(player, params);
}
/**
* This method is called whenever PlaceholderAPI finds a valid placeholder with a matching expansion
* AND {@link #parsePlaceholders(OfflinePlayer, String) parsePlaceholder(OfflinePlayer, String)} isn't
* overridden by the expansion in question.
*
When called, the provided Player instance can be one of 2 possible states:
*
*
To use this method in your PlaceholderExpansion, override it and return either a String or {@code null}.
*
When {@code null} is returned will PlaceholderAPI see it as an "invalid placeholder" and return
* the content as-is in the final String.
*
* @param player The Player to use. May be null
* @param params The parameters of the placeholder, right after the first underscore.
* @return Parsed placeholder, or null depending on the Expansion's handling of it.
*/
@Nullable
public String parsePlaceholders(@Nullable Player player, @NotNull String params){
return this.onPlaceholderRequest(player, params);
}
// === Deprecated API ===
/**
* @deprecated As of versions greater than 2.8.7, use {@link #getRequiredPlugin()}
*
* @return The plugin name.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
public String getPlugin() {
return null;
}
/**
* @deprecated As of versions greater than 2.8.7, use the expansion cloud to show a description
*
* @return The description of the expansion.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
public String getDescription() {
return null;
}
/**
* @deprecated As of versions greater than 2.8.7, use the expansion cloud to display a link
*
* @return The link for the expansion.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
public String getLink() {
return null;
}
}