Skip to content

Commit

Permalink
refactor: move reload command
Browse files Browse the repository at this point in the history
  • Loading branch information
Subilan committed Aug 7, 2024
1 parent f042c51 commit e7061f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/cc/seati/SeatiCore/Commands/Commands.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cc.seati.SeatiCore.Commands;

import cc.seati.SeatiCore.Commands.Modules.CommandReload;
import cc.seati.SeatiCore.Commands.Modules.Lab.CommandReload;
import cc.seati.SeatiCore.Commands.Modules.Stats.*;
import cc.seati.SeatiCore.Commands.Modules.Lab.ModuleLab;
import cc.seati.SeatiCore.Utils.CommonUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cc.seati.SeatiCore.Commands.Modules;
package cc.seati.SeatiCore.Commands.Modules.Lab;

import cc.seati.SeatiCore.Commands.Abstract.Command;
import cc.seati.SeatiCore.Utils.ConfigUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ public class ModuleLab extends Module {
@Override
public int handle(CommandContext<CommandSourceStack> ctx, String module, String action, String[] argArray) {
return switch (action) {
case "reload" -> new CommandReload().handle(ctx);
case "verify" -> new CommandVerify().handle(ctx);
case "archive" -> new CommandArchive().handle(ctx);
case "backup" -> new CommandBackup().handle(ctx);
case "taskinfo", "taskrun", "taskstop", "ti", "tu", "td", "taskup", "taskdown", "taskstart" -> {
case "taskinfo", "taskrun", "taskstop" -> {
if (argArray.length < 2) {
CommonUtil.sendMessage(ctx, "&c参数不足");
yield 1;
} else {
yield switch (action) {
case "taskinfo" -> new CommandTaskInfo(argArray[1]).handle(ctx);
case "taskrun", "taskup", "tu", "taskstart" -> new CommandTaskRunStop(argArray[1], true).handle(ctx);
case "taskstop", "taskdown", "td" -> new CommandTaskRunStop(argArray[1], false).handle(ctx);
case "taskrun" -> new CommandTaskRunStop(argArray[1], true).handle(ctx);
case "taskstop" -> new CommandTaskRunStop(argArray[1], false).handle(ctx);
default -> throw new IllegalStateException("Unexpected value: " + action);
};
}
Expand Down

0 comments on commit e7061f5

Please sign in to comment.