From 201ab73e11cc9ef0615daefa630a5ce4cc86d98f Mon Sep 17 00:00:00 2001 From: Maxlego08 Date: Sun, 11 Dec 2022 12:06:17 +0100 Subject: [PATCH] :bug: Fix commands --- .../zkoth/command/commands/CommandKothSetCapture.java | 4 ++++ .../zkoth/command/commands/CommandKothSetPoints.java | 5 +++++ .../zkoth/command/commands/CommandKothSetTimer.java | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/src/fr/maxlego08/zkoth/command/commands/CommandKothSetCapture.java b/src/fr/maxlego08/zkoth/command/commands/CommandKothSetCapture.java index fa8addd..1d90356 100644 --- a/src/fr/maxlego08/zkoth/command/commands/CommandKothSetCapture.java +++ b/src/fr/maxlego08/zkoth/command/commands/CommandKothSetCapture.java @@ -1,5 +1,8 @@ package fr.maxlego08.zkoth.command.commands; +import java.util.Arrays; +import java.util.stream.Collectors; + import fr.maxlego08.zkoth.ZKothPlugin; import fr.maxlego08.zkoth.command.VCommand; import fr.maxlego08.zkoth.zcore.enums.Message; @@ -11,6 +14,7 @@ public class CommandKothSetCapture extends VCommand { public CommandKothSetCapture(ZKothPlugin plugin) { super(plugin); this.addCompletion(0, (a, b) -> plugin.getKothManager().getKothNames()); + this.addCompletion(1, (a, b) -> Arrays.asList(10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190).stream().map(e -> e.toString()).collect(Collectors.toList())); this.setPermission(Permission.ZKOTH_SETCAPTURE); this.addSubCommand("setcapture", "setcap"); this.setDescription(Message.DESCRIPTION_CAPTURE); diff --git a/src/fr/maxlego08/zkoth/command/commands/CommandKothSetPoints.java b/src/fr/maxlego08/zkoth/command/commands/CommandKothSetPoints.java index 671ad6b..94e08f3 100644 --- a/src/fr/maxlego08/zkoth/command/commands/CommandKothSetPoints.java +++ b/src/fr/maxlego08/zkoth/command/commands/CommandKothSetPoints.java @@ -1,5 +1,8 @@ package fr.maxlego08.zkoth.command.commands; +import java.util.Arrays; +import java.util.stream.Collectors; + import fr.maxlego08.zkoth.ZKothPlugin; import fr.maxlego08.zkoth.command.VCommand; import fr.maxlego08.zkoth.zcore.enums.Message; @@ -11,9 +14,11 @@ public class CommandKothSetPoints extends VCommand { public CommandKothSetPoints(ZKothPlugin plugin) { super(plugin); this.addCompletion(0, (a, b) -> plugin.getKothManager().getKothNames()); + this.addCompletion(1, (a, b) -> Arrays.asList(10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190).stream().map(e -> e.toString()).collect(Collectors.toList())); this.setPermission(Permission.ZKOTH_POINTS); this.addSubCommand("setpoints"); this.setDescription(Message.DESCRIPTION_POINTS); + this.addRequireArg("name"); this.addRequireArg("points"); } diff --git a/src/fr/maxlego08/zkoth/command/commands/CommandKothSetTimer.java b/src/fr/maxlego08/zkoth/command/commands/CommandKothSetTimer.java index 4080654..5130d9b 100644 --- a/src/fr/maxlego08/zkoth/command/commands/CommandKothSetTimer.java +++ b/src/fr/maxlego08/zkoth/command/commands/CommandKothSetTimer.java @@ -1,5 +1,8 @@ package fr.maxlego08.zkoth.command.commands; +import java.util.Arrays; +import java.util.stream.Collectors; + import fr.maxlego08.zkoth.ZKothPlugin; import fr.maxlego08.zkoth.command.VCommand; import fr.maxlego08.zkoth.zcore.enums.Message; @@ -11,9 +14,11 @@ public class CommandKothSetTimer extends VCommand { public CommandKothSetTimer(ZKothPlugin plugin) { super(plugin); this.addCompletion(0, (a, b) -> plugin.getKothManager().getKothNames()); + this.addCompletion(1, (a, b) -> Arrays.asList(10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190).stream().map(e -> e.toString()).collect(Collectors.toList())); this.setPermission(Permission.ZKOTH_TIMER); this.addSubCommand("settimer"); this.setDescription(Message.DESCRIPTION_TIMER); + this.addRequireArg("name"); this.addRequireArg("seconds"); }