mcMMO/src/main/java/com/gmail/nossr50/commands/McabilityCommand.java

30 lines
901 B
Java

package com.gmail.nossr50.commands;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
public class McabilityCommand extends ToggleCommand {
@Override
protected boolean hasOtherPermission(CommandSender sender) {
return Permissions.mcabilityOthers(sender);
}
@Override
protected boolean hasSelfPermission(CommandSender sender) {
return Permissions.mcability(sender);
}
@Override
protected void applyCommandAction() {
player.sendMessage(LocaleLoader.getString("Commands.Ability." + (mcMMOPlayer.getAbilityUse() ? "Off" : "On")));
mcMMOPlayer.toggleAbilityUse();
}
@Override
protected void sendSuccessMessage(CommandSender sender) {
sender.sendMessage("Ability use has been toggled for " + player.getName()); // TODO: Localize
}
}