This commit is contained in:
PiggyPiglet 2021-12-24 12:34:36 +08:00
parent 348b075ac5
commit 850633e792
No known key found for this signature in database
GPG Key ID: 0DADDAC359165A31

View File

@ -126,14 +126,15 @@ public final class CharsReplacer implements Replacer {
} }
} }
final String identifierString = identifier.toString().toLowerCase(); final String identifierString = identifier.toString();
final String lowercaseIdentifierString = identifierString.toLowerCase();
final String parametersString = parameters.toString(); final String parametersString = parameters.toString();
identifier.setLength(0); identifier.setLength(0);
parameters.setLength(0); parameters.setLength(0);
if (oopsitsbad) { if (oopsitsbad) {
builder.append(closure.head).append(identifier); builder.append(closure.head).append(identifierString);
if (identified) { if (identified) {
builder.append('_').append(parametersString); builder.append('_').append(parametersString);
@ -145,9 +146,9 @@ public final class CharsReplacer implements Replacer {
continue; continue;
} }
final PlaceholderExpansion placeholder = lookup.apply(identifierString); final PlaceholderExpansion placeholder = lookup.apply(lowercaseIdentifierString);
if (placeholder == null) { if (placeholder == null) {
builder.append(closure.head).append(identifierString); builder.append(closure.head).append(lowercaseIdentifierString);
if (identified) { if (identified) {
builder.append('_'); builder.append('_');
@ -159,7 +160,7 @@ public final class CharsReplacer implements Replacer {
final String replacement = placeholder.onRequest(player, parametersString); final String replacement = placeholder.onRequest(player, parametersString);
if (replacement == null) { if (replacement == null) {
builder.append(closure.head).append(identifierString); builder.append(closure.head).append(lowercaseIdentifierString);
if (identified) { if (identified) {
builder.append('_'); builder.append('_');