From 2e28647497860b00b7342fd104ef5848a8fc459d Mon Sep 17 00:00:00 2001 From: extendedclip Date: Fri, 31 Jul 2020 11:40:44 -0400 Subject: [PATCH] Force all identifiers to lower case --- .../expansion/manager/LocalExpansionManager.java | 8 ++++---- .../me/clip/placeholderapi/replacer/CharsReplacer.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java b/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java index 2781e7f..cec3c90 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java +++ b/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java @@ -167,12 +167,12 @@ public final class LocalExpansionManager implements Listener @ApiStatus.Internal public boolean register(@NotNull final PlaceholderExpansion expansion) { - final String identifier = expansion.getIdentifier(); + final String identifier = expansion.getIdentifier().toLowerCase(); if (expansion instanceof Configurable) { Map defaults = ((Configurable) expansion).getDefaults(); - String pre = "expansions." + expansion.getIdentifier() + "."; + String pre = "expansions." + identifier + "."; FileConfiguration cfg = plugin.getConfig(); boolean save = false; @@ -221,7 +221,7 @@ public final class LocalExpansionManager implements Listener } } - final PlaceholderExpansion removed = expansions.get(expansion.getIdentifier()); + final PlaceholderExpansion removed = expansions.get(identifier); if (removed != null && !removed.unregister()) { return false; @@ -235,7 +235,7 @@ public final class LocalExpansionManager implements Listener return false; } - expansions.put(expansion.getIdentifier(), expansion); + expansions.put(identifier, expansion); if (expansion instanceof Listener) { diff --git a/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java b/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java index 5b2c2a4..f40deec 100644 --- a/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java +++ b/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java @@ -44,7 +44,7 @@ public final class CharsReplacer implements Replacer @Override public String apply(@NotNull final String text, @Nullable final OfflinePlayer player, @NotNull final Function lookup) { - final char[] chars = text.toCharArray(); + final char[] chars = text.toLowerCase().toCharArray(); final StringBuilder builder = new StringBuilder(text.length()); final StringBuilder identifier = new StringBuilder();