mcMMO/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java

55 lines
2.4 KiB
Java
Raw Normal View History

2012-01-09 20:00:13 +01:00
package com.gmail.nossr50.commands.skills;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions;
2012-04-04 16:57:13 +02:00
import com.gmail.nossr50.commands.CommandHelper;
2012-01-09 20:00:13 +01:00
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.util.Page;
2012-01-09 20:00:13 +01:00
public class ExcavationCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) {
2012-03-26 22:17:35 +02:00
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
2012-01-09 20:00:13 +01:00
return true;
}
2012-04-04 16:57:13 +02:00
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.excavation")) {
return true;
}
2012-01-09 20:00:13 +01:00
Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player);
int ticks = 2;
int x = PP.getSkillLevel(SkillType.EXCAVATION);
while (x >= 50) {
x -= 50;
ticks++;
}
player.sendMessage("");
2012-04-24 00:05:30 +02:00
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Excavation.SkillName") }));
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Excavation") }));
2012-01-09 20:00:13 +01:00
if (mcPermissions.getInstance().excavation(player))
2012-04-24 00:05:30 +02:00
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION) }));
2012-01-09 20:00:13 +01:00
2012-04-24 00:05:30 +02:00
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsExcavation1_0"), mcLocale.getString("m.EffectsExcavation1_1") }));
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsExcavation2_0"), mcLocale.getString("m.EffectsExcavation2_1") }));
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
player.sendMessage(mcLocale.getString("m.ExcavationGigaDrillBreakerLength", new Object[] { ticks }));
2012-01-09 20:00:13 +01:00
Page.grabGuidePageForSkill(SkillType.EXCAVATION, player, args);
2012-01-09 20:00:13 +01:00
return true;
}
}