2013-03-01 06:52:01 +01:00
|
|
|
package com.gmail.nossr50.commands;
|
|
|
|
|
2013-10-29 16:45:27 +01:00
|
|
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
2013-03-01 06:52:01 +01:00
|
|
|
import com.gmail.nossr50.locale.LocaleLoader;
|
|
|
|
import com.gmail.nossr50.util.Permissions;
|
2019-01-15 07:11:58 +01:00
|
|
|
import org.bukkit.command.CommandSender;
|
2013-03-12 21:25:42 +01:00
|
|
|
|
2013-03-28 17:57:49 +01:00
|
|
|
public class McrefreshCommand 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.mcrefreshOthers(sender);
|
|
|
|
}
|
2013-03-01 06:52:01 +01:00
|
|
|
|
2013-03-28 17:57:49 +01:00
|
|
|
@Override
|
|
|
|
protected boolean hasSelfPermission(CommandSender sender) {
|
|
|
|
return Permissions.mcrefresh(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
|
2013-10-29 16:45:27 +01:00
|
|
|
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
|
2013-03-12 21:25:42 +01:00
|
|
|
mcMMOPlayer.setRecentlyHurt(0);
|
2013-10-29 16:02:57 +01:00
|
|
|
mcMMOPlayer.resetCooldowns();
|
2013-03-12 21:25:42 +01:00
|
|
|
mcMMOPlayer.resetToolPrepMode();
|
|
|
|
mcMMOPlayer.resetAbilityMode();
|
|
|
|
|
2013-10-29 16:45:27 +01:00
|
|
|
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
2013-03-12 21:25:42 +01:00
|
|
|
}
|
2013-03-28 17:57:49 +01:00
|
|
|
|
|
|
|
@Override
|
2013-10-29 16:45:27 +01:00
|
|
|
protected void sendSuccessMessage(CommandSender sender, String playerName) {
|
|
|
|
sender.sendMessage(LocaleLoader.getString("Commands.mcrefresh.Success", playerName));
|
2013-03-28 17:57:49 +01:00
|
|
|
}
|
2013-03-01 06:52:01 +01:00
|
|
|
}
|