From ef73b765de8536f1bd126c9a1b7d711ba85fd72b Mon Sep 17 00:00:00 2001 From: BlitzOffline <52609756+BlitzOffline@users.noreply.github.com> Date: Fri, 24 Mar 2023 21:22:53 +0200 Subject: [PATCH] Make setPlaceholders behavior consistent with setRelationalPlaceholders Relational placeholders require an underscore after the identifier to be considered valid. For example: `%rel_chatchat_%` is valid but `%rel_chatchat%` is not. Normal placeholders did not require this and `%chatchat%` worked the same as `%chatchat_%`. --- .../java/me/clip/placeholderapi/replacer/CharsReplacer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java b/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java index afa910c..8848648 100644 --- a/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java +++ b/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java @@ -67,10 +67,14 @@ public final class CharsReplacer implements Replacer { hadSpace = true; break; } - if (p == closure.tail) { + if (p == closure.tail && identified) { invalid = false; break; } + if (p == closure.tail) { + identifier.append(p); + break; + } if (p == '_' && !identified) { identified = true;