Skip to content

Commit

Permalink
4.2.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytv committed Sep 17, 2023
1 parent c39bb44 commit 6be27d0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ This file contains update logs for this project. The top may contain a `Unreleas
* Velocity/Bungee: Added `commands-on-single-maintenance-enable` and `commands-on-single-maintenance-disable` config options to define commands to be executed after maintenance has been toggled on a proxied server
* Commands inside the `all` list will be executed for any proxied server, but you can also define commands for specific servers by adding arrays with the server names as keys
* You can use the placeholder `%SERVER%` in commands to be replaced with the server name
* Updated language files from [Crowdin](https://crowdin.com/translate/maintenance)
* Start-, end-, and schedule timers for proxied servers now also include the server in the feedback message
* Updated language files from [Crowdin](https://crowdin.com/translate/maintenance) (including new language files for Danish, Japanese, Korean, and Hungarian)
---
## 4.1.0 - April 17th 2023
### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ public void execute(final SenderInfo sender, final String[] args) {
return;
}

plugin.scheduleMaintenanceRunnable(Integer.parseInt(args[1]), Integer.parseInt(args[2]), TimeUnit.MINUTES);
sender.send(getMessage("scheduletimerStarted", "%TIME%", plugin.getRunnable().getTime()));
final int duration = Integer.parseInt(args[2]);
plugin.scheduleMaintenanceRunnable(Integer.parseInt(args[1]), duration, TimeUnit.MINUTES);
sender.send(getMessage(
"scheduletimerStarted",
"%TIME%", plugin.getRunnable().getTime(),
"%DURATION%", plugin.getFormattedTime(duration * 60)
));
} else if (args.length == 4) {
if (checkPermission(sender, "singleserver.timer")) return;
if (plugin.getCommandManager().checkTimerArgs(sender, args[2], false)
Expand All @@ -68,10 +73,12 @@ public void execute(final SenderInfo sender, final String[] args) {
return;
}

final MaintenanceRunnableBase runnable = plugin.scheduleSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), Integer.parseInt(args[3]), TimeUnit.MINUTES);
final int duration = Integer.parseInt(args[3]);
final MaintenanceRunnableBase runnable = plugin.scheduleSingleMaintenanceRunnable(server, Integer.parseInt(args[2]), duration, TimeUnit.MINUTES);
sender.send(getMessage(
"singleScheduletimerStarted",
"%TIME%", runnable.getTime(),
"%DURATION%", plugin.getFormattedTime(duration * 60),
"%SERVER%", server.getName()
));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
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;

public final class ScheduleTimerCommand extends CommandInfo {
Expand All @@ -42,7 +41,12 @@ public void execute(final SenderInfo sender, final String[] args) {
return;
}

plugin.scheduleMaintenanceRunnable(Integer.parseInt(args[1]), Integer.parseInt(args[2]), TimeUnit.MINUTES);
sender.send(getMessage("starttimerStarted", "%TIME%", plugin.getRunnable().getTime()));
final int duration = Integer.parseInt(args[2]);
plugin.scheduleMaintenanceRunnable(Integer.parseInt(args[1]), duration, TimeUnit.MINUTES);
sender.send(getMessage(
"scheduletimerStarted",
"%TIME%", plugin.getRunnable().getTime(),
"%DURATION%", plugin.getFormattedTime(duration * 60)
));
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
projectVersion=4.2.0-SNAPSHOT
projectVersion=4.2.0

# Gradle properties
org.gradle.daemon=true
Expand Down

0 comments on commit 6be27d0

Please sign in to comment.