Made the info command not player-only

This commit is contained in:
Norbi Peti 2016-12-03 12:47:23 +01:00
parent d481152eb0
commit 1af101c31e
3 changed files with 11 additions and 45 deletions

View file

@ -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;
}

View file

@ -40,4 +40,8 @@ public class InfoCommand extends UCommandBase {
return true;
}
@Override
public boolean GetPlayerOnly() {
return false;
}
}

View file

@ -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 <playername>" };
}
@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";
}
}