mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Use Locale.ROOT
This commit is contained in:
@ -43,7 +43,7 @@ public final class IncendoPaster {
|
||||
if (pasteApplication == null || pasteApplication.isEmpty()) {
|
||||
throw new IllegalArgumentException("paste application cannot be null, nor empty");
|
||||
}
|
||||
if (!VALID_APPLICATIONS.contains(pasteApplication.toLowerCase(Locale.ENGLISH))) {
|
||||
if (!VALID_APPLICATIONS.contains(pasteApplication.toLowerCase(Locale.ROOT))) {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Unknown application name: %s", pasteApplication));
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ public class ClipboardFormats {
|
||||
checkNotNull(format);
|
||||
|
||||
for (String key : format.getAliases()) {
|
||||
String lowKey = key.toLowerCase(Locale.ENGLISH);
|
||||
String lowKey = key.toLowerCase(Locale.ROOT);
|
||||
ClipboardFormat old = aliasMap.put(lowKey, format);
|
||||
if (old != null) {
|
||||
aliasMap.put(lowKey, old);
|
||||
@ -80,7 +80,7 @@ public class ClipboardFormats {
|
||||
}
|
||||
}
|
||||
for (String ext : format.getFileExtensions()) {
|
||||
String lowExt = ext.toLowerCase(Locale.ENGLISH);
|
||||
String lowExt = ext.toLowerCase(Locale.ROOT);
|
||||
fileExtensionMap.put(lowExt, format);
|
||||
}
|
||||
registeredFormats.add(format);
|
||||
@ -102,7 +102,7 @@ public class ClipboardFormats {
|
||||
@Nullable
|
||||
public static ClipboardFormat findByAlias(String alias) {
|
||||
checkNotNull(alias);
|
||||
return aliasMap.get(alias.toLowerCase(Locale.ENGLISH).trim());
|
||||
return aliasMap.get(alias.toLowerCase(Locale.ROOT).trim());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,7 +45,7 @@ public final class IncendoPaste implements Paster{
|
||||
if (pasteApplication == null || pasteApplication.isEmpty()) {
|
||||
throw new IllegalArgumentException("paste application cannot be null, nor empty");
|
||||
}
|
||||
if (!VALID_APPLICATIONS.contains(pasteApplication.toLowerCase(Locale.ENGLISH))) {
|
||||
if (!VALID_APPLICATIONS.contains(pasteApplication.toLowerCase(Locale.ROOT))) {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Unknown application name: %s", pasteApplication));
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
@ -812,7 +813,7 @@ public final class BlockTypes {
|
||||
for (Field field : oldFields) {
|
||||
if (field.getType() == int.class) {
|
||||
int internalId = field.getInt(null);
|
||||
String id = "minecraft:" + field.getName().toLowerCase();
|
||||
String id = "minecraft:" + field.getName().toLowerCase(Locale.ROOT);
|
||||
String defaultState = blockMap.remove(id);
|
||||
if (defaultState == null) {
|
||||
if (internalId != 0) {
|
||||
@ -844,7 +845,7 @@ public final class BlockTypes {
|
||||
|
||||
// Add to $Registry
|
||||
for (BlockType type : values) {
|
||||
$REGISTRY.put(type.getId().toLowerCase(), type);
|
||||
$REGISTRY.put(type.getId().toLowerCase(Locale.ROOT), type);
|
||||
}
|
||||
states = stateList.toArray(new BlockState[stateList.size()]);
|
||||
|
||||
@ -888,7 +889,7 @@ public final class BlockTypes {
|
||||
*/
|
||||
|
||||
public static BlockType parse(final String type) throws InputParseException {
|
||||
final String inputLower = type.toLowerCase();
|
||||
final String inputLower = type.toLowerCase(Locale.ROOT);
|
||||
String input = inputLower;
|
||||
|
||||
if (!input.split("\\[", 2)[0].contains(":")) input = "minecraft:" + input;
|
||||
|
Reference in New Issue
Block a user