From 46f91f5f112a5e6faf71e173394ba37886b497da Mon Sep 17 00:00:00 2001
From: Andre601 <11576465+Andre601@users.noreply.github.com>
Date: Tue, 26 Apr 2022 22:40:59 +0200
Subject: [PATCH] Add missing Javadoc comments
---
.../expansion/PlaceholderExpansion.java | 63 ++++++++++++-------
1 file changed, 40 insertions(+), 23 deletions(-)
diff --git a/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java b/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java
index e2970fe..e6496f7 100644
--- a/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java
+++ b/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java
@@ -401,9 +401,8 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
}
/**
- * PlaceholderAPI will call this method whenever a valid placeholder pattern with a matching
- * PlaceholderExpansion is found.
- *
The provided Player can be one of 3 possible states:
+ * This method is called first whenever PlaceholderAPI finds a valid placeholder with a matching expansion.
+ *
When called, the provided OfflinePlayer instance can be one of 3 possible states:
*
*
To use this method in your PlaceholderExpansion, override it. - * - *
When {@code null} is returned will PlaceholderAPI see this as "invalid placeholder" and - * return the placeholder as-is in the final String. + *
To use this method in your PlaceholderExpansion, override it and return either a String or {@code null}.
+ * 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 params from {@code %
When called, the provided Player instance can be one of 2 possible states:
+ *
+ *
+ *
+ *
+ * When not overridden by the called expansion will the method as of now call
+ * {@link PlaceholderHook#onPlaceholderRequest(Player, String) PlaceholderHook#onPlaceholderRequest(Player, String)}.
+ *
This behaviour will change in a future version to instead return {@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 ===