mirror of
https://github.com/Shiewk/SModeration.git
synced 2026-04-28 05:54:16 +02:00
No negative durations
This commit is contained in:
@@ -62,6 +62,10 @@ public class BanCommand implements CommandExecutor, TabCompleter {
|
|||||||
sender.sendMessage(Component.text("Please provide a valid duration.").color(NamedTextColor.RED));
|
sender.sendMessage(Component.text("Please provide a valid duration.").color(NamedTextColor.RED));
|
||||||
return false;
|
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();
|
StringBuilder reason = new StringBuilder();
|
||||||
for (int i = p; i < args.length; i++) {
|
for (int i = p; i < args.length; i++) {
|
||||||
if (!reason.isEmpty()){
|
if (!reason.isEmpty()){
|
||||||
|
|||||||
@@ -62,6 +62,10 @@ public class MuteCommand implements CommandExecutor, TabCompleter {
|
|||||||
sender.sendMessage(Component.text("Please provide a valid duration.").color(NamedTextColor.RED));
|
sender.sendMessage(Component.text("Please provide a valid duration.").color(NamedTextColor.RED));
|
||||||
return false;
|
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();
|
StringBuilder reason = new StringBuilder();
|
||||||
for (int i = p; i < args.length; i++) {
|
for (int i = p; i < args.length; i++) {
|
||||||
if (!reason.isEmpty()){
|
if (!reason.isEmpty()){
|
||||||
|
|||||||
Reference in New Issue
Block a user