diff --git a/build.gradle b/build.gradle index e93bbe4..faa7404 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ java { } group = 'me.playbosswar.com' -version = '8.5.4' +version = '8.5.5' description = 'CommandTimer' repositories { @@ -61,7 +61,7 @@ publishing { maven(MavenPublication) { groupId = 'me.playbosswar.com' artifactId = 'commandtimer' - version = '8.5.4' + version = '8.5.5' from components.java } diff --git a/java8-build.gradle b/java8-build.gradle index 9454b5a..ece7f09 100644 --- a/java8-build.gradle +++ b/java8-build.gradle @@ -9,7 +9,7 @@ java { } group = 'me.playbosswar.com' -version = '8.5.4' +version = '8.5.5' description = 'CommandTimer' repositories { @@ -69,7 +69,7 @@ publishing { maven(MavenPublication) { groupId = 'me.playbosswar.com' artifactId = 'commandtimer' - version = '8.5.4' + version = '8.5.5' from components.java } diff --git a/src/main/java/me/playbosswar/com/commands/MainCommand.java b/src/main/java/me/playbosswar/com/commands/MainCommand.java index bc55ea3..daf3220 100644 --- a/src/main/java/me/playbosswar/com/commands/MainCommand.java +++ b/src/main/java/me/playbosswar/com/commands/MainCommand.java @@ -18,6 +18,8 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; +import java.util.Date; + public class MainCommand implements CommandExecutor { private final LanguageManager languageManager = CommandTimerPlugin.getLanguageManager(); @@ -125,6 +127,17 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @N return true; } + if(task.getCommandExecutionMode().equals(CommandExecutionMode.ORDERED)) { + final int[] accumulatedDelaySeconds = {0}; + task.getCommands().forEach(command -> { + Bukkit.getScheduler().scheduleSyncDelayedTask(CommandTimerPlugin.getPlugin(), + () -> tasksManager.addTaskCommandExecution(command), 20L * accumulatedDelaySeconds[0]); + accumulatedDelaySeconds[0] += command.getDelay().toSeconds(); + }); + Messages.sendMessage(sender, languageManager.get(LanguageKey.TASK_EXECUTION_ONGOING)); + return true; + } + int selectedCommandIndex = tasksManager.getNextTaskCommandIndex(task); if(selectedCommandIndex == -1) { task.getCommands().forEach(tasksManager::addTaskCommandExecution); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 698f2e1..06a478f 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ main: me.playbosswar.com.CommandTimerPlugin name: "CommandTimer" -version: "8.5.4" +version: "8.5.5" description: "Schedule commands like you want" author: PlayBossWar api-version: 1.13