mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Fix commands not matching unicode-formatted homes, prevent dot in home names
This commit is contained in:
1 parent
bd4d173bdc
commit
7b1930e554
2 files changed
+5
-3
No files matched your search
@@ -9,7 +9,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Cross-platform manager for validating homes and warps and updating them as neccessary
|
||||
@@ -353,11 +352,14 @@ public class SavedPositionManager {
|
||||
if (positionMeta.name.length() > 16) {
|
||||
return Optional.of(SaveResult.ResultType.FAILED_NAME_LENGTH);
|
||||
}
|
||||
if (!allowUnicodeNames || positionMeta.name.contains(Pattern.quote("."))) {
|
||||
if (!allowUnicodeNames) {
|
||||
if (!RegexUtil.NAME_PATTERN.matcher(positionMeta.name).matches()) {
|
||||
return Optional.of(SaveResult.ResultType.FAILED_NAME_CHARACTERS);
|
||||
}
|
||||
}
|
||||
if (positionMeta.name.contains(".")) {
|
||||
return Optional.of(SaveResult.ResultType.FAILED_NAME_CHARACTERS);
|
||||
}
|
||||
if (positionMeta.description.length() > 255) {
|
||||
return Optional.of(SaveResult.ResultType.FAILED_DESCRIPTION_LENGTH);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user