mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-09 22:21:49 +01:00
Force all identifiers to lower case
This commit is contained in:
parent
9b2b6992c7
commit
2e28647497
@ -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)
|
||||
{
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user