Reorder and add more world blacklisted names

This commit is contained in:
Ben Woo 2023-09-11 11:41:40 +08:00
parent d02cd63244
commit bf7a708fb3
No known key found for this signature in database
GPG Key ID: FB2A3645536E12C8

View File

@ -19,7 +19,13 @@ import java.util.regex.Pattern;
public class WorldNameChecker {
private static final Pattern WORLD_NAME_PATTERN = Pattern.compile("[a-zA-Z0-9/._-]+");
private static final Set<String> BLACKLIST_NAMES = Set.of("plugins", "logs", "cache", "crash-reports"); // TODO: Configurable blacklist names
private static final Set<String> BLACKLIST_NAMES = Set.of(
"cache",
"config",
"crash-reports",
"logs",
"plugins",
"versions");
/**
* Checks if a world name is valid.