mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 22:17:17 +00:00
Use internal yaml resource for unsafe blocks by key, remove caching, fixes
This commit is contained in:
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) �fb9a&| 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) �fb9a&| 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
|
||||
|
||||
@@ -62,9 +62,9 @@ public class RtpCommand extends CommandBase implements ConsoleExecutable {
|
||||
}
|
||||
final Instant currentTime = Instant.now();
|
||||
if (isExecutorTeleporting && !currentTime.isAfter(userData.get().rtpCooldown())
|
||||
&& !onlineUser.hasPermission(Permission.BYPASS_RTP_COOLDOWN.node)) {
|
||||
&& !onlineUser.hasPermission(Permission.BYPASS_RTP_COOLDOWN.node)) {
|
||||
plugin.getLocales().getLocale("error_rtp_cooldown",
|
||||
Long.toString(currentTime.until(userData.get().rtpCooldown(), ChronoUnit.MINUTES)))
|
||||
Long.toString(currentTime.until(userData.get().rtpCooldown(), ChronoUnit.MINUTES) + 1))
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class RtpCommand extends CommandBase implements ConsoleExecutable {
|
||||
teleportFuture.thenAccept(teleport -> teleport.execute()
|
||||
.thenAccept(result -> {
|
||||
if (isExecutorTeleporting &&
|
||||
result.successful() && !onlineUser.hasPermission(Permission.BYPASS_RTP_COOLDOWN.node)) {
|
||||
result.successful() && !onlineUser.hasPermission(Permission.BYPASS_RTP_COOLDOWN.node)) {
|
||||
plugin.getDatabase().updateUserData(new UserData(onlineUser,
|
||||
userData.get().homeSlots(), userData.get().ignoringTeleports(),
|
||||
Instant.now().plus(plugin.getSettings().rtpCooldownLength, ChronoUnit.MINUTES)));
|
||||
|
||||
Reference in new issue
Block a user