Archiviert
1
0

Merge pull request 'Update BugCommand' (#375) from CommandBug into master

Reviewed-on: SteamWar/BungeeCore#375
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2022-06-16 12:50:48 +02:00
Commit dfb6f89b35

Datei anzeigen

@ -19,27 +19,22 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.SWException; import de.steamwar.bungeecore.sql.SWException;
import de.steamwar.bungeecore.sql.SteamwarUser; 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; import net.md_5.bungee.api.connection.ProxiedPlayer;
public class BugCommand extends BasicCommand { public class BugCommand extends SWCommand {
public BugCommand() { public BugCommand() {
super("bug", null); super("bug", null);
} }
@Override @Register
public void execute(CommandSender sender, String[] args) { public void bugMessage(ProxiedPlayer player, String... message) {
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
String server = player.getServer().getInfo().getName(); String server = player.getServer().getInfo().getName();
String message = String.join(" ", args);
SteamwarUser user = SteamwarUser.get(player.getUniqueId()); SteamwarUser user = SteamwarUser.get(player.getUniqueId());
SWException.log(server, message, player.getName() + " " + user.getId()); SWException.log(server, String.join(" ", message), player.getName() + " " + user.getId());
Message.send("BUG_MESSAGE", player); ChatSender.of(player).system("BUG_MESSAGE");
} }
} }