2013-03-01 06:52:01 +01:00
|
|
|
package com.gmail.nossr50.commands.player;
|
|
|
|
|
2013-03-28 17:57:49 +01:00
|
|
|
import java.util.List;
|
|
|
|
|
2013-03-01 06:52:01 +01:00
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
2013-03-28 17:57:49 +01:00
|
|
|
import org.bukkit.command.TabExecutor;
|
2013-03-01 06:52:01 +01:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
import com.gmail.nossr50.config.Config;
|
|
|
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
|
|
|
import com.gmail.nossr50.locale.LocaleLoader;
|
|
|
|
import com.gmail.nossr50.util.commands.CommandUtils;
|
|
|
|
import com.gmail.nossr50.util.player.UserManager;
|
|
|
|
|
2013-03-28 17:57:49 +01:00
|
|
|
import com.google.common.collect.ImmutableList;
|
|
|
|
|
|
|
|
public class McstatsCommand implements TabExecutor {
|
2013-03-01 06:52:01 +01:00
|
|
|
@Override
|
|
|
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
|
|
|
if (CommandUtils.noConsoleUsage(sender)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (args.length) {
|
|
|
|
case 0:
|
2013-03-12 21:25:42 +01:00
|
|
|
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName());
|
|
|
|
Player player = mcMMOPlayer.getPlayer();
|
2013-03-01 06:52:01 +01:00
|
|
|
|
|
|
|
player.sendMessage(LocaleLoader.getString("Stats.Own.Stats"));
|
|
|
|
player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote"));
|
|
|
|
|
2013-03-12 21:25:42 +01:00
|
|
|
CommandUtils.printGatheringSkills(player);
|
|
|
|
CommandUtils.printCombatSkills(player);
|
|
|
|
CommandUtils.printMiscSkills(player);
|
2013-03-01 06:52:01 +01:00
|
|
|
|
|
|
|
int powerLevelCap = Config.getInstance().getPowerLevelCap();
|
|
|
|
|
|
|
|
if (powerLevelCap != Integer.MAX_VALUE) {
|
2013-03-12 21:25:42 +01:00
|
|
|
player.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Capped", UserManager.getPlayer(player).getPowerLevel(), powerLevelCap));
|
2013-03-01 06:52:01 +01:00
|
|
|
}
|
|
|
|
else {
|
2013-03-12 21:25:42 +01:00
|
|
|
player.sendMessage(LocaleLoader.getString("Commands.PowerLevel", UserManager.getPlayer(player).getPowerLevel()));
|
2013-03-01 06:52:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2013-03-28 17:57:49 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
|
|
|
return ImmutableList.of();
|
|
|
|
}
|
2013-03-01 06:52:01 +01:00
|
|
|
}
|