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
|
|
|
|
2013-01-07 02:52:31 +01:00
|
|
|
if (Permissions.party(player)) {
|
2012-04-27 11:47:11 +02:00
|
|
|
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
|
|
|
|
2013-01-07 02:52:31 +01:00
|
|
|
if (Permissions.partyChat(player)) {
|
2012-04-27 11:47:11 +02:00
|
|
|
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
|
|
|
|
2013-01-07 02:52:31 +01:00
|
|
|
if (Permissions.partyTeleport(player)) {
|
2012-04-27 11:47:11 +02:00
|
|
|
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
|
|
|
|
2013-01-07 02:52:31 +01:00
|
|
|
if (Config.getInstance().getCommandSkillResetEnabled() && Permissions.skillReset(player)) {
|
2012-07-30 06:02:41 +02:00
|
|
|
player.sendMessage("/skillreset <skill|all> " + LocaleLoader.getString("Commands.Reset"));
|
2012-07-30 05:49:42 +02:00
|
|
|
}
|
2012-12-24 22:56:25 +01:00
|
|
|
|
2013-01-07 02:52:31 +01:00
|
|
|
if (Permissions.mcAbility(player)) {
|
2012-04-27 11:47:11 +02:00
|
|
|
player.sendMessage("/mcability " + LocaleLoader.getString("Commands.ToggleAbility"));
|
2012-04-05 06:44:12 +02:00
|
|
|
}
|
2012-01-09 20:00:13 +01:00
|
|
|
|
2013-01-07 02:52:31 +01:00
|
|
|
if (Permissions.adminChat(player)) {
|
2012-04-27 11:47:11 +02:00
|
|
|
player.sendMessage("/a " + LocaleLoader.getString("Commands.AdminToggle"));
|
2012-04-05 06:44:12 +02:00
|
|
|
}
|
2012-01-09 20:00:13 +01:00
|
|
|
|
2013-01-07 02:52:31 +01:00
|
|
|
if (Permissions.inspect(player)) {
|
2012-04-27 11:47:11 +02:00
|
|
|
player.sendMessage("/inspect " + LocaleLoader.getString("Commands.Inspect"));
|
2012-04-05 06:44:12 +02:00
|
|
|
}
|
2012-01-09 20:00:13 +01:00
|
|
|
|
2013-01-07 02:52:31 +01:00
|
|
|
if (Permissions.mmoedit(player)) {
|
2012-04-27 11:47:11 +02:00
|
|
|
player.sendMessage("/mmoedit " + LocaleLoader.getString("Commands.mmoedit"));
|
2012-04-05 06:44:12 +02:00
|
|
|
}
|
2012-01-09 20:00:13 +01:00
|
|
|
|
2013-01-07 02:52:31 +01:00
|
|
|
if (Permissions.mcgod(player)) {
|
2012-04-27 11:47:11 +02:00
|
|
|
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
|
|
|
}
|