From 546e507939c3dd0bee49b2270d9e47ebee571e73 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 14 Jun 2022 20:46:13 +0200 Subject: [PATCH] Update BugCommand --- .../bungeecore/commands/BugCommand.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/BugCommand.java b/src/de/steamwar/bungeecore/commands/BugCommand.java index 2f60785..9648423 100644 --- a/src/de/steamwar/bungeecore/commands/BugCommand.java +++ b/src/de/steamwar/bungeecore/commands/BugCommand.java @@ -19,27 +19,22 @@ package de.steamwar.bungeecore.commands; -import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.sql.SWException; import de.steamwar.bungeecore.sql.SteamwarUser; -import net.md_5.bungee.api.CommandSender; +import de.steamwar.command.SWCommand; +import de.steamwar.messages.ChatSender; import net.md_5.bungee.api.connection.ProxiedPlayer; -public class BugCommand extends BasicCommand { +public class BugCommand extends SWCommand { public BugCommand() { super("bug", null); } - @Override - public void execute(CommandSender sender, String[] args) { - if(!(sender instanceof ProxiedPlayer)) - return; - - ProxiedPlayer player = (ProxiedPlayer) sender; + @Register + public void bugMessage(ProxiedPlayer player, String... message) { String server = player.getServer().getInfo().getName(); - String message = String.join(" ", args); SteamwarUser user = SteamwarUser.get(player.getUniqueId()); - SWException.log(server, message, player.getName() + " " + user.getId()); - Message.send("BUG_MESSAGE", player); + SWException.log(server, String.join(" ", message), player.getName() + " " + user.getId()); + ChatSender.of(player).system("BUG_MESSAGE"); } } -- 2.39.5