mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 13:46:46 +01:00
35 lines
1.1 KiB
Java
35 lines
1.1 KiB
Java
package com.gmail.nossr50.commands;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
|
import com.gmail.nossr50.locale.LocaleLoader;
|
|
import com.gmail.nossr50.util.Permissions;
|
|
|
|
public class McrefreshCommand extends ToggleCommand {
|
|
@Override
|
|
protected boolean hasOtherPermission(CommandSender sender) {
|
|
return Permissions.mcrefreshOthers(sender);
|
|
}
|
|
|
|
@Override
|
|
protected boolean hasSelfPermission(CommandSender sender) {
|
|
return Permissions.mcrefresh(sender);
|
|
}
|
|
|
|
@Override
|
|
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
|
|
mcMMOPlayer.setRecentlyHurt(0);
|
|
mcMMOPlayer.resetCooldowns();
|
|
mcMMOPlayer.resetToolPrepMode();
|
|
mcMMOPlayer.resetAbilityMode();
|
|
|
|
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
|
}
|
|
|
|
@Override
|
|
protected void sendSuccessMessage(CommandSender sender, String playerName) {
|
|
sender.sendMessage(LocaleLoader.getString("Commands.mcrefresh.Success", playerName));
|
|
}
|
|
}
|