From 1af101c31e7773ae05199526db390c9695dce150 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 3 Dec 2016 12:47:23 +0100 Subject: [PATCH] Made the info command not player-only --- .../chat/commands/MWikiCommand.java | 16 ++++----- .../chat/commands/ucmds/InfoCommand.java | 4 +++ .../chat/commands/ucmds/NameCommand.java | 36 ------------------- 3 files changed, 11 insertions(+), 45 deletions(-) delete mode 100644 src/main/java/buttondevteam/chat/commands/ucmds/NameCommand.java diff --git a/src/main/java/buttondevteam/chat/commands/MWikiCommand.java b/src/main/java/buttondevteam/chat/commands/MWikiCommand.java index 49406d7..290b712 100644 --- a/src/main/java/buttondevteam/chat/commands/MWikiCommand.java +++ b/src/main/java/buttondevteam/chat/commands/MWikiCommand.java @@ -8,13 +8,11 @@ public class MWikiCommand extends TBMCCommandBase { @Override public String[] GetHelpText(String alias) { - return new String[] { - "§6---- Minecraft Wiki linker ----", - "Use without parameters to get a link to the wiki", - "You can also search the wiki, for example:", - " /" - + alias - + " beacon - Provides a link that redirects to the beacon's wiki page" }; + return new String[] { "§6---- Minecraft Wiki linker ----", // + "Use without parameters to get a link to the wiki", // + "You can also search the wiki, for example:", // + " /" + alias + " beacon - Provides a link that redirects to the beacon's wiki page" // + }; } @Override @@ -26,8 +24,8 @@ public class MWikiCommand extends TBMCCommandBase { if (args.length == 0) sender.sendMessage("§bMinecraft Wiki link: http://minecraft.gamepedia.com/"); else - sender.sendMessage("§bMinecraft Wiki link: http://minecraft.gamepedia.com/index.php?search=" - + query + "&title=Special%3ASearch&go=Go"); + sender.sendMessage("§bMinecraft Wiki link: http://minecraft.gamepedia.com/index.php?search=" + query + + "&title=Special%3ASearch&go=Go"); return true; } diff --git a/src/main/java/buttondevteam/chat/commands/ucmds/InfoCommand.java b/src/main/java/buttondevteam/chat/commands/ucmds/InfoCommand.java index dc5ee16..08b2ac0 100644 --- a/src/main/java/buttondevteam/chat/commands/ucmds/InfoCommand.java +++ b/src/main/java/buttondevteam/chat/commands/ucmds/InfoCommand.java @@ -40,4 +40,8 @@ public class InfoCommand extends UCommandBase { return true; } + @Override + public boolean GetPlayerOnly() { + return false; + } } diff --git a/src/main/java/buttondevteam/chat/commands/ucmds/NameCommand.java b/src/main/java/buttondevteam/chat/commands/ucmds/NameCommand.java deleted file mode 100644 index 8e77d85..0000000 --- a/src/main/java/buttondevteam/chat/commands/ucmds/NameCommand.java +++ /dev/null @@ -1,36 +0,0 @@ -package buttondevteam.chat.commands.ucmds; - -import org.bukkit.command.CommandSender; - -import buttondevteam.chat.ChatPlayer; -import buttondevteam.lib.TBMCPlayer; - -public class NameCommand extends UCommandBase { - - @Override - public String[] GetHelpText(String alias) { - return new String[] { "§6---- Get username ----", - "This command allows you to see the Reddit username of a player if they have one associated", - "Usage: /u name " }; - } - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - if (args.length == 0) { - return false; - } - ChatPlayer mp = TBMCPlayer.getFromName(args[0]).asPluginPlayer(ChatPlayer.class); - if (mp == null) { - sender.sendMessage("§cUnknown user: " + args[0]); - return true; - } - sender.sendMessage("§bUsername of " + args[0] + ": " + mp.getUserName()); - return true; - } - - @Override - public String GetUCommandPath() { - return "name"; - } - -}