mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 21:56:47 +01:00
30 lines
890 B
Java
30 lines
890 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 McgodCommand extends ToggleCommand {
|
|
@Override
|
|
protected boolean hasOtherPermission(CommandSender sender) {
|
|
return Permissions.mcgodOthers(sender);
|
|
}
|
|
|
|
@Override
|
|
protected boolean hasSelfPermission(CommandSender sender) {
|
|
return Permissions.mcgod(sender);
|
|
}
|
|
|
|
@Override
|
|
protected void applyCommandAction() {
|
|
player.sendMessage(LocaleLoader.getString("Commands.GodMode." + (mcMMOPlayer.getGodMode() ? "Disabled" : "Enabled")));
|
|
mcMMOPlayer.toggleGodMode();
|
|
}
|
|
|
|
@Override
|
|
protected void sendSuccessMessage(CommandSender sender) {
|
|
sender.sendMessage("God mode has been toggled for " + player.getName()); // TODO: Localize
|
|
}
|
|
}
|