mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-24 14:16:45 +01:00
a2f80569e3
applicable. Fixes #921
42 lines
1.3 KiB
Java
42 lines
1.3 KiB
Java
package com.gmail.nossr50.commands.experience;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import com.gmail.nossr50.mcMMO;
|
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
|
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
|
|
import com.gmail.nossr50.locale.LocaleLoader;
|
|
import com.gmail.nossr50.util.Permissions;
|
|
import com.gmail.nossr50.util.skills.SkillUtils;
|
|
|
|
public class AddlevelsCommand extends ExperienceCommand {
|
|
@Override
|
|
protected boolean permissionsCheckSelf(CommandSender sender) {
|
|
return Permissions.addlevels(sender);
|
|
}
|
|
|
|
@Override
|
|
protected boolean permissionsCheckOthers(CommandSender sender) {
|
|
return Permissions.addlevelsOthers(sender);
|
|
}
|
|
|
|
@Override
|
|
protected void handleCommand(SkillType skill) {
|
|
profile.addLevels(skill, value);
|
|
|
|
if (player != null) {
|
|
mcMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerLevelUpEvent(player, skill, value));
|
|
}
|
|
}
|
|
|
|
@Override
|
|
protected void handlePlayerMessageAll() {
|
|
player.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.1", value));
|
|
}
|
|
|
|
@Override
|
|
protected void handlePlayerMessageSkill() {
|
|
player.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.1", value, SkillUtils.getSkillName(skill)));
|
|
}
|
|
}
|