mcMMO/src/main/java/com/gmail/nossr50/commands/mc/MccCommand.java

78 lines
3.3 KiB
Java
Raw Normal View History

2012-01-09 20:00:13 +01:00
package com.gmail.nossr50.commands.mc;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
2012-04-05 06:44:12 +02:00
import com.gmail.nossr50.commands.CommandHelper;
2012-07-30 06:02:41 +02:00
import com.gmail.nossr50.config.Config;
2012-04-27 11:47:11 +02:00
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
2012-01-09 20:00:13 +01:00
2012-04-19 19:42:12 +02:00
//TODO: Rework this whole thing. It's ugly. Also is missing all the admin & spout commands.
2012-01-09 20:00:13 +01:00
public class MccCommand implements CommandExecutor {
2012-04-05 06:44:12 +02:00
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (CommandHelper.noConsoleUsage(sender)) {
return true;
}
2012-01-09 20:00:13 +01:00
2012-04-05 06:44:12 +02:00
Player player = (Player) sender;
2012-01-09 20:00:13 +01:00
2012-04-05 06:44:12 +02:00
player.sendMessage(ChatColor.RED + "---[]" + ChatColor.YELLOW + "mcMMO Commands" + ChatColor.RED + "[]---"); //TODO: Needs more locale.
2012-01-09 20:00:13 +01:00
2012-04-27 11:47:11 +02:00
if (Permissions.getInstance().party(player)) {
player.sendMessage(LocaleLoader.getString("Commands.Party.Commands"));
player.sendMessage("/party " + LocaleLoader.getString("Commands.Party"));
player.sendMessage("/party q " + LocaleLoader.getString("Commands.Party.Quit"));
2012-01-09 20:00:13 +01:00
2012-04-27 11:47:11 +02:00
if (Permissions.getInstance().partyChat(player)) {
player.sendMessage("/p " + LocaleLoader.getString("Commands.Party.Toggle"));
2012-04-05 06:44:12 +02:00
}
2012-01-09 20:00:13 +01:00
2012-04-27 11:47:11 +02:00
player.sendMessage("/invite " + LocaleLoader.getString("Commands.Party.Invite"));
player.sendMessage("/accept " + LocaleLoader.getString("Commands.Party.Accept"));
2012-01-09 20:00:13 +01:00
2012-04-27 11:47:11 +02:00
if (Permissions.getInstance().partyTeleport(player)) {
player.sendMessage("/ptp " + LocaleLoader.getString("Commands.Party.Teleport"));
2012-04-05 06:44:12 +02:00
}
}
2012-01-09 20:00:13 +01:00
2012-04-27 11:47:11 +02:00
player.sendMessage(LocaleLoader.getString("Commands.Other"));
player.sendMessage("/mcstats " + LocaleLoader.getString("Commands.Stats"));
2012-04-30 03:03:56 +02:00
player.sendMessage("/mctop " + LocaleLoader.getString("Commands.Leaderboards"));
2012-01-09 20:00:13 +01:00
2012-07-30 06:02:41 +02:00
if (Config.getInstance().getCommandSkillResetEnabled() && Permissions.getInstance().skillReset(player)) {
player.sendMessage("/skillreset <skill|all> " + LocaleLoader.getString("Commands.Reset"));
}
2012-12-24 22:56:25 +01:00
2012-04-27 11:47:11 +02:00
if (Permissions.getInstance().mcAbility(player)) {
player.sendMessage("/mcability " + LocaleLoader.getString("Commands.ToggleAbility"));
2012-04-05 06:44:12 +02:00
}
2012-01-09 20:00:13 +01:00
2012-04-27 11:47:11 +02:00
if (Permissions.getInstance().adminChat(player)) {
player.sendMessage("/a " + LocaleLoader.getString("Commands.AdminToggle"));
2012-04-05 06:44:12 +02:00
}
2012-01-09 20:00:13 +01:00
2012-04-27 11:47:11 +02:00
if (Permissions.getInstance().inspect(player)) {
player.sendMessage("/inspect " + LocaleLoader.getString("Commands.Inspect"));
2012-04-05 06:44:12 +02:00
}
2012-01-09 20:00:13 +01:00
2012-04-27 11:47:11 +02:00
if (Permissions.getInstance().mmoedit(player)) {
player.sendMessage("/mmoedit " + LocaleLoader.getString("Commands.mmoedit"));
2012-04-05 06:44:12 +02:00
}
2012-01-09 20:00:13 +01:00
2012-04-27 11:47:11 +02:00
if (Permissions.getInstance().mcgod(player)) {
player.sendMessage("/mcgod " + LocaleLoader.getString("Commands.mcgod"));
2012-04-05 06:44:12 +02:00
}
2012-01-09 20:00:13 +01:00
2012-04-27 11:47:11 +02:00
player.sendMessage(LocaleLoader.getString("Commands.SkillInfo"));
player.sendMessage("/mcmmo " + LocaleLoader.getString("Commands.ModDescription"));
2012-04-05 06:44:12 +02:00
return true;
}
2012-01-09 20:00:13 +01:00
}