From 398ec7ce25c960d4bbf3a1f71ee5b09e3743a2ae Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 30 Sep 2016 13:22:39 +0200 Subject: [PATCH] Fixed /u name and such --- src/main/java/buttondevteam/chat/ChatPlayer.java | 2 +- .../buttondevteam/chat/commands/ucmds/NameCommand.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/buttondevteam/chat/ChatPlayer.java b/src/main/java/buttondevteam/chat/ChatPlayer.java index b86efdd..624143e 100644 --- a/src/main/java/buttondevteam/chat/ChatPlayer.java +++ b/src/main/java/buttondevteam/chat/ChatPlayer.java @@ -48,7 +48,7 @@ public class ChatPlayer extends TBMCPlayer { .warning("Can't load player " + p.getUniqueId() + " - " + p.getName()); return null; } - ChatPlayer.OnlinePlayers.get(player.UUID); + return ChatPlayer.OnlinePlayers.get(player.UUID); } return ChatPlayer.OnlinePlayers.get(p.getUniqueId()); } else diff --git a/src/main/java/buttondevteam/chat/commands/ucmds/NameCommand.java b/src/main/java/buttondevteam/chat/commands/ucmds/NameCommand.java index 54a3717..abc6a7a 100644 --- a/src/main/java/buttondevteam/chat/commands/ucmds/NameCommand.java +++ b/src/main/java/buttondevteam/chat/commands/ucmds/NameCommand.java @@ -16,16 +16,16 @@ public class NameCommand extends UCommandBase { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { - if (args.length == 1) { + if (args.length == 0) { return false; } - ChatPlayer mp = ChatPlayer.GetFromName(args[1]); + ChatPlayer mp = ChatPlayer.GetFromName(args[0]); if (mp == null) { - sender.sendMessage("§cUnknown user (player has to be online): " - + args[1]); + sender.sendMessage("§cUnknown user: " + + args[0]); return true; } - sender.sendMessage("§bUsername of " + args[1] + ": " + mp.UserName); + sender.sendMessage("§bUsername of " + args[0] + ": " + mp.UserName); return true; }