Changed /ecodebug to only send the held item - /ecodebug full now sends full output

This commit is contained in:
Auxilor 2021-03-03 14:23:40 +00:00
parent d428f5642a
commit bb23655af8

View File

@ -37,6 +37,7 @@ public class CommandEcodebug extends AbstractCommand {
@Override
public void onExecute(@NotNull final CommandSender sender,
@NotNull final List<String> args) {
if (!args.isEmpty() && args.get(0).equalsIgnoreCase("full")) {
Bukkit.getLogger().info("--------------- BEGIN DEBUG ----------------");
if (sender instanceof Player) {
Player player = (Player) sender;
@ -124,5 +125,15 @@ public class CommandEcodebug extends AbstractCommand {
+ ", NMS: " + ProxyConstants.NMS_VERSION);
Bukkit.getLogger().info("Motd: " + Bukkit.getServer().getMotd());
Bukkit.getLogger().info("--------------- END DEBUG ----------------");
} else {
if (sender instanceof Player) {
Player player = (Player) sender;
player.sendMessage("Held Item: " + player.getInventory().getItemInMainHand().toString());
Bukkit.getLogger().info("");
Bukkit.getLogger().info("Held Item: " + player.getInventory().getItemInMainHand().toString());
Bukkit.getLogger().info("");
}
}
}
}