mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	Change condition on power level command
This commit is contained in:
		@@ -7,6 +7,7 @@ import co.aikar.commands.annotation.CommandPermission;
 | 
			
		||||
import co.aikar.commands.annotation.Conditions;
 | 
			
		||||
import co.aikar.commands.annotation.Default;
 | 
			
		||||
import com.gmail.nossr50.commands.CommandManager;
 | 
			
		||||
import com.gmail.nossr50.config.AdvancedConfig;
 | 
			
		||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
 | 
			
		||||
import com.gmail.nossr50.mcMMO;
 | 
			
		||||
import com.gmail.nossr50.util.player.UserManager;
 | 
			
		||||
@@ -23,13 +24,22 @@ public class PowerLevelCommand extends BaseCommand {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Default
 | 
			
		||||
    @Conditions(CommandManager.ADMIN_CONDITION)
 | 
			
		||||
    @Conditions(CommandManager.POWER_LEVEL_CONDITION)
 | 
			
		||||
    public void processCommand(String[] args) {
 | 
			
		||||
        BukkitCommandIssuer bukkitCommandIssuer = (BukkitCommandIssuer) getCurrentCommandIssuer();
 | 
			
		||||
        Player player = bukkitCommandIssuer.getPlayer();
 | 
			
		||||
        McMMOPlayer mmoPlayer = UserManager.getPlayer(player); //Should never be null at this point because its caught in an ACF validation
 | 
			
		||||
        int powerLevel = mmoPlayer.getPowerLevel();
 | 
			
		||||
 | 
			
		||||
        //TODO: impl
 | 
			
		||||
        mmoPlayer.getPlayer().sendMessage("Your power level is: "+mmoPlayer.getPowerLevel()); //This is not gonna stay, just to show that the command executes in debug
 | 
			
		||||
        mmoPlayer.getPlayer().sendMessage("Your power level is: "+powerLevel); //This is not gonna stay, just to show that the command executes in debug
 | 
			
		||||
 | 
			
		||||
        //Send the players a few blank lines to make finding the top of the skill command easier
 | 
			
		||||
        if (AdvancedConfig.getInstance().doesSkillCommandSendBlankLines()) {
 | 
			
		||||
            for (int i = 0; i < 2; i++) {
 | 
			
		||||
                player.sendMessage("");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -74,10 +74,11 @@ public abstract class SkillCommand implements TabExecutor {
 | 
			
		||||
            float skillValue = mcMMOPlayer.getSkillLevel(skill);
 | 
			
		||||
 | 
			
		||||
            //Send the players a few blank lines to make finding the top of the skill command easier
 | 
			
		||||
            if (AdvancedConfig.getInstance().doesSkillCommandSendBlankLines())
 | 
			
		||||
            if (AdvancedConfig.getInstance().doesSkillCommandSendBlankLines()) {
 | 
			
		||||
                for (int i = 0; i < 2; i++) {
 | 
			
		||||
                    player.sendMessage("");
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            permissionsCheck(player);
 | 
			
		||||
            dataCalculations(player, skillValue);
 | 
			
		||||
@@ -136,10 +137,9 @@ public abstract class SkillCommand implements TabExecutor {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void sendSkillCommandHeader(Player player, McMMOPlayer mcMMOPlayer, int skillValue) {
 | 
			
		||||
        ChatColor hd1 = ChatColor.DARK_AQUA;
 | 
			
		||||
        ChatColor c1 = ChatColor.GOLD;
 | 
			
		||||
        ChatColor c2 = ChatColor.RED;
 | 
			
		||||
 | 
			
		||||
//        ChatColor hd1 = ChatColor.DARK_AQUA;
 | 
			
		||||
//        ChatColor c1 = ChatColor.GOLD;
 | 
			
		||||
//        ChatColor c2 = ChatColor.RED;
 | 
			
		||||
 | 
			
		||||
        player.sendMessage(LocaleLoader.getString("Skills.Overhaul.Header", skillName));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user