mirror of
https://github.com/aikar/commands.git
synced 2026-05-31 06:11:55 +00:00
Add allow illegal name manager option
This commit is contained in:
committed by
chickeneer
parent
720e43cbac
commit
905d5406ec
@@ -31,7 +31,7 @@ public class ACFSpongeUtil {
|
||||
}
|
||||
|
||||
if (matches.isEmpty()) {
|
||||
if (!isValidName(name)) {
|
||||
if (!isValidName(name, issuer.getManager())) {
|
||||
issuer.sendError(MinecraftMessageKeys.IS_NOT_A_VALID_NAME, "{name}", name);
|
||||
return null;
|
||||
}
|
||||
@@ -89,8 +89,8 @@ public class ACFSpongeUtil {
|
||||
return matchedPlayers;
|
||||
}
|
||||
|
||||
public static boolean isValidName(String name) {
|
||||
return name != null && !name.isEmpty() && ACFPatterns.VALID_NAME_PATTERN.matcher(name).matches();
|
||||
public static boolean isValidName(String name, CommandManager manager) {
|
||||
return name != null && !name.isEmpty() && (manager.isAllowInvalidName() || ACFPatterns.VALID_NAME_PATTERN.matcher(name).matches());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user