From 9b1a394cb2419b2a20aa201f96f63f1b0c8b719f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 16 Jun 2022 20:54:07 +0200 Subject: [PATCH] Fix empty MsgCommand and RCommand --- src/de/steamwar/bungeecore/commands/MsgCommand.java | 5 +++++ src/de/steamwar/bungeecore/commands/RCommand.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/de/steamwar/bungeecore/commands/MsgCommand.java b/src/de/steamwar/bungeecore/commands/MsgCommand.java index f5f7a9c..0eb5751 100644 --- a/src/de/steamwar/bungeecore/commands/MsgCommand.java +++ b/src/de/steamwar/bungeecore/commands/MsgCommand.java @@ -19,6 +19,7 @@ package de.steamwar.bungeecore.commands; +import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.listeners.ChatListener; import de.steamwar.bungeecore.sql.IgnoreSystem; import de.steamwar.command.SWCommand; @@ -37,6 +38,10 @@ public class MsgCommand extends SWCommand { @Register(description = "MSG_USAGE") public void genericCommand(ProxiedPlayer sender, ProxiedPlayer target, String... message) { + if (message.length == 0) { + Message.send("MSG_USAGE", sender); + return; + } msg(sender, target, message); } diff --git a/src/de/steamwar/bungeecore/commands/RCommand.java b/src/de/steamwar/bungeecore/commands/RCommand.java index 32f1a64..1ad2d6e 100644 --- a/src/de/steamwar/bungeecore/commands/RCommand.java +++ b/src/de/steamwar/bungeecore/commands/RCommand.java @@ -19,6 +19,7 @@ package de.steamwar.bungeecore.commands; +import de.steamwar.bungeecore.Message; import de.steamwar.command.SWCommand; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -32,6 +33,10 @@ public class RCommand extends SWCommand { @Register(description = "R_USAGE") public void genericCommand(ProxiedPlayer player, String... message) { + if (message.length == 0) { + Message.send("R_USAGE", player); + return; + } MsgCommand.msg(player, lastChats.get(player), message); } }