v4.5: Bulk delete, regex customization, QoL & API work (#486)

* Improve validator error specificity, fix #481

* Add more sanity-checking to cluster IDs, close #482

* Add bulk/player-delete command, close #484, close #257

* Fix checkstyle formatting in tests

* Add missing strings to other locale files

* Use morepaperlib for runtime command registration on spigot

* api: make creation methods return a future, close #473

* Add name/description restriction regex customization

* docs: Update config file with new regex options

* bump version number to 4.5

* fix typo, correct command confirmation logic

* Make confirmation locales more clear

* Fix confirmation checking logic
This commit is contained in:
William authored and GitHub committed 2023-08-28 16:31:48 +01:00
1 parent e2c9a52911
commit 6bfd69f232
38 files changed
+1161 -692

No files matched your search

@@ -142,18 +142,31 @@ public class Settings {
@YamlKey("general.strict_tpa_here_requests")
private boolean strictTpaHereRequests = true;
// Name & description settings
@YamlComment("Whether home or warp names should be case insensitive (i.e. allow /home HomeOne and /home homeone)")
@YamlKey("general.case_insensitive_names")
private boolean caseInsensitiveNames = false;
@YamlComment("Whether home or warp names should allow UTF-8 characters (i.e. allow /home 你好)")
@YamlKey("general.allow_unicode_names")
private boolean allowUnicodeNames = false;
@YamlComment("Whether home and warp names should be restricted by a regex."
+ "Set this to false to allow full UTF-8 names (i.e. allow /home 你好).")
@YamlKey("towns.restrict_names")
private boolean restrictNames = true;
@YamlComment("Whether home or warp descriptions should allow UTF-8 characters")
@YamlKey("general.allow_unicode_descriptions")
private boolean allowUnicodeDescriptions = true;
@YamlComment("Regex which home and warp names must match. Names have a max length of 16 characters")
@YamlKey("towns.name_regex")
private String nameRegex = "[a-zA-Z0-9-_]*";
@YamlComment("Whether home/warp descriptions should be restricted. Set this to true to restrict UTF-8 usage.")
@YamlKey("towns.restrict_descriptions")
private boolean restrictDescriptions = false;
@YamlComment("Regex which home and warp descriptions must match. A hard max length of 256 characters is enforced")
@YamlKey("towns.description_regex")
private String descriptionRegex = "\\A\\p{ASCII}*\\z";
// Back command settings
@YamlComment("Whether /back should work to teleport the user to where they died")
@YamlKey("general.back_command_return_by_death")
private boolean backCommandReturnByDeath = true;
@@ -408,12 +421,22 @@ public class Settings {
return caseInsensitiveNames;
}
public boolean doAllowUnicodeNames() {
return allowUnicodeNames;
public boolean doRestrictNames() {
return restrictNames;
}
public boolean doAllowUnicodeDescriptions() {
return allowUnicodeDescriptions;
@NotNull
public String getNameRegex() {
return nameRegex;
}
public boolean doRestrictDescriptions() {
return restrictDescriptions;
}
@NotNull
public String getDescriptionRegex() {
return descriptionRegex;
}
public boolean doBackCommandReturnByDeath() {