From 05af3d3db2d6e98c995752109907bffb3f054915 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Fri, 13 Sep 2024 17:31:00 +0200 Subject: [PATCH] Accept time durations in timer commands Closes #134 --- .github/CHANGELOG.md | 2 + .../core/proxy/MaintenanceProxyPlugin.java | 21 +++++----- .../subcommand/SingleEndtimerCommand.java | 14 ++++--- .../SingleScheduleTimerCommand.java | 24 ++++++----- .../subcommand/SingleStarttimerCommand.java | 14 ++++--- .../SingleMaintenanceScheduleRunnable.java | 11 +++-- .../maintenance/core/MaintenancePlugin.java | 11 ++--- .../core/command/MaintenanceCommand.java | 40 ++++++++++++++----- .../command/subcommand/EndtimerCommand.java | 8 ++-- .../subcommand/ScheduleTimerCommand.java | 13 +++--- .../command/subcommand/StarttimerCommand.java | 8 ++-- .../runnable/MaintenanceScheduleRunnable.java | 5 +-- core/src/main/resources/language-da.yml | 4 +- core/src/main/resources/language-de.yml | 4 +- core/src/main/resources/language-en.yml | 18 ++++----- core/src/main/resources/language-es.yml | 4 +- core/src/main/resources/language-fr.yml | 4 +- core/src/main/resources/language-hu.yml | 4 +- core/src/main/resources/language-it.yml | 4 +- core/src/main/resources/language-ja.yml | 4 +- core/src/main/resources/language-ko.yml | 4 +- core/src/main/resources/language-pl.yml | 4 +- core/src/main/resources/language-pt.yml | 4 +- core/src/main/resources/language-ru.yml | 4 +- core/src/main/resources/language-sv.yml | 4 +- core/src/main/resources/language-tr.yml | 4 +- core/src/main/resources/language-uk.yml | 4 +- core/src/main/resources/language-vi.yml | 4 +- core/src/main/resources/language-zh.yml | 4 +- 29 files changed, 143 insertions(+), 110 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 1a1885ce..14324a58 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -6,6 +6,8 @@ This file contains update logs for this project. The top may contain a `Unreleas ## Unreleased ### Changed * Added alternative player count and player list hover message for when endtimers are running, similar to the existing ping messages setting. They are disabled by default and can be found in their `player-count-message` and `player-list-hover-message` config sections +* All timer commands now accept durations like `2h30m`, `1h30m5s`, or `90s`. The default behavior without units will still be in minutes + * The language defaults will not automatically update, you might want to manually update the command help strings or just delete your language file * Slightly reorganized the configuration file (it will be automatically migrated on startup, but new sections will be slapped at the bottom of the file) * The `fallback` field now also null values next to an empty array for disabling the feature * Updated language files from [Crowdin](https://crowdin.com/translate/maintenance) diff --git a/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/MaintenanceProxyPlugin.java b/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/MaintenanceProxyPlugin.java index 868db5a9..125ad576 100644 --- a/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/MaintenanceProxyPlugin.java +++ b/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/MaintenanceProxyPlugin.java @@ -32,15 +32,13 @@ import eu.kennytv.maintenance.core.util.SenderInfo; import eu.kennytv.maintenance.core.util.ServerType; import eu.kennytv.maintenance.core.util.Task; -import org.jetbrains.annotations.Blocking; -import org.jetbrains.annotations.Nullable; - import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; +import java.time.Duration; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,7 +46,8 @@ import java.util.Map; import java.util.Set; import java.util.UUID; -import java.util.concurrent.TimeUnit; +import org.jetbrains.annotations.Blocking; +import org.jetbrains.annotations.Nullable; /** * @author kennytv @@ -146,15 +145,15 @@ public void cancelSingleTask(final Server server) { } } - public MaintenanceRunnableBase startSingleMaintenanceRunnable(final Server server, final long duration, final TimeUnit unit, final boolean enable) { - final MaintenanceRunnableBase runnable = new SingleMaintenanceRunnable(this, settingsProxy, (int) unit.toSeconds(duration), enable, server); + public MaintenanceRunnableBase startSingleMaintenanceRunnable(final Server server, final Duration duration, final boolean enable) { + final MaintenanceRunnableBase runnable = new SingleMaintenanceRunnable(this, settingsProxy, (int) duration.getSeconds(), enable, server); serverTasks.put(server.getName(), runnable.getTask()); return runnable; } - public MaintenanceRunnableBase scheduleSingleMaintenanceRunnable(final Server server, final long duration, final long maintenanceDuration, final TimeUnit unit) { + public MaintenanceRunnableBase scheduleSingleMaintenanceRunnable(final Server server, final Duration enableIn, final Duration maintenanceDuration) { final MaintenanceRunnableBase runnable = new SingleMaintenanceScheduleRunnable(this, settingsProxy, - (int) unit.toSeconds(duration), (int) unit.toSeconds(maintenanceDuration), server); + (int) enableIn.getSeconds(), (int) maintenanceDuration.getSeconds(), server); serverTasks.put(server.getName(), runnable.getTask()); return runnable; } @@ -262,9 +261,9 @@ private ProfileLookup doUUIDLookupAshconAPI(final String name) throws IOExceptio private UUID fromStringUUIDWithoutDashes(String undashedUUID) { return UUID.fromString( - undashedUUID.substring(0, 8) + "-" + undashedUUID.substring(8, 12) + "-" + - undashedUUID.substring(12, 16) + "-" + undashedUUID.substring(16, 20) + "-" + - undashedUUID.substring(20, 32) + undashedUUID.substring(0, 8) + "-" + undashedUUID.substring(8, 12) + "-" + + undashedUUID.substring(12, 16) + "-" + undashedUUID.substring(16, 20) + "-" + + undashedUUID.substring(20, 32) ); } diff --git a/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleEndtimerCommand.java b/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleEndtimerCommand.java index f01ff1af..59ddf501 100644 --- a/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleEndtimerCommand.java +++ b/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleEndtimerCommand.java @@ -22,9 +22,9 @@ import eu.kennytv.maintenance.core.proxy.command.ProxyCommandInfo; import eu.kennytv.maintenance.core.runnable.MaintenanceRunnableBase; import eu.kennytv.maintenance.core.util.SenderInfo; +import java.time.Duration; import java.util.Collections; import java.util.List; -import java.util.concurrent.TimeUnit; public final class SingleEndtimerCommand extends ProxyCommandInfo { @@ -41,7 +41,9 @@ public boolean hasPermission(final SenderInfo sender) { public void execute(final SenderInfo sender, final String[] args) { if (args.length == 2) { if (checkPermission(sender, "timer")) return; - if (plugin.getCommandManager().checkTimerArgs(sender, args[1])) { + + final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[1]); + if (duration == null) { sender.send(getHelpMessage()); return; } @@ -50,11 +52,13 @@ public void execute(final SenderInfo sender, final String[] args) { return; } - plugin.startMaintenanceRunnable(Integer.parseInt(args[1]), TimeUnit.MINUTES, false); + plugin.startMaintenanceRunnable(duration, false); sender.send(getMessage("endtimerStarted", "%TIME%", plugin.getRunnable().getTime())); } else if (args.length == 3) { if (checkPermission(sender, "singleserver.timer")) return; - if (plugin.getCommandManager().checkTimerArgs(sender, args[2], false)) { + + final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[2], false); + if (duration == null) { sender.send(getHelpMessage()); return; } @@ -66,7 +70,7 @@ public void execute(final SenderInfo sender, final String[] args) { return; } - final MaintenanceRunnableBase runnable = plugin.startSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), TimeUnit.MINUTES, false); + final MaintenanceRunnableBase runnable = plugin.startSingleMaintenanceRunnable(server, duration, false); sender.send(getMessage( "singleEndtimerStarted", "%TIME%", runnable.getTime(), diff --git a/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleScheduleTimerCommand.java b/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleScheduleTimerCommand.java index dc98a295..fea1b240 100644 --- a/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleScheduleTimerCommand.java +++ b/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleScheduleTimerCommand.java @@ -22,9 +22,9 @@ import eu.kennytv.maintenance.core.proxy.command.ProxyCommandInfo; import eu.kennytv.maintenance.core.runnable.MaintenanceRunnableBase; import eu.kennytv.maintenance.core.util.SenderInfo; +import java.time.Duration; import java.util.Collections; import java.util.List; -import java.util.concurrent.TimeUnit; public final class SingleScheduleTimerCommand extends ProxyCommandInfo { @@ -41,8 +41,10 @@ public boolean hasPermission(final SenderInfo sender) { public void execute(final SenderInfo sender, final String[] args) { if (args.length == 3) { if (checkPermission(sender, "timer")) return; - if (plugin.getCommandManager().checkTimerArgs(sender, args[1]) - || plugin.getCommandManager().checkTimerArgs(sender, args[2], false)) { + + final Duration enableIn = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[1]); + final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[2], false); + if (enableIn == null || duration == null) { sender.send(getHelpMessage()); return; } @@ -51,17 +53,18 @@ public void execute(final SenderInfo sender, final String[] args) { return; } - final int duration = Integer.parseInt(args[2]); - plugin.scheduleMaintenanceRunnable(Integer.parseInt(args[1]), duration, TimeUnit.MINUTES); + plugin.scheduleMaintenanceRunnable(duration, enableIn); sender.send(getMessage( "scheduletimerStarted", "%TIME%", plugin.getRunnable().getTime(), - "%DURATION%", plugin.getFormattedTime(duration * 60) + "%DURATION%", plugin.getFormattedTime((int) duration.getSeconds()) )); } else if (args.length == 4) { if (checkPermission(sender, "singleserver.timer")) return; - if (plugin.getCommandManager().checkTimerArgs(sender, args[2], false) - || plugin.getCommandManager().checkTimerArgs(sender, args[3], false)) { + + final Duration enableIn = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[2], false); + final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[3], false); + if (enableIn == null || duration == null) { sender.send(getHelpMessage()); return; } @@ -73,12 +76,11 @@ public void execute(final SenderInfo sender, final String[] args) { return; } - final int duration = Integer.parseInt(args[3]); - final MaintenanceRunnableBase runnable = plugin.scheduleSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), duration, TimeUnit.MINUTES); + final MaintenanceRunnableBase runnable = plugin.scheduleSingleMaintenanceRunnable(server, enableIn, duration); sender.send(getMessage( "singleScheduletimerStarted", "%TIME%", runnable.getTime(), - "%DURATION%", plugin.getFormattedTime(duration * 60), + "%DURATION%", plugin.getFormattedTime((int) duration.getSeconds()), "%SERVER%", server.getName() )); } else { diff --git a/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleStarttimerCommand.java b/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleStarttimerCommand.java index 1662e4a9..3eaaf311 100644 --- a/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleStarttimerCommand.java +++ b/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/command/subcommand/SingleStarttimerCommand.java @@ -22,9 +22,9 @@ import eu.kennytv.maintenance.core.proxy.command.ProxyCommandInfo; import eu.kennytv.maintenance.core.runnable.MaintenanceRunnableBase; import eu.kennytv.maintenance.core.util.SenderInfo; +import java.time.Duration; import java.util.Collections; import java.util.List; -import java.util.concurrent.TimeUnit; public final class SingleStarttimerCommand extends ProxyCommandInfo { @@ -41,7 +41,9 @@ public boolean hasPermission(final SenderInfo sender) { public void execute(final SenderInfo sender, final String[] args) { if (args.length == 2) { if (checkPermission(sender, "timer")) return; - if (plugin.getCommandManager().checkTimerArgs(sender, args[1])) { + + final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[1]); + if (duration == null) { sender.send(getHelpMessage()); return; } @@ -50,11 +52,13 @@ public void execute(final SenderInfo sender, final String[] args) { return; } - plugin.startMaintenanceRunnable(Integer.parseInt(args[1]), TimeUnit.MINUTES, true); + plugin.startMaintenanceRunnable(duration, true); sender.send(getMessage("starttimerStarted", "%TIME%", plugin.getRunnable().getTime())); } else if (args.length == 3) { if (checkPermission(sender, "singleserver.timer")) return; - if (plugin.getCommandManager().checkTimerArgs(sender, args[2], false)) { + + final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[2], false); + if (duration == null) { sender.send(getHelpMessage()); return; } @@ -66,7 +70,7 @@ public void execute(final SenderInfo sender, final String[] args) { return; } - final MaintenanceRunnableBase runnable = plugin.startSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), TimeUnit.MINUTES, true); + final MaintenanceRunnableBase runnable = plugin.startSingleMaintenanceRunnable(server, duration, true); sender.send(getMessage( "singleStarttimerStarted", "%TIME%", runnable.getTime(), diff --git a/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/runnable/SingleMaintenanceScheduleRunnable.java b/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/runnable/SingleMaintenanceScheduleRunnable.java index 74ee670b..8df07236 100644 --- a/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/runnable/SingleMaintenanceScheduleRunnable.java +++ b/core-proxy/src/main/java/eu/kennytv/maintenance/core/proxy/runnable/SingleMaintenanceScheduleRunnable.java @@ -22,27 +22,26 @@ import eu.kennytv.maintenance.core.Settings; import eu.kennytv.maintenance.core.proxy.MaintenanceProxyPlugin; import eu.kennytv.maintenance.lib.kyori.adventure.text.Component; - -import java.util.concurrent.TimeUnit; +import java.time.Duration; public final class SingleMaintenanceScheduleRunnable extends SingleMaintenanceRunnable { - private final int maintenanceDuration; + private final int maintenanceDurationSeconds; public SingleMaintenanceScheduleRunnable(final MaintenancePlugin plugin, final Settings settings, final int seconds, final int maintenanceDuration, final Server server) { super(plugin, settings, seconds, true, server); - this.maintenanceDuration = maintenanceDuration; + this.maintenanceDurationSeconds = maintenanceDuration; } @Override protected void finish() { super.finish(); - ((MaintenanceProxyPlugin) plugin).startSingleMaintenanceRunnable(server, maintenanceDuration, TimeUnit.SECONDS, false); + ((MaintenanceProxyPlugin) plugin).startSingleMaintenanceRunnable(server, Duration.ofSeconds(maintenanceDurationSeconds), false); } @Override protected Component getStartMessage() { return settings.getMessage("singleScheduletimerBroadcast", "%SERVER%", server.getName(), - "%TIME%", getTime(), "%DURATION%", plugin.getFormattedTime(maintenanceDuration)); + "%TIME%", getTime(), "%DURATION%", plugin.getFormattedTime(maintenanceDurationSeconds)); } } diff --git a/core/src/main/java/eu/kennytv/maintenance/core/MaintenancePlugin.java b/core/src/main/java/eu/kennytv/maintenance/core/MaintenancePlugin.java index e6a64cad..dc49626a 100644 --- a/core/src/main/java/eu/kennytv/maintenance/core/MaintenancePlugin.java +++ b/core/src/main/java/eu/kennytv/maintenance/core/MaintenancePlugin.java @@ -53,6 +53,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.time.Duration; import java.util.Arrays; import java.util.List; import java.util.UUID; @@ -173,16 +174,16 @@ private void append(final StringBuilder builder, final String timeUnit, final in builder.append(time).append(' ').append(settings.language.getString(time == 1 ? timeUnit : timeUnit + "s")); } - public void startMaintenanceRunnable(final long duration, final TimeUnit unit, final boolean enable) { - runnable = new MaintenanceRunnable(this, settings, (int) unit.toSeconds(duration), enable); + public void startMaintenanceRunnable(final Duration duration, final boolean enable) { + runnable = new MaintenanceRunnable(this, settings, (int) duration.getSeconds(), enable); // Save the endtimer to be able to continue it after a server stop if (settings.isSaveEndtimerOnStop() && !runnable.shouldEnable()) { settings.setSavedEndtimer(System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(runnable.getSecondsLeft())); } } - public void scheduleMaintenanceRunnable(final long duration, final int maintenanceDuration, final TimeUnit unit) { - runnable = new MaintenanceScheduleRunnable(this, settings, (int) unit.toSeconds(duration), (int) unit.toSeconds(maintenanceDuration)); + public void scheduleMaintenanceRunnable(final Duration enableIn, final Duration maintenanceDuration) { + runnable = new MaintenanceScheduleRunnable(this, settings, (int) enableIn.getSeconds(), (int) maintenanceDuration.getSeconds()); } public boolean updateAvailable() { @@ -208,7 +209,7 @@ protected void continueLastEndtimer() { setMaintenance(false); settings.setSavedEndtimer(0); } else { - startMaintenanceRunnable(settings.getSavedEndtimer() - current, TimeUnit.MILLISECONDS, false); + startMaintenanceRunnable(Duration.ofMillis(settings.getSavedEndtimer() - current), false); getLogger().info("The timer has been continued - maintenance will be disabled in: " + getTimerMessage()); } } diff --git a/core/src/main/java/eu/kennytv/maintenance/core/command/MaintenanceCommand.java b/core/src/main/java/eu/kennytv/maintenance/core/command/MaintenanceCommand.java index c32692c9..a8d3d768 100644 --- a/core/src/main/java/eu/kennytv/maintenance/core/command/MaintenanceCommand.java +++ b/core/src/main/java/eu/kennytv/maintenance/core/command/MaintenanceCommand.java @@ -36,13 +36,19 @@ import eu.kennytv.maintenance.core.command.subcommand.WhitelistCommand; import eu.kennytv.maintenance.core.command.subcommand.WhitelistRemoveCommand; import eu.kennytv.maintenance.core.util.SenderInfo; +import java.time.Duration; +import java.time.format.DateTimeParseException; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.jetbrains.annotations.Nullable; public abstract class MaintenanceCommand { + private static final long MAX_TASK_DURATION_SECONDS = TimeUnit.DAYS.toSeconds(28); protected final MaintenancePlugin plugin; protected final Settings settings; private final Map commandExecutors = new LinkedHashMap<>(); @@ -123,29 +129,41 @@ public List getSuggestions(final SenderInfo sender, final String[] args) return info != null && info.hasPermission(sender) ? info.getTabCompletion(sender, args) : Collections.emptyList(); } - public boolean checkTimerArgs(final SenderInfo sender, final String time, final boolean taskCheck) { - if (!plugin.isNumeric(time)) return true; + public @Nullable Duration parseDurationAndCheckTask(final SenderInfo sender, final String time, final boolean taskCheck) { + final Duration duration; + if (plugin.isNumeric(time)) { + // Assume minutes by default as per old command behavior + duration = Duration.ofMinutes(Integer.parseInt(time)); + } else { + try { + // Only accept hours, minutes, and seconds + duration = Duration.parse("PT" + time.toUpperCase(Locale.ROOT)); + } catch (final DateTimeParseException e) { + return null; + } + } + if (taskCheck) { if (plugin.isTaskRunning()) { sender.send(settings.getMessage("timerAlreadyRunning")); - return true; + return null; } } - final int minutes = Integer.parseInt(time); - if (minutes > 40320) { + final long seconds = duration.getSeconds(); + if (seconds > MAX_TASK_DURATION_SECONDS) { sender.send(settings.getMessage("timerTooLong")); - return true; + return null; } - if (minutes < 1) { + if (seconds < 1) { sender.sendRich("[kennytv whispers to you] Think about running a timer for a negative amount of minutes. Doesn't work that well."); - return true; + return null; } - return false; + return duration; } - public boolean checkTimerArgs(final SenderInfo sender, final String time) { - return checkTimerArgs(sender, time, true); + public @Nullable Duration parseDurationAndCheckTask(final SenderInfo sender, final String time) { + return parseDurationAndCheckTask(sender, time, true); } protected void addToggleAndTimerCommands() { diff --git a/core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/EndtimerCommand.java b/core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/EndtimerCommand.java index 83338be7..2bff062c 100644 --- a/core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/EndtimerCommand.java +++ b/core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/EndtimerCommand.java @@ -21,7 +21,7 @@ import eu.kennytv.maintenance.core.command.CommandInfo; import eu.kennytv.maintenance.core.util.SenderInfo; -import java.util.concurrent.TimeUnit; +import java.time.Duration; public final class EndtimerCommand extends CommandInfo { @@ -32,7 +32,9 @@ public EndtimerCommand(final MaintenancePlugin plugin) { @Override public void execute(final SenderInfo sender, final String[] args) { if (checkArgs(sender, args, 2)) return; - if (plugin.getCommandManager().checkTimerArgs(sender, args[1])) { + + final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[1]); + if (duration == null) { sender.send(getHelpMessage()); return; } @@ -41,7 +43,7 @@ public void execute(final SenderInfo sender, final String[] args) { return; } - plugin.startMaintenanceRunnable(Integer.parseInt(args[1]), TimeUnit.MINUTES, false); + plugin.startMaintenanceRunnable(duration, false); sender.send(getMessage("endtimerStarted", "%TIME%", plugin.getRunnable().getTime())); } } diff --git a/core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ScheduleTimerCommand.java b/core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ScheduleTimerCommand.java index 87cc04ee..c96eb8fe 100644 --- a/core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ScheduleTimerCommand.java +++ b/core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/ScheduleTimerCommand.java @@ -20,7 +20,7 @@ import eu.kennytv.maintenance.core.MaintenancePlugin; import eu.kennytv.maintenance.core.command.CommandInfo; import eu.kennytv.maintenance.core.util.SenderInfo; -import java.util.concurrent.TimeUnit; +import java.time.Duration; public final class ScheduleTimerCommand extends CommandInfo { @@ -31,8 +31,10 @@ public ScheduleTimerCommand(final MaintenancePlugin plugin) { @Override public void execute(final SenderInfo sender, final String[] args) { if (checkArgs(sender, args, 3)) return; - if (plugin.getCommandManager().checkTimerArgs(sender, args[1]) - || plugin.getCommandManager().checkTimerArgs(sender, args[2], false)) { + + final Duration enableIn = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[1]); + final Duration maintenanceDuration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[2], false); + if (enableIn == null || maintenanceDuration == null) { sender.send(getHelpMessage()); return; } @@ -41,12 +43,11 @@ public void execute(final SenderInfo sender, final String[] args) { return; } - final int duration = Integer.parseInt(args[2]); - plugin.scheduleMaintenanceRunnable(Integer.parseInt(args[1]), duration, TimeUnit.MINUTES); + plugin.scheduleMaintenanceRunnable(enableIn, maintenanceDuration); sender.send(getMessage( "scheduletimerStarted", "%TIME%", plugin.getRunnable().getTime(), - "%DURATION%", plugin.getFormattedTime(duration * 60) + "%DURATION%", plugin.getFormattedTime((int) maintenanceDuration.getSeconds()) )); } } diff --git a/core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/StarttimerCommand.java b/core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/StarttimerCommand.java index 6619bacc..abe6c430 100644 --- a/core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/StarttimerCommand.java +++ b/core/src/main/java/eu/kennytv/maintenance/core/command/subcommand/StarttimerCommand.java @@ -21,7 +21,7 @@ import eu.kennytv.maintenance.core.command.CommandInfo; import eu.kennytv.maintenance.core.util.SenderInfo; -import java.util.concurrent.TimeUnit; +import java.time.Duration; public final class StarttimerCommand extends CommandInfo { @@ -32,7 +32,9 @@ public StarttimerCommand(final MaintenancePlugin plugin) { @Override public void execute(final SenderInfo sender, final String[] args) { if (checkArgs(sender, args, 2)) return; - if (plugin.getCommandManager().checkTimerArgs(sender, args[1])) { + + final Duration duration = plugin.getCommandManager().parseDurationAndCheckTask(sender, args[1]); + if (duration == null) { sender.send(getHelpMessage()); return; } @@ -41,7 +43,7 @@ public void execute(final SenderInfo sender, final String[] args) { return; } - plugin.startMaintenanceRunnable(Integer.parseInt(args[1]), TimeUnit.MINUTES, true); + plugin.startMaintenanceRunnable(duration, true); sender.send(getMessage("starttimerStarted", "%TIME%", plugin.getRunnable().getTime())); } } diff --git a/core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceScheduleRunnable.java b/core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceScheduleRunnable.java index fe5a67d9..8e764693 100644 --- a/core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceScheduleRunnable.java +++ b/core/src/main/java/eu/kennytv/maintenance/core/runnable/MaintenanceScheduleRunnable.java @@ -20,8 +20,7 @@ import eu.kennytv.maintenance.core.MaintenancePlugin; import eu.kennytv.maintenance.core.Settings; import eu.kennytv.maintenance.lib.kyori.adventure.text.Component; - -import java.util.concurrent.TimeUnit; +import java.time.Duration; public final class MaintenanceScheduleRunnable extends MaintenanceRunnable { private final int maintenanceDuration; @@ -36,7 +35,7 @@ protected void finish() { super.finish(); // Start the timer to disable maintenance again - plugin.startMaintenanceRunnable(maintenanceDuration, TimeUnit.SECONDS, false); + plugin.startMaintenanceRunnable(Duration.ofSeconds(maintenanceDuration), false); } @Override diff --git a/core/src/main/resources/language-da.yml b/core/src/main/resources/language-da.yml index d291b50a..719f6b7f 100644 --- a/core/src/main/resources/language-da.yml +++ b/core/src/main/resources/language-da.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "Ingen spiller med den uuid kunne findes." playerNotOnline: "Der er ingen spiller online med det navn." offlinePlayerFetchError: "There was an error while fetching offline player. Please try again later." invalidUuid: "Ugyldigt uuid-format!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "Du er blevet sendt til en venteserver!" forceWaitingServer: "Du kan ikke forlade venteserveren, mens vedligeholdelsetilstand er aktiveret!" serverNotFound: "Ingen server med dette navn er registreret på proxyen!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (Downloader den nyeste version af p helpWhitelist: "/maintenance whitelist (Viser alle hvidlistede spillere for vedligeholdelsestilstand)" helpWhitelistAdd: "/maintenance add (Tilføjer spilleren til vedligeholdelseshvidlisten, så de kan forbinde til serveren, selvom vedligeholdelsestilstand er aktiveret)" helpWhitelistRemove: "/maintenance remove (Sletter spilleren fra vedligeholdelseshvidlisten)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [server] (Hvis timeren kører, vil den blive afbrudt)" helpSingleEndtimer: "/maintenance endtimer [server] (Efter den givne tid i minutter deaktiveres vedligeholdelsestilstanden)" helpSingleStarttimer: "/maintenance starttimer [server] (Efter den givne tid i minutter, vil vedligeholdelsestilstand blive aktiveret)" diff --git a/core/src/main/resources/language-de.yml b/core/src/main/resources/language-de.yml index 72a046e1..fff1858e 100644 --- a/core/src/main/resources/language-de.yml +++ b/core/src/main/resources/language-de.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "Es konnte kein Spieler mit dieser UUID gefunde playerNotOnline: "Es ist momentan kein Spieler mit diesem Namen online." offlinePlayerFetchError: "Beim Abrufen des Offline-Spielers ist ein Fehler aufgetreten. Bitte versuche es später erneut." invalidUuid: "Das UUID Format ist ungültig!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "Du wurdest auf einen Warteserver verbunden!" forceWaitingServer: "Du kannst den Warteserver nicht verlassen, solange der Wartungsmodus aktiviert ist!" serverNotFound: "Es wurde kein Server mit diesem Namen gefunden!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (Sucht nach neuen Updates für das helpWhitelist: "/maintenance whitelist (Zeigt alle gewhitelisteten Spieler für den Wartungsmodus an)" helpWhitelistAdd: "/maintenance add (Whitelistet einen Spieler für den Wartungsmodus, sodass dieser während Wartungen den Server betreten kann)" helpWhitelistRemove: "/maintenance remove (Entfernt einen Spieler aus der Wartungsmodus Whitelist)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [Server] (Falls momentan ein Timer läuft, wird dieser abgebrochen)" helpSingleEndtimer: "/maintenance endtimer [Server] (Sobald der Timer abläuft wird der Wartungsmodus deaktiviert)" helpSingleStarttimer: "/maintenance starttimer [Server] (Sobald der Timer abläuft wird der Wartungsmodus aktiviert)" diff --git a/core/src/main/resources/language-en.yml b/core/src/main/resources/language-en.yml index 7e728c91..872a3638 100644 --- a/core/src/main/resources/language-en.yml +++ b/core/src/main/resources/language-en.yml @@ -18,7 +18,7 @@ scheduletimerStarted: "Started timer: Maintenance mode will timerAlreadyRunning: "There is already a timer scheduled!" timerNotRunning: "There is currently no running timer." timerCancelled: "The current timer has been disabled." -timerTooLong: "The number has to be less than 40320 (28 days)!" +timerTooLong: "The duration has to be less than 28 days!" timerMotdDisabled: "You have to set 'enable-timerspecific-messages' in the config to 'true', if you want to use/edit timerspecific motds." motdTimer: "%HOURS%:%MINUTES%:%SECONDS%" motdTimerNotRunning: "-" @@ -46,7 +46,7 @@ playerNotFoundUuid: "No player with that uuid could be found." playerNotOnline: "There is no player online with that name." offlinePlayerFetchError: "There was an error while fetching offline player. Please try again later." invalidUuid: "Invalid uuid format!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "You have been sent to a waiting server!" forceWaitingServer: "You cannot leave the waiting server while maintenance is enabled!" serverNotFound: "No server with this name is registered on the proxy!" @@ -78,9 +78,9 @@ helpHeader: "========[ %NAME% | %PAGE%/%MA helpPageNotFound: "There is no page with that number!" helpNextPage: "Use /maintenance help %PAGE% to get to the next help window." helpAbortTimer: "/maintenance aborttimer (If running, the current timer will be aborted)" -helpEndtimer: "/maintenance endtimer (After the given time in minutes, maintenance mode will be disabled)" -helpStarttimer: "/maintenance starttimer (After the given time in minutes, maintenance mode will be enabled)" -helpScheduleTimer: "/maintenance scheduletimer (After the given time in minutes, maintenance mode will be enabled for the given duration in minutes)" +helpEndtimer: "/maintenance endtimer (After the given time, e.g. 1h5m, maintenance mode will be disabled)" +helpStarttimer: "/maintenance starttimer (After the given time, e.g. 1h5m, maintenance mode will be enabled)" +helpScheduleTimer: "/maintenance scheduletimer (After the given time, e.g. 1h5m, maintenance mode will be enabled)" helpDebug: "/maintenance debug (Enables some debug logging)" helpDump: "/maintenance dump (Dumps some server information, used for bug reports)" helpHelp: "/maintenance help [page] (Shows this beautiful help window)" @@ -93,11 +93,11 @@ helpUpdate: "/maintenance update (Remotely downloads the newest vers helpWhitelist: "/maintenance whitelist (Shows all whitelisted players for the maintenance mode)" helpWhitelistAdd: "/maintenance add (Adds the player to the maintenance whitelist, so they can join the server even though maintenance is enabled)" helpWhitelistRemove: "/maintenance remove (Removes the player from the maintenance whitelist)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [server] (If running, the current timer will be aborted)" -helpSingleEndtimer: "/maintenance endtimer [server] (After the given time in minutes, maintenance mode will be disabled)" -helpSingleStarttimer: "/maintenance starttimer [server] (After the given time in minutes, maintenance mode will be enabled)" -helpSingleScheduleTimer: "/maintenance scheduletimer [server] (After the given time in minutes, maintenance mode will be enabled for the given duration in minutes)" +helpSingleEndtimer: "/maintenance endtimer [server] (After the given time, e.g. 1h5m, maintenance mode will be disabled)" +helpSingleStarttimer: "/maintenance starttimer [server] (After the given time, e.g. 1h5m, maintenance mode will be enabled)" +helpSingleScheduleTimer: "/maintenance scheduletimer [server] (After the given time, e.g. 1h5m, maintenance mode will be enabled)" helpSingleToggle: "/maintenance [server] (Enables/disables maintenance mode)" helpStatus: "/maintenance status (Lists all proxied servers, that are currently under maintenance)" #Used for autoupdating the language file, do not change this value. diff --git a/core/src/main/resources/language-es.yml b/core/src/main/resources/language-es.yml index 76513dba..7ae6f9af 100644 --- a/core/src/main/resources/language-es.yml +++ b/core/src/main/resources/language-es.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "No se pudo encontrar el jugador con ese UUID." playerNotOnline: "No hay jugador en línea con este nombre." offlinePlayerFetchError: "Hubo un error al obtener el jugador sin conexión. Por favor, inténtalo de nuevo más tarde." invalidUuid: "Formato inválido!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "Has sido enviado a un servidor de espera!" forceWaitingServer: "No puedes dejar el servidor de espera mientras el mantenimiento está activado!" serverNotFound: "Ningún servidor con este nombre está registrado en el proxy!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (Descarga de forma remot helpWhitelist: "/maintenance whitelist (Muestra todos los jugadores en lista blanca para el modo de mantenimiento)" helpWhitelistAdd: "/maintenance add (Agrega al jugador a la lista blanca de mantenimiento, para que puedan unirse al servidor aunque el mantenimiento esté habilitado)" helpWhitelistRemove: "/maintenance remove (Quita al jugador de la lista blanca de mantenimiento)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [servidor] (Si está funcionando, se abortará el temporizador actual)" helpSingleEndtimer: "/maintenance endtimer [server] (Después del tiempo en minutos, se desactivará el modo de mantenimiento)" helpSingleStarttimer: "/maintenance starttimer [server] (Después del tiempo en minutos, se activara el modo de mantenimiento)" diff --git a/core/src/main/resources/language-fr.yml b/core/src/main/resources/language-fr.yml index dd2d32c3..244590cd 100644 --- a/core/src/main/resources/language-fr.yml +++ b/core/src/main/resources/language-fr.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "Aucun joueur avec cet UUID n'a pu être trouv playerNotOnline: "Il n'y a pas de joueur en ligne avec ce nom." offlinePlayerFetchError: "Une erreur s'est produite lors de la récupération du joueur hors ligne. Veuillez réessayer plus tard." invalidUuid: "Le format de l'UUID est invalide !" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "Vous avez été redirigé(e) vers un serveur d'attente !" forceWaitingServer: "Vous ne pouvez pas quitter le serveur d'attente tant que la maintenance est activée !" serverNotFound: "Aucun serveur avec ce nom n'est enregistré sur le proxy !" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (Télécharge la dernière version helpWhitelist: "/maintenance whitelist (Affiche les joueurs de la liste blanche pour le mode maintenance)" helpWhitelistAdd: "/maintenance add (Ajoute un joueur à la liste blanche de maintenance afin qu'il puisse rejoindre le serveur même si la maintenance est activée)" helpWhitelistRemove: "/maintenance remove (Supprime un joueur de la liste blanche de maintenance)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [server] (Si en cours d'exécution, le minuteur actuel sera abandonné)" helpSingleEndtimer: "/maintenance endtimer [server] (Après le temps imparti en minutes, le mode maintenance sera désactivé)" helpSingleStarttimer: "/maintenance starttimer [server] (Après le temps imparti en minutes, le mode maintenance sera activé)" diff --git a/core/src/main/resources/language-hu.yml b/core/src/main/resources/language-hu.yml index 34c77bd4..ef7937e1 100644 --- a/core/src/main/resources/language-hu.yml +++ b/core/src/main/resources/language-hu.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "A játékos nem található." playerNotOnline: "A játékos nincs online." offlinePlayerFetchError: "Hiba történt az offline játékos lekérése közben. Kérlek, próbáld újra később!" invalidUuid: "Rossz UUID!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "El lettél küldve egy várakozós szerverre!" forceWaitingServer: "Ezt a szervert a karbantartás végéig nem hagyhatod el!" serverNotFound: "Nincs a proxy-n ilyen nevű szerver regisztrálva!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (Frissíti a plugin verziót)" helpWhitelist: "/maintenance whitelist (Megmutatja a karbantartás fehérlistázottak listáját)" helpWhitelistAdd: "/maintenance add (Hozzáadja a játékost a karbantartás fehérlistához)" helpWhitelistRemove: "/maintenance remove (Kitörli a játékost a karbantartás fehérlistáról)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [server] (Ha van karbantartás,akkor figyelmen kívül veszi az időzítőt)" helpSingleEndtimer: "/maintenance endtimer [server] (Egy megadott idővallum múlva kikapcsol a karbantartás mód)" helpSingleStarttimer: "/maintenance starttimer [server] (Egy megadott idővallum múlva bekapcsol a karbantartás mód)" diff --git a/core/src/main/resources/language-it.yml b/core/src/main/resources/language-it.yml index be4bc7e1..adef74ab 100644 --- a/core/src/main/resources/language-it.yml +++ b/core/src/main/resources/language-it.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "Nessun player con quell'uuid è stato trovato. playerNotOnline: "Non c'è nessun giocatore online con quell'username." offlinePlayerFetchError: "C'è stato un errore cercando il player offline. Riprova più tardi." invalidUuid: "L'uuid presenta un formato invalido!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "Sei stato inviato su un server d'attesa!" forceWaitingServer: "Non puoi abbandonare il server d'attesa durante una manutenzione!" serverNotFound: "Nessun server con questo nome è registrato sulla proxy!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (Scarica dall'esterno l'ultima vers helpWhitelist: "/maintenance whitelist (Elenca tutti i giocatori nella whitelist per la manutenzione)" helpWhitelistAdd: "/maintenance add (Aggiunge il giocatore alla whitelist di manutenzione, così possono entrare in un server durante la manutenzione)" helpWhitelistRemove: "/maintenance remove (Rimuovi il player dalla whitelist della manutenzione)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [server] (Se attivo, il timer attuale verrà fermato)" helpSingleEndtimer: "/maintenance endtimer [server] (Dopo il tempo fornito in minuti, la modalità manutenzione sarà rimossa)" helpSingleStarttimer: "/maintenance starttimer [server] (Dopo il tempo fornito in minuti, la modalità manutenzione sarà attivata)" diff --git a/core/src/main/resources/language-ja.yml b/core/src/main/resources/language-ja.yml index d225f269..869dcdc8 100644 --- a/core/src/main/resources/language-ja.yml +++ b/core/src/main/resources/language-ja.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "不明なUUIDです。" playerNotOnline: "このユーザーはオンラインではありません。" offlinePlayerFetchError: "オフラインプレイヤーの取得中にエラーが発生しました。しばらく経ってからもう一度お試しください。" invalidUuid: "UUID形式が無効です。" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "待機サーバーに転送されました!" forceWaitingServer: "メンテナンスが有効な間は、待機中のサーバーから離れることはできません。" serverNotFound: "この名前のサーバーはプロキシに登録されていません。" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (最新版のプラグインをサ helpWhitelist: "/maintenance whitelist (メンテナンスモードのホワイトリストに登録されているすべてのプレーヤーを表示します。)" helpWhitelistAdd: "/maintenance add (メンテナンスのホワイトリストにユーザーを追加し、メンテナンスが有効な状態でもサーバーに参加できるようにします。)" helpWhitelistRemove: "/maintenance remove (メンテナンスのホワイトリストからプレーヤーを削除します。)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [server] (もし、タイマーが実行中の場合、現在のタイマーを中止します。)" helpSingleEndtimer: "/maintenance endtimer [server] (分単位で指定された時間が経過すると、メンテナンスモードは無効になります。)" helpSingleStarttimer: "/maintenance starttimer [server] (分単位で指定された時間経過後、メンテナンスモードが有効になります。)" diff --git a/core/src/main/resources/language-ko.yml b/core/src/main/resources/language-ko.yml index 9de5d254..12d2923e 100644 --- a/core/src/main/resources/language-ko.yml +++ b/core/src/main/resources/language-ko.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "해당 UUID를 가진 플레이어를 찾을 playerNotOnline: "해당 이름을 가진 플레이어가 온라인이 아닙니다." offlinePlayerFetchError: "There was an error while fetching offline player. Please try again later." invalidUuid: "유효하지 않은 UUID 형식입니다!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "You have been sent to a waiting server!" forceWaitingServer: "You cannot leave the waiting server while maintenance is enabled!" serverNotFound: "No server with this name is registered on the proxy!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (Remotely downloads the newest vers helpWhitelist: "/maintenance whitelist (Shows all whitelisted players for the maintenance mode)" helpWhitelistAdd: "/maintenance add (Adds the player to the maintenance whitelist, so they can join the server even though maintenance is enabled)" helpWhitelistRemove: "/maintenance remove (Removes the player from the maintenance whitelist)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [server] (If running, the current timer will be aborted)" helpSingleEndtimer: "/maintenance endtimer [server] (After the given time in minutes, maintenance mode will be disabled)" helpSingleStarttimer: "/maintenance starttimer [server] (After the given time in minutes, maintenance mode will be enabled)" diff --git a/core/src/main/resources/language-pl.yml b/core/src/main/resources/language-pl.yml index 7c339379..5210f55a 100644 --- a/core/src/main/resources/language-pl.yml +++ b/core/src/main/resources/language-pl.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "Nie można znaleźć gracza z tym uuid." playerNotOnline: "Nie ma gracza online z tym nickiem." offlinePlayerFetchError: "There was an error while fetching offline player. Please try again later." invalidUuid: "Nieprawidłowy format uuid!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "Zostałeś wysłany do poczekalni!" forceWaitingServer: "Nie możesz opuścić poczekalni gdy tryb konserwacji jest włączony!" serverNotFound: "Brak serwera z tą nazwą!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (Pobiera najnowszą wersję plugina helpWhitelist: "/maintenance whitelist (Pokazuje białą listę trybu konserwacji)" helpWhitelistAdd: "/maintenance add (Dodaje gracza do listy konserwacji, aby mogli dołączyć do serwera w trakcie konserwacji)" helpWhitelistRemove: "/maintenance remove (Usuwa gracza z listy trybu konserwacji)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [serwer] (Jeśli aktywny, timer zostanie anulowany)" helpSingleEndtimer: "/maintenance endtimer [serwer] (Po czasie podanym w minutach, tryb konserwacji zostanie wyłączony)" helpSingleStarttimer: "/maintenance starttimer [serwer] (Po czasie podanym w minutach, tryb konserwacji zostanie włączony)" diff --git a/core/src/main/resources/language-pt.yml b/core/src/main/resources/language-pt.yml index ac7bdd06..b162741d 100644 --- a/core/src/main/resources/language-pt.yml +++ b/core/src/main/resources/language-pt.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "Nenhum jogador com esse UUID foi encontrado." playerNotOnline: "Não há nenhum jogador online com esse nome." offlinePlayerFetchError: "Ocorreu um erro ao recuperar os dados do jogador off-line. Por favor, tente novamente mais tarde." invalidUuid: "Formato de UUID inválido!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "Você foi enviado para um servidor de espera!" forceWaitingServer: "Você não pode sair do servidor de espera enquanto a manutenção estiver ativada!" serverNotFound: "Nenhum servidor com esse nome está registrado no proxy!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (Baixa remotamente a versão mais r helpWhitelist: "/maintenance whitelist (Mostra todos os jogadores na lista branca para o modo de manutenção)" helpWhitelistAdd: "/maintenance add (Adiciona o jogador à lista branca de manutenção, permitindo que eles entrem no servidor mesmo com a manutenção ativada)" helpWhitelistRemove: "/maintenance remove (Remove o jogador da lista branca de manutenção)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [servidor] (Se estiver em execução, o temporizador atual será abortado)" helpSingleEndtimer: "/maintenance endtimer [servidor] (Após o tempo fornecido em minutos, o modo de manutenção será desativado)" helpSingleStarttimer: "/maintenance starttimer [servidor] (Após o tempo fornecido em minutos, o modo de manutenção será ativado)" diff --git a/core/src/main/resources/language-ru.yml b/core/src/main/resources/language-ru.yml index daf0933c..5d806740 100644 --- a/core/src/main/resources/language-ru.yml +++ b/core/src/main/resources/language-ru.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "Игрок с таким UUID не найден!" playerNotOnline: "Игрок должен быть онлайн!" offlinePlayerFetchError: "Произошла ошибка при получении игрока в автономном режиме. Пожалуйста, повторите попытку позже." invalidUuid: "Неверный формат UUID!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "Вы были перемещены в лобби!" forceWaitingServer: "Вы не можете покинуть лобби во время технических работ!" serverNotFound: "Сервер не найден!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update - Обновить плаг helpWhitelist: "/maintenance whitelist - Отобразить всех игроков из белого списка." helpWhitelistAdd: "/maintenance add [ник|uuid] - Добавить игрока в белый список." helpWhitelistRemove: "/maintenance remove [ник|uuid] - Удалить игрока из белого списка." -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [сервер] - Остановить таймер включения/выключения режима технических работ." helpSingleEndtimer: "/maintenance endtimer [сервер] [время в минутах] - Запустить таймер выключения режима технических работ." helpSingleStarttimer: "/maintenance starttimer [сервер] [время в минутах] - Запустить таймер включения режима технических работ." diff --git a/core/src/main/resources/language-sv.yml b/core/src/main/resources/language-sv.yml index 6b0d8ba5..dc4223ee 100644 --- a/core/src/main/resources/language-sv.yml +++ b/core/src/main/resources/language-sv.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "Ingen spelare med det uuid hittades." playerNotOnline: "Det finns ingen spelare med det namnet online." offlinePlayerFetchError: "There was an error while fetching offline player. Please try again later." invalidUuid: "Ogiltigt uuid format!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "Du har blvitt skickad till en väntserver!" forceWaitingServer: "Du kan inte lämna väntservern medans underhållsläget är aktiverat!" serverNotFound: "Ingen server med det namnet är registerad på proxyn!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (Avlägset laddar ner senaste versi helpWhitelist: "/maintenance whitelist (Visar alla vitlistade spelare för underhållsläget)" helpWhitelistAdd: "/maintenance add (Lägger till en spelare på vitlistan för underhållsläget, så de kan logga in även om underhåll är aktiverat)" helpWhitelistRemove: "/maintenance remove (Tar bort spelaren från vitlistan för underhållsläget)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [server] (Vid utfärdandet av detta kommando kommer den nuvarande timern bli avbruten)" helpSingleEndtimer: "/maintenance endtimer [server] (Efter den angivna tiden kommer underhållsläge avaktiveras)" helpSingleStarttimer: "/maintenance starttimer [server] (Efter den angivna tiden kommer underhållsläge aktiveras)" diff --git a/core/src/main/resources/language-tr.yml b/core/src/main/resources/language-tr.yml index d8f20827..0fa96562 100644 --- a/core/src/main/resources/language-tr.yml +++ b/core/src/main/resources/language-tr.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "Bu UUID'ye sahip hiçbir oyuncu bulunamadı." playerNotOnline: "Bu isimle çevrimiçi oyuncu yok." offlinePlayerFetchError: "Çevrimdışı oyuncu getirilirken bir hata oluştu. Lütfen daha sonra tekrar deneyin." invalidUuid: "Geçersiz UUID biçimi!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "Bekleme sunucusuna gönderildiniz!" forceWaitingServer: "Bakım varken bekleme sunucusundan ayrılamazsınız!" serverNotFound: "Bu ada sahip hiçbir sunucu BungeeCord'da kayıtlı değil!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (Eklentinin en yeni sürümünü su helpWhitelist: "/maintenance whitelist (Bakım modu için beyaz listedeki tüm oyuncuları gösterir)" helpWhitelistAdd: "/maintenance add (Oyuncuyu bakım beyaz listesine ekler, böylece bakım etkin olsa bile sunucuya katılabilir)" helpWhitelistRemove: "/maintenance remove (Oyuncuyu bakım beyaz listesinden kaldırır)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [sunucu] (Çalışıyorsa, mevcut zamanlayıcı iptal edilecektir.)" helpSingleEndtimer: "/maintenance endtimer [sunucu] (Dakika olarak verilen süreden sonra bakım modu devre dışı bırakılır)" helpSingleStarttimer: "/maintenance starttimer [sunucu] (Dakika olarak verilen süreden sonra bakım modu etkinleştirilecektir.)" diff --git a/core/src/main/resources/language-uk.yml b/core/src/main/resources/language-uk.yml index f503fa5e..082499c5 100644 --- a/core/src/main/resources/language-uk.yml +++ b/core/src/main/resources/language-uk.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "Гравець з таким UUID не знайден! playerNotOnline: "Гравець повинен бути онлайн!" offlinePlayerFetchError: "There was an error while fetching offline player. Please try again later." invalidUuid: "Невірний формат UUID!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "Ви були переміщені у лобі!" forceWaitingServer: "Ви не можете залишити лобі під час технічних робіт!" serverNotFound: "Сервер не знайдено!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update - Оновити плагі helpWhitelist: "/maintenance whitelist - Відобразити всіх гравців із білого листа." helpWhitelistAdd: "/maintenance add [ник|uuid] - Додати гравця до білого листа." helpWhitelistRemove: "/maintenance remove [ник|uuid] - Видалити гравця із білого листа." -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [сервер] - Зупинити таймер увімкнення/вимкнення режиму технічних робіт." helpSingleEndtimer: "/maintenance endtimer [сервер] [время в минутах] - Запустити таймер вимкнення режиму технічних робіт." helpSingleStarttimer: "/maintenance starttimer [сервер] [время в минутах] - Запустити таймер увімкнення режиму технічних робіт." diff --git a/core/src/main/resources/language-vi.yml b/core/src/main/resources/language-vi.yml index 406f168d..13b9b0f7 100644 --- a/core/src/main/resources/language-vi.yml +++ b/core/src/main/resources/language-vi.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "Không tìm thấy người chơi nào có uui playerNotOnline: "Không có người chơi trực tuyến nào có tên đó." offlinePlayerFetchError: "Đã xảy ra lỗi khi tìm Người Chơi Ngoại Tuyến. Vui lòng thử lại sau." invalidUuid: "Định dạng uuid không hợp lệ!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "Bạn đã được gửi đến một máy chủ đang chờ!" forceWaitingServer: "Bạn không thể rời khỏi máy chủ đang chờ trong khi bảo trì được kích hoạt!" serverNotFound: "Không có máy chủ nào có tên này được đăng ký trên proxy!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (Tải từ xa phiên bản mới n helpWhitelist: "/maintenance whitelist (Hiển thị tất cả người chơi trong danh sách trắng cho chế độ bảo trì)" helpWhitelistAdd: "/maintenance add (Thêm người chơi vào danh sách trắng bảo trì, để họ có thể tham gia máy chủ ngay cả khi bảo trì được bật)" helpWhitelistRemove: "/maintenance remove (Xóa Người Chơi khỏi danh sách trắng bảo trì)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [server] (Nếu chạy, bộ đếm thời gian hiện tại sẽ bị hủy bỏ)" helpSingleEndtimer: "/maintenance endtimer [server] (Sau thời gian nhất định tính bằng phút, chế độ bảo trì sẽ bị tắt)" helpSingleStarttimer: "/maintenance starttimer [server] (Sau thời gian nhất định tính bằng phút, chế độ bảo trì sẽ được bật)" diff --git a/core/src/main/resources/language-zh.yml b/core/src/main/resources/language-zh.yml index b9b6efe6..882366a5 100644 --- a/core/src/main/resources/language-zh.yml +++ b/core/src/main/resources/language-zh.yml @@ -46,7 +46,7 @@ playerNotFoundUuid: "找不到具有该UUID的玩家。" playerNotOnline: "没有使用该名称的在线玩家" offlinePlayerFetchError: "获取离线玩家时出现错误。请稍后再试。" invalidUuid: "无效的UUID格式!" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge sentToWaitingServer: "您已被传送到等待服务器!" forceWaitingServer: "启用维护时,您不能离开等待服务器!" serverNotFound: "未找到拥有此名称的服务器!" @@ -93,7 +93,7 @@ helpUpdate: "/maintenance update (远程下载最新版本插件到 helpWhitelist: "/maintenance whitelist (显示所有维护玩家白名单)" helpWhitelistAdd: "/maintenance add (将玩家加入维护玩家白名单,这样即使开启了维护,他们也能加入服务器)" helpWhitelistRemove: "/maintenance remove (将玩家从维护玩家白名单中移除)" -#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Spigot/Sponge +#Messages for the Bungee/Velocity part, you can ignore them if you use the plugin on Paper/Sponge helpAbortSingleTimer: "/maintenance aborttimer [server] (中止指定服务器开启的计时器)" helpSingleEndtimer: "/maintenance endtimer [server] (在以分钟为单位给定时间后将关闭指定服务器的维护模式)" helpSingleStarttimer: "/maintenance starttimer [server] (在以分钟为单位给定时间后将开启指定服务器的维护模式)"