From 9a8baf565387adeea79390afda9b0d6cc8eab2b4 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 3 Nov 2016 19:57:07 +0100 Subject: [PATCH] Added some stuff --- src/main/java/buttondevteam/chat/ChatProcessing.java | 4 +++- .../java/buttondevteam/chat/commands/CommandCaller.java | 4 ++++ .../buttondevteam/chat/commands/ucmds/InfoCommand.java | 9 +++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/buttondevteam/chat/ChatProcessing.java b/src/main/java/buttondevteam/chat/ChatProcessing.java index eaccbb0..3cfe9cf 100644 --- a/src/main/java/buttondevteam/chat/ChatProcessing.java +++ b/src/main/java/buttondevteam/chat/ChatProcessing.java @@ -227,7 +227,9 @@ public class ChatProcessing { .equals("\nAlpha_Bacca44") ? "\nDeaths: " + PlayerListener.AlphaDeaths - : ""))))))); + : "")))) + .addExtra(new TellrawPart( + "For more, do /u info " + sender.getName()))))); json.addExtra(new TellrawPart("> ")); long combinetime = System.nanoTime(); ChatFormatter.Combine(formatters, formattedmessage, json); diff --git a/src/main/java/buttondevteam/chat/commands/CommandCaller.java b/src/main/java/buttondevteam/chat/commands/CommandCaller.java index b7c8e55..293247a 100644 --- a/src/main/java/buttondevteam/chat/commands/CommandCaller.java +++ b/src/main/java/buttondevteam/chat/commands/CommandCaller.java @@ -32,6 +32,10 @@ public class CommandCaller implements CommandExecutor { new Exception("Null command found at " + entry.getKey() + "!")); continue; } + if (c.GetCommandPath() == null) { + TBMCCoreAPI.SendException("An error occured while registering commands", + new Exception("Command " + entry.getKey() + " has no command path!")); + } if (!c.GetCommandPath().contains(" ")) // Top-level command { PluginCommand pc = ((JavaPlugin) c.getPlugin()).getCommand(c.GetCommandPath()); diff --git a/src/main/java/buttondevteam/chat/commands/ucmds/InfoCommand.java b/src/main/java/buttondevteam/chat/commands/ucmds/InfoCommand.java index e00b402..dc5ee16 100644 --- a/src/main/java/buttondevteam/chat/commands/ucmds/InfoCommand.java +++ b/src/main/java/buttondevteam/chat/commands/ucmds/InfoCommand.java @@ -25,7 +25,16 @@ public class InfoCommand extends UCommandBase { public boolean OnCommand(CommandSender sender, String alias, String[] args) { if (args.length == 0) return false; + if (args[0].equalsIgnoreCase("console") || args[0].equalsIgnoreCase("server") + || args[0].equalsIgnoreCase("@console")) { + sender.sendMessage("The server console."); // TODO: Console login? The Discord thing might replace it + return true; + } try (TBMCPlayer p = TBMCPlayer.getFromName(args[0])) { + if (p == null) { + sender.sendMessage("§cThe specified player cannot be found"); + return true; + } sender.sendMessage(p.getInfo(InfoTarget.MCCommand)); } return true;