Force all identifiers to lower case

This commit is contained in:
extendedclip 2020-07-31 11:40:44 -04:00
parent 9b2b6992c7
commit 2e28647497
2 changed files with 5 additions and 5 deletions

View File

@ -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<String, Object> 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)
{

View File

@ -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<String, @Nullable PlaceholderExpansion> lookup)
{
final char[] chars = text.toCharArray();
final char[] chars = text.toLowerCase().toCharArray();
final StringBuilder builder = new StringBuilder(text.length());
final StringBuilder identifier = new StringBuilder();