Use internal yaml resource for unsafe blocks by key, remove caching, fixes

This commit is contained in:
William committed 2022-11-23 21:51:23 +00:00
1 parent c4b16db9a9
commit a3ea62a85c
11 files changed
+215 -269

No files matched your search

@@ -86,13 +86,11 @@ public class HuskHomesCommand extends CommandBase implements ConsoleExecutable,
.ifPresent(onlineUser::sendMessage);
return;
}
plugin.reload().thenAccept(reloaded -> {
if (!reloaded) {
onlineUser.sendMessage(new MineDown("[Error:](#ff3300) [Failed to reload the plugin. Check console for errors.](#ff7e5e)"));
return;
}
onlineUser.sendMessage(new MineDown("[HuskHomes](#00fb9a bold) &#00fb9a&| Reloaded config & message files."));
});
if (!plugin.reload()) {
onlineUser.sendMessage(new MineDown("[Error:](#ff3300) [Failed to reload the plugin. Check console for errors.](#ff7e5e)"));
return;
}
onlineUser.sendMessage(new MineDown("[HuskHomes](#00fb9a bold) &#00fb9a&| Reloaded config & message files."));
}
case "update" -> {
if (!onlineUser.hasPermission(Permission.COMMAND_HUSKHOMES_UPDATE.node)) {
@@ -135,13 +133,13 @@ public class HuskHomesCommand extends CommandBase implements ConsoleExecutable,
(command.command.length() < 16 ? " ".repeat(16 - command.command.length()) : "")
+ " - " + command.getDescription()));
}
case "reload" -> plugin.reload().thenAccept(reloaded -> {
if (!reloaded) {
case "reload" -> {
if (!plugin.reload()) {
plugin.getLoggingAdapter().log(Level.SEVERE, "Failed to reload the plugin.");
return;
}
plugin.getLoggingAdapter().log(Level.INFO, "Reloaded config & message files.");
});
}
case "update" -> plugin.getLatestVersionIfOutdated().thenAccept(newestVersion ->
newestVersion.ifPresentOrElse(newVersion -> plugin.getLoggingAdapter().log(Level.WARNING,
"An update is available for HuskHomes, v" + newVersion