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 McgodCommand 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.mcgodOthers(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.mcgod(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.GodMode." + (mcMMOPlayer.getGodMode() ? "Disabled" : "Enabled")));
|
2013-03-12 21:25:42 +01:00
|
|
|
mcMMOPlayer.toggleGodMode();
|
|
|
|
}
|
2013-03-28 17:57:49 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void sendSuccessMessage(CommandSender sender) {
|
|
|
|
sender.sendMessage("God mode has been toggled for " + player.getName()); // TODO: Localize
|
|
|
|
}
|
2013-03-01 06:52:01 +01:00
|
|
|
}
|