mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
Revert return type back to String for new onPlaceholderRequest method
This commit is contained in:
parent
25758ee653
commit
eba181d04d
@ -232,9 +232,9 @@ public class PlaceholderAPI {
|
||||
String identifier = format.substring(0, index).toLowerCase();
|
||||
String params = format.substring(index + 1);
|
||||
if (hooks.containsKey(identifier)) {
|
||||
Object value = hooks.get(identifier).onPlaceholderRequest(player, params);
|
||||
String value = hooks.get(identifier).onPlaceholderRequest(player, params);
|
||||
if (value != null) {
|
||||
text = text.replaceAll(Pattern.quote(m.group()), Matcher.quoteReplacement(String.valueOf(value)));
|
||||
text = text.replaceAll(Pattern.quote(m.group()), Matcher.quoteReplacement(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public abstract class PlaceholderHook {
|
||||
* @param params String passed to the hook to determine what value to return
|
||||
* @return value for the requested player and params
|
||||
*/
|
||||
public Object onPlaceholderRequest(OfflinePlayer p, String params) {
|
||||
public String onPlaceholderRequest(OfflinePlayer p, String params) {
|
||||
if (p != null && p.isOnline()) {
|
||||
return onPlaceholderRequest((Player) p, params);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user