From eba181d04d13a00727402cc761252e22c7e7a03c Mon Sep 17 00:00:00 2001 From: extendedclip Date: Fri, 1 Jun 2018 21:01:01 -0400 Subject: [PATCH] Revert return type back to String for new onPlaceholderRequest method --- src/main/java/me/clip/placeholderapi/PlaceholderAPI.java | 4 ++-- src/main/java/me/clip/placeholderapi/PlaceholderHook.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/clip/placeholderapi/PlaceholderAPI.java b/src/main/java/me/clip/placeholderapi/PlaceholderAPI.java index 7da56a6..e4cbdbe 100644 --- a/src/main/java/me/clip/placeholderapi/PlaceholderAPI.java +++ b/src/main/java/me/clip/placeholderapi/PlaceholderAPI.java @@ -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)); } } } diff --git a/src/main/java/me/clip/placeholderapi/PlaceholderHook.java b/src/main/java/me/clip/placeholderapi/PlaceholderHook.java index 075e71f..161898e 100644 --- a/src/main/java/me/clip/placeholderapi/PlaceholderHook.java +++ b/src/main/java/me/clip/placeholderapi/PlaceholderHook.java @@ -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); }