Skip to content

Commit

Permalink
better strip_color impl
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 18, 2021
1 parent 95d42b5 commit 231dad4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Expand Up @@ -303,7 +303,7 @@ public static void registerTags() {
// Returns the element with all color encoding stripped.
// -->
PropertyParser.<BukkitElementProperties>registerTag("strip_color", (attribute, object) -> {
return new ElementTag(ChatColor.stripColor(object.asString()));
return new ElementTag(FormattedTextHelper.parse(object.asString(), ChatColor.WHITE)[0].toPlainText());
});

// <--[tag]
Expand Down
Expand Up @@ -303,7 +303,6 @@ public int compare(Map.Entry<String, String> o1, Map.Entry<String, String> o2) {
// matches don't exist
regexId = entry.getKey();
regexMessage = triggerText.replace(matcher.group(), m.group());
Debug.log("entry value: " + triggerText + " keyword: " + keyword + " m.group: " + m.group() + " matcher.group: " + matcher.group());
context.put("keyword", new ElementTag(m.group()));
if (replace != null) {
regexMessage = replace;
Expand Down

0 comments on commit 231dad4

Please sign in to comment.