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

@@ -19,6 +19,7 @@
package net.william278.huskhomes.network;
import net.kyori.adventure.key.InvalidKeyException;
import net.william278.huskhomes.HuskHomes;
import net.william278.huskhomes.position.Home;
import net.william278.huskhomes.position.Warp;
@@ -27,8 +28,10 @@ import net.william278.huskhomes.teleport.TeleportationException;
import net.william278.huskhomes.user.OnlineUser;
import org.jetbrains.annotations.NotNull;
import java.util.Locale;
import java.util.Optional;
import java.util.UUID;
import java.util.logging.Level;
public abstract class Broker {
@@ -149,12 +152,19 @@ public abstract class Broker {
*/
public abstract void close();
// Get the formatted channel ID for the broker
@NotNull
protected String getSubChannelId() {
final String version = plugin.getVersion().getMajor() + "." + plugin.getVersion().getMinor();
return plugin.getKey(plugin.getSettings().getClusterId(), version).asString();
final String version = String.format("%s.%s", plugin.getVersion().getMajor(), plugin.getVersion().getMinor());
try {
return plugin.getKey(plugin.getSettings().getClusterId().toLowerCase(Locale.ENGLISH), version).asString();
} catch (InvalidKeyException e) {
plugin.log(Level.SEVERE, "Cluster ID specified in config contains invalid characters");
}
return plugin.getKey("main", version).asString();
}
// Get the name of this server
@NotNull
protected String getServer() {
return plugin.getServerName();