Don't set default locale, instead use Locale.ENGLISH where possible
This commit is contained in:
@@ -194,12 +194,12 @@ public abstract class DisguiseBaseCommand implements CommandExecutor {
|
||||
return list;
|
||||
|
||||
Iterator<String> itel = list.iterator();
|
||||
String label = origArgs[origArgs.length - 1].toLowerCase();
|
||||
String label = origArgs[origArgs.length - 1].toLowerCase(Locale.ENGLISH);
|
||||
|
||||
while (itel.hasNext()) {
|
||||
String name = itel.next();
|
||||
|
||||
if (name.toLowerCase().startsWith(label))
|
||||
if (name.toLowerCase(Locale.ENGLISH).startsWith(label))
|
||||
continue;
|
||||
|
||||
itel.remove();
|
||||
|
@@ -14,6 +14,7 @@ import org.bukkit.command.TabCompleter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class LibsDisguisesCommand implements CommandExecutor, TabCompleter {
|
||||
@Getter
|
||||
@@ -41,12 +42,12 @@ public class LibsDisguisesCommand implements CommandExecutor, TabCompleter {
|
||||
return list;
|
||||
|
||||
Iterator<String> itel = list.iterator();
|
||||
String label = origArgs[origArgs.length - 1].toLowerCase();
|
||||
String label = origArgs[origArgs.length - 1].toLowerCase(Locale.ENGLISH);
|
||||
|
||||
while (itel.hasNext()) {
|
||||
String name = itel.next();
|
||||
|
||||
if (name.toLowerCase().startsWith(label))
|
||||
if (name.toLowerCase(Locale.ENGLISH).startsWith(label))
|
||||
continue;
|
||||
|
||||
itel.remove();
|
||||
@@ -104,7 +105,7 @@ public class LibsDisguisesCommand implements CommandExecutor, TabCompleter {
|
||||
LDCommand command = null;
|
||||
|
||||
for (LDCommand c : getCommands()) {
|
||||
if (!c.getTabComplete().contains(args[0].toLowerCase())) {
|
||||
if (!c.getTabComplete().contains(args[0].toLowerCase(Locale.ENGLISH))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -26,6 +26,7 @@ import org.bukkit.entity.Player;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCompleter {
|
||||
private int maxRadius = 30;
|
||||
@@ -98,7 +99,7 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom
|
||||
|
||||
if (starting == 0) {
|
||||
try {
|
||||
type = EntityType.valueOf(args[0].toUpperCase());
|
||||
type = EntityType.valueOf(args[0].toUpperCase(Locale.ENGLISH));
|
||||
}
|
||||
catch (Exception ignored) {
|
||||
}
|
||||
|
@@ -13,10 +13,7 @@ import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
public class UndisguisePlayerCommand implements CommandExecutor, TabCompleter {
|
||||
protected ArrayList<String> filterTabs(ArrayList<String> list, String[] origArgs) {
|
||||
@@ -24,12 +21,12 @@ public class UndisguisePlayerCommand implements CommandExecutor, TabCompleter {
|
||||
return list;
|
||||
|
||||
Iterator<String> itel = list.iterator();
|
||||
String label = origArgs[origArgs.length - 1].toLowerCase();
|
||||
String label = origArgs[origArgs.length - 1].toLowerCase(Locale.ENGLISH);
|
||||
|
||||
while (itel.hasNext()) {
|
||||
String name = itel.next();
|
||||
|
||||
if (name.toLowerCase().startsWith(label))
|
||||
if (name.toLowerCase(Locale.ENGLISH).startsWith(label))
|
||||
continue;
|
||||
|
||||
itel.remove();
|
||||
|
@@ -18,6 +18,7 @@ import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class DisguiseHelpCommand extends DisguiseBaseCommand implements TabCompleter {
|
||||
|
||||
@@ -80,7 +81,8 @@ public class DisguiseHelpCommand extends DisguiseBaseCommand implements TabCompl
|
||||
try {
|
||||
for (Method method : ParamInfoManager.getDisguiseWatcherMethods(watcher)) {
|
||||
if (args.length < 2 || !args[1].equalsIgnoreCase(LibsMsg.DHELP_SHOW.get())) {
|
||||
if (!perms.isAllowedDisguise(type, Collections.singleton(method.getName().toLowerCase()))) {
|
||||
if (!perms.isAllowedDisguise(type, Collections.singleton(method.getName().toLowerCase(
|
||||
Locale.ENGLISH)))) {
|
||||
ignored++;
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user