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

73 lines
2.9 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;
import com.gmail.nossr50.mcPermissions;
2012-04-05 06:44:12 +02:00
import com.gmail.nossr50.commands.CommandHelper;
2012-01-09 20:00:13 +01:00
import com.gmail.nossr50.locale.mcLocale;
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-05 06:44:12 +02:00
if (mcPermissions.getInstance().party(player)) {
2012-04-19 19:42:12 +02:00
player.sendMessage(mcLocale.getString("Commands.Party.Commands"));
player.sendMessage("/party " + mcLocale.getString("Commands.Party"));
player.sendMessage("/party q " + mcLocale.getString("Commands.Party.Quit"));
2012-01-09 20:00:13 +01:00
2012-04-05 06:44:12 +02:00
if (mcPermissions.getInstance().partyChat(player)) {
2012-04-19 19:42:12 +02:00
player.sendMessage("/p " + mcLocale.getString("Commands.Party.Toggle"));
2012-04-05 06:44:12 +02:00
}
2012-01-09 20:00:13 +01:00
2012-04-19 19:42:12 +02:00
player.sendMessage("/invite " + mcLocale.getString("Commands.Party.Invite"));
2012-04-21 00:09:50 +02:00
player.sendMessage("/accept " + mcLocale.getString("Commands.Party.Accept"));
2012-01-09 20:00:13 +01:00
2012-04-05 06:44:12 +02:00
if (mcPermissions.getInstance().partyTeleport(player)) {
2012-04-19 19:42:12 +02:00
player.sendMessage("/ptp " + mcLocale.getString("Commands.Party.Teleport"));
2012-04-05 06:44:12 +02:00
}
}
2012-01-09 20:00:13 +01:00
2012-04-19 19:42:12 +02:00
player.sendMessage(mcLocale.getString("Commands.Other"));
player.sendMessage("/mcstats " + mcLocale.getString("Commands.Stats"));
player.sendMessage("/mctop " + mcLocale.getString("m.mccLeaderboards"));
2012-01-09 20:00:13 +01:00
2012-04-05 06:44:12 +02:00
if (mcPermissions.getInstance().mcAbility(player)) {
2012-04-19 19:42:12 +02:00
player.sendMessage("/mcability " + mcLocale.getString("Commands.ToggleAbility"));
2012-04-05 06:44:12 +02:00
}
2012-01-09 20:00:13 +01:00
2012-04-05 06:44:12 +02:00
if (mcPermissions.getInstance().adminChat(player)) {
2012-04-19 19:42:12 +02:00
player.sendMessage("/a " + mcLocale.getString("Commands.AdminToggle"));
2012-04-05 06:44:12 +02:00
}
2012-01-09 20:00:13 +01:00
2012-04-05 06:44:12 +02:00
if (mcPermissions.getInstance().inspect(player)) {
2012-04-19 19:42:12 +02:00
player.sendMessage("/inspect " + mcLocale.getString("Commands.Inspect"));
2012-04-05 06:44:12 +02:00
}
2012-01-09 20:00:13 +01:00
2012-04-05 06:44:12 +02:00
if (mcPermissions.getInstance().mmoedit(player)) {
2012-04-19 19:42:12 +02:00
player.sendMessage("/mmoedit " + mcLocale.getString("Commands.mmoedit"));
2012-04-05 06:44:12 +02:00
}
2012-01-09 20:00:13 +01:00
2012-04-05 06:44:12 +02:00
if (mcPermissions.getInstance().mcgod(player)) {
2012-04-19 19:42:12 +02:00
player.sendMessage("/mcgod " + mcLocale.getString("Commands.mcgod"));
2012-04-05 06:44:12 +02:00
}
2012-01-09 20:00:13 +01:00
2012-04-19 19:42:12 +02:00
player.sendMessage(mcLocale.getString("Commands.SkillInfo"));
player.sendMessage("/mcmmo " + mcLocale.getString("Commands.ModDescription"));
2012-04-05 06:44:12 +02:00
return true;
}
2012-01-09 20:00:13 +01:00
}