Further address locale issues (Targets #4083)

This commit is contained in:
Shane Freeder
2020-01-26 17:48:14 +00:00
parent 33f4ac14b5
commit 0ffcff53b3
18 changed files with 70 additions and 48 deletions

View File

@@ -28,6 +28,7 @@ import org.bukkit.command.PluginCommand;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public final class CommandRegistrationManager {
private CommandRegistrationManager() {};
@@ -36,8 +37,8 @@ public final class CommandRegistrationManager {
private static void registerSkillCommands() {
for (PrimarySkillType skill : PrimarySkillType.values()) {
String commandName = skill.toString().toLowerCase();
String localizedName = skill.getName().toLowerCase();
String commandName = skill.toString().toLowerCase(Locale.ENGLISH);
String localizedName = skill.getName().toLowerCase(Locale.ENGLISH);
PluginCommand command;

View File

@@ -17,6 +17,7 @@ import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public final class CommandUtils {
public static final List<String> TRUE_FALSE_OPTIONS = ImmutableList.of("on", "off", "true", "false", "enabled", "disabled");
@@ -302,7 +303,7 @@ public final class CommandUtils {
break;
}
if (playerName.toLowerCase().contains(partialName.toLowerCase())) {
if (playerName.toLowerCase(Locale.ENGLISH).contains(partialName.toLowerCase(Locale.ENGLISH))) {
// Partial match
matchedPlayers.add(playerName);
}