mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
use Locale.ROOT for uppercase as well
This commit is contained in:
@ -181,7 +181,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
}
|
||||
state = LegacyMapper.getInstance().getBlockFromLegacy(id, data);
|
||||
} else {
|
||||
BlockType type = BlockTypes.get(split[0].toLowerCase());
|
||||
BlockType type = BlockTypes.get(split[0].toLowerCase(Locale.ROOT));
|
||||
if (type != null) {
|
||||
int data = Integer.parseInt(split[1]);
|
||||
if (data < 0 || data >= 16) {
|
||||
@ -247,7 +247,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
state = item.getType().getBlockType().getDefaultState();
|
||||
nbt = item.getNbtData();
|
||||
} else {
|
||||
BlockType type = BlockTypes.parse(typeString.toLowerCase());
|
||||
BlockType type = BlockTypes.parse(typeString.toLowerCase(Locale.ROOT));
|
||||
|
||||
if (type != null) {
|
||||
state = type.getDefaultState();
|
||||
@ -309,15 +309,15 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
if (blockAndExtraData.length > 1) {
|
||||
String mobName = blockAndExtraData[1];
|
||||
for (MobType mobType : MobType.values()) {
|
||||
if (mobType.getName().toLowerCase().equals(mobName.toLowerCase())) {
|
||||
if (mobType.getName().toLowerCase().equals(mobName.toLowerCase(Locale.ROOT))) {
|
||||
mobName = mobType.getName();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS).isValidMobType(mobName)) {
|
||||
String finalMobName = mobName.toLowerCase();
|
||||
String finalMobName = mobName.toLowerCase(Locale.ROOT);
|
||||
throw new SuggestInputParseException("Unknown mob type '" + mobName + "'", mobName, () -> Stream.of(MobType.values())
|
||||
.map(m -> m.getName().toLowerCase())
|
||||
.map(m -> m.getName().toLowerCase(Locale.ROOT))
|
||||
.filter(s -> s.startsWith(finalMobName))
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import com.sk89q.worldedit.world.block.BlockCategory;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -49,7 +50,7 @@ public class BlockCategoryPatternParser extends InputParser<Pattern> {
|
||||
if (!input.startsWith("##")) {
|
||||
return null;
|
||||
}
|
||||
String tag = input.substring(2).toLowerCase();
|
||||
String tag = input.substring(2).toLowerCase(Locale.ROOT);
|
||||
boolean anyState = false;
|
||||
if (tag.startsWith("*")) {
|
||||
tag = tag.substring(1);
|
||||
|
@ -49,6 +49,7 @@ import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@ -107,7 +108,7 @@ public class DefaultPatternParser extends FaweParser<Pattern> {
|
||||
() -> {
|
||||
if (full.length() == 1) return new ArrayList<>(dispatcher.getPrimaryAliases());
|
||||
return dispatcher.getAliases().stream().filter(
|
||||
s -> s.startsWith(command.toLowerCase())
|
||||
s -> s.startsWith(command.toLowerCase(Locale.ROOT))
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user