diff --git a/src/de/steamwar/bungeecore/commands/MsgCommand.java b/src/de/steamwar/bungeecore/commands/MsgCommand.java index dcbc792..8dd8e50 100644 --- a/src/de/steamwar/bungeecore/commands/MsgCommand.java +++ b/src/de/steamwar/bungeecore/commands/MsgCommand.java @@ -22,7 +22,6 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.listeners.ChatListener; import de.steamwar.bungeecore.sql.IgnoreSystem; import de.steamwar.command.SWCommand; -import de.steamwar.command.TypeValidator; import de.steamwar.messages.ChatSender; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -37,21 +36,10 @@ public class MsgCommand extends SWCommand { } @Register(description = "MSG_USAGE") - public void genericCommand(ProxiedPlayer sender, ProxiedPlayer target, @Validator String... message) { + public void genericCommand(ProxiedPlayer sender, ProxiedPlayer target, @ErrorMessage(value = "MSG_USAGE", allowEAs = false) String... message) { msg(sender, target, message); } - @ClassValidator(value = String[].class, local = true) - public TypeValidator getValidator() { - return (sender, value, messageSender) -> { - if (value.length == 0) { - messageSender.send("MSG_USAGE"); - return false; - } - return true; - }; - } - public static void msg(ProxiedPlayer player, ProxiedPlayer target, String[] args) { ChatSender sender = ChatSender.of(player); if(target == null || !target.isConnected()) { diff --git a/src/de/steamwar/bungeecore/commands/RCommand.java b/src/de/steamwar/bungeecore/commands/RCommand.java index 13914d8..7755351 100644 --- a/src/de/steamwar/bungeecore/commands/RCommand.java +++ b/src/de/steamwar/bungeecore/commands/RCommand.java @@ -20,7 +20,6 @@ package de.steamwar.bungeecore.commands; import de.steamwar.command.SWCommand; -import de.steamwar.command.TypeValidator; import net.md_5.bungee.api.connection.ProxiedPlayer; import static de.steamwar.bungeecore.Storage.lastChats; @@ -32,18 +31,7 @@ public class RCommand extends SWCommand { } @Register(description = "R_USAGE") - public void genericCommand(ProxiedPlayer player, @Validator String... message) { + public void genericCommand(ProxiedPlayer player, @ErrorMessage(value = "MSG_USAGE", allowEAs = false) String... message) { MsgCommand.msg(player, lastChats.get(player), message); } - - @ClassValidator(value = String[].class, local = true) - public TypeValidator getValidator() { - return (sender, value, messageSender) -> { - if (value.length == 0) { - messageSender.send("R_USAGE"); - return false; - } - return true; - }; - } }