2013-03-01 06:52:01 +01:00
|
|
|
package com.gmail.nossr50.commands;
|
|
|
|
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
|
|
|
|
import com.gmail.nossr50.locale.LocaleLoader;
|
|
|
|
import com.gmail.nossr50.util.Permissions;
|
2013-03-12 21:25:42 +01:00
|
|
|
|
2013-03-28 17:57:49 +01:00
|
|
|
public class McabilityCommand extends ToggleCommand {
|
2013-03-01 06:52:01 +01:00
|
|
|
@Override
|
2013-03-28 17:57:49 +01:00
|
|
|
protected boolean hasOtherPermission(CommandSender sender) {
|
|
|
|
return Permissions.mcabilityOthers(sender);
|
2013-03-01 06:52:01 +01:00
|
|
|
}
|
2013-03-12 21:25:42 +01:00
|
|
|
|
2013-03-28 17:57:49 +01:00
|
|
|
@Override
|
|
|
|
protected boolean hasSelfPermission(CommandSender sender) {
|
|
|
|
return Permissions.mcability(sender);
|
|
|
|
}
|
2013-03-12 21:25:42 +01:00
|
|
|
|
2013-03-28 17:57:49 +01:00
|
|
|
@Override
|
|
|
|
protected void applyCommandAction() {
|
|
|
|
player.sendMessage(LocaleLoader.getString("Commands.Ability." + (mcMMOPlayer.getAbilityUse() ? "Off" : "On")));
|
2013-03-12 21:25:42 +01:00
|
|
|
mcMMOPlayer.toggleAbilityUse();
|
|
|
|
}
|
2013-03-28 17:57:49 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void sendSuccessMessage(CommandSender sender) {
|
|
|
|
sender.sendMessage("Ability use has been toggled for " + player.getName()); // TODO: Localize
|
|
|
|
}
|
2013-03-01 06:52:01 +01:00
|
|
|
}
|