diff --git a/src/main/java/de/shiewk/smoderation/command/BanCommand.java b/src/main/java/de/shiewk/smoderation/command/BanCommand.java index f3800cc..f282d6d 100644 --- a/src/main/java/de/shiewk/smoderation/command/BanCommand.java +++ b/src/main/java/de/shiewk/smoderation/command/BanCommand.java @@ -62,6 +62,10 @@ public class BanCommand implements CommandExecutor, TabCompleter { sender.sendMessage(Component.text("Please provide a valid duration.").color(NamedTextColor.RED)); return false; } + if (duration < 0){ + sender.sendMessage(Component.text("Please provide a duration that's longer than 0ms.").color(NamedTextColor.RED)); + return false; + } StringBuilder reason = new StringBuilder(); for (int i = p; i < args.length; i++) { if (!reason.isEmpty()){ diff --git a/src/main/java/de/shiewk/smoderation/command/MuteCommand.java b/src/main/java/de/shiewk/smoderation/command/MuteCommand.java index 41f449d..dcb440c 100644 --- a/src/main/java/de/shiewk/smoderation/command/MuteCommand.java +++ b/src/main/java/de/shiewk/smoderation/command/MuteCommand.java @@ -62,6 +62,10 @@ public class MuteCommand implements CommandExecutor, TabCompleter { sender.sendMessage(Component.text("Please provide a valid duration.").color(NamedTextColor.RED)); return false; } + if (duration < 0){ + sender.sendMessage(Component.text("Please provide a duration that's longer than 0ms.").color(NamedTextColor.RED)); + return false; + } StringBuilder reason = new StringBuilder(); for (int i = p; i < args.length; i++) { if (!reason.isEmpty()){