edit home, warp commands, manager methods that accept warps/homes

This commit is contained in:
William committed 2023-03-14 12:51:31 +00:00
1 parent a72109667a
commit 4ad77a53c1
11 files changed
+299 -443

No files matched your search

@@ -19,19 +19,22 @@ public class ValidationException extends IllegalArgumentException {
case NOT_FOUND -> other ? "error_home_invalid_other" : "error_home_invalid";
case NAME_TAKEN -> "error_home_name_taken";
case NAME_INVALID -> "error_home_name_characters";
case NOT_ENOUGH_HOME_SLOTS, REACHED_MAX_HOMES -> "error_set_home_maximum_homes";
case REACHED_MAX_PUBLIC_HOMES -> "error_edit_home_maximum_public_homes";
case DESCRIPTION_INVALID -> "error_home_description_characters";
}, args)
.ifPresent(viewer::sendMessage);
}
public void dispatchWarpError(@NotNull CommandUser viewer, @NotNull HuskHomes plugin) {
public void dispatchWarpError(@NotNull CommandUser viewer, @NotNull HuskHomes plugin, @NotNull String... args) {
plugin.getLocales()
.getLocale(switch (error) {
case NOT_FOUND -> "error_warp_invalid";
case NAME_TAKEN -> "error_warp_name_taken";
case NAME_INVALID -> "error_warp_name_characters";
case DESCRIPTION_INVALID -> "error_warp_description_characters";
})
default -> throw new IllegalStateException("Unexpected value: " + error);
}, args)
.ifPresent(viewer::sendMessage);
}