Add missing syntax error for /huskhomes command

This commit is contained in:
William278 committed 2022-09-06 00:00:21 +03:00
1 parent fb20325f92
commit 50289d9ca5
1 file changed
+12 -10
@@ -101,13 +101,15 @@ public class HuskHomesCommand extends CommandBase implements ConsoleExecutable,
newestVersion.ifPresentOrElse( newestVersion.ifPresentOrElse(
newVersion -> onlineUser.sendMessage( newVersion -> onlineUser.sendMessage(
new MineDown("[HuskHomes](#00fb9a bold) [| A new version of HuskHomes is available!" new MineDown("[HuskHomes](#00fb9a bold) [| A new version of HuskHomes is available!"
+ " (v" + newVersion + " (Running: v" + plugin.getPluginVersion() + ")](#00fb9a)")), + " (v" + newVersion + " (Running: v" + plugin.getPluginVersion() + ")](#00fb9a)")),
() -> onlineUser.sendMessage( () -> onlineUser.sendMessage(
new MineDown("[HuskHomes](#00fb9a bold) [| HuskHomes is up-to-date." new MineDown("[HuskHomes](#00fb9a bold) [| HuskHomes is up-to-date."
+ " (Running: v" + plugin.getPluginVersion() + ")](#00fb9a)")))); + " (Running: v" + plugin.getPluginVersion() + ")](#00fb9a)"))));
} }
case "migrate" -> plugin.getLocales().getLocale("error_console_command_only") case "migrate" -> plugin.getLocales().getLocale("error_console_command_only")
.ifPresent(onlineUser::sendMessage); .ifPresent(onlineUser::sendMessage);
default -> plugin.getLocales().getLocale("error_invalid_syntax", "/huskhomes [about|help|reload|update]")
.ifPresent(onlineUser::sendMessage);
} }
} }
@@ -127,8 +129,8 @@ public class HuskHomesCommand extends CommandBase implements ConsoleExecutable,
.stream().filter(command -> command instanceof ConsoleExecutable) .stream().filter(command -> command instanceof ConsoleExecutable)
.forEach(command -> plugin.getLoggingAdapter().log(Level.INFO, .forEach(command -> plugin.getLoggingAdapter().log(Level.INFO,
command.command + command.command +
(command.command.length() < 16 ? " ".repeat(16 - command.command.length()) : "") (command.command.length() < 16 ? " ".repeat(16 - command.command.length()) : "")
+ " - " + command.getDescription())); + " - " + command.getDescription()));
} }
case "reload" -> plugin.reload().thenAccept(reloaded -> { case "reload" -> plugin.reload().thenAccept(reloaded -> {
if (!reloaded) { if (!reloaded) {
@@ -140,10 +142,10 @@ public class HuskHomesCommand extends CommandBase implements ConsoleExecutable,
case "update" -> plugin.getLatestVersionIfOutdated().thenAccept(newestVersion -> case "update" -> plugin.getLatestVersionIfOutdated().thenAccept(newestVersion ->
newestVersion.ifPresentOrElse(newVersion -> plugin.getLoggingAdapter().log(Level.WARNING, newestVersion.ifPresentOrElse(newVersion -> plugin.getLoggingAdapter().log(Level.WARNING,
"An update is available for HuskHomes, v" + newVersion "An update is available for HuskHomes, v" + newVersion
+ " (Running v" + plugin.getPluginVersion() + ")"), + " (Running v" + plugin.getPluginVersion() + ")"),
() -> plugin.getLoggingAdapter().log(Level.INFO, () -> plugin.getLoggingAdapter().log(Level.INFO,
"HuskHomes is up to date" + "HuskHomes is up to date" +
" (Running v" + plugin.getPluginVersion() + ")"))); " (Running v" + plugin.getPluginVersion() + ")")));
case "migrate" -> { case "migrate" -> {
if (args.length < 2) { if (args.length < 2) {
plugin.getLoggingAdapter().log(Level.INFO, plugin.getLoggingAdapter().log(Level.INFO,
@@ -173,7 +175,7 @@ public class HuskHomesCommand extends CommandBase implements ConsoleExecutable,
}, () -> { }, () -> {
plugin.getLoggingAdapter().log(Level.INFO, plugin.getLoggingAdapter().log(Level.INFO,
"Please specify a valid migrator.\n" + "Please specify a valid migrator.\n" +
"If a migrator is not available, please verify that you meet the prerequisites to use it."); "If a migrator is not available, please verify that you meet the prerequisites to use it.");
logMigratorsList(); logMigratorsList();
}); });
} }
@@ -183,9 +185,9 @@ public class HuskHomesCommand extends CommandBase implements ConsoleExecutable,
private void logMigratorsList() { private void logMigratorsList() {
plugin.getLoggingAdapter().log(Level.INFO, plugin.getLoggingAdapter().log(Level.INFO,
"List of available migrators:\nMigrator ID / Migrator Name:\n" + "List of available migrators:\nMigrator ID / Migrator Name:\n" +
plugin.getMigrators().stream() plugin.getMigrators().stream()
.map(migrator -> migrator.getIdentifier() + " - " + migrator.getName()) .map(migrator -> migrator.getIdentifier() + " - " + migrator.getName())
.collect(Collectors.joining("\n"))); .collect(Collectors.joining("\n")));
} }
private void sendAboutMenu(@NotNull OnlineUser onlineUser) { private void sendAboutMenu(@NotNull OnlineUser onlineUser) {