mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	Fixed /Addxp on all skills not working properly
It was broken because of one of the previous commits
This commit is contained in:
		@@ -45,10 +45,12 @@ public class AddxpCommand implements CommandExecutor {
 | 
				
			|||||||
            profile = mcMMOPlayer.getProfile();
 | 
					            profile = mcMMOPlayer.getProfile();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (skill.equals(SkillType.ALL)) {
 | 
					            if (skill.equals(SkillType.ALL)) {
 | 
				
			||||||
                for (SkillType skillType : SkillType.values()) {
 | 
					                for (SkillType type : SkillType.values()) {
 | 
				
			||||||
                    if (!skillType.isChildSkill()) {
 | 
					                    if (type.equals(SkillType.ALL) || type.isChildSkill()) {
 | 
				
			||||||
                        mcMMOPlayer.applyXpGain(skill, xp);
 | 
					                        continue;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    mcMMOPlayer.applyXpGain(type, xp);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                sender.sendMessage(LocaleLoader.getString("Commands.addxp.AwardAll", xp));
 | 
					                sender.sendMessage(LocaleLoader.getString("Commands.addxp.AwardAll", xp));
 | 
				
			||||||
@@ -104,11 +106,22 @@ public class AddxpCommand implements CommandExecutor {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                profile.save(); // Since this is a temporary profile, we save it here.
 | 
					                profile.save(); // Since this is a temporary profile, we save it here.
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            else {
 | 
				
			||||||
 | 
					                if (skill.equals(SkillType.ALL)) {
 | 
				
			||||||
 | 
					                    for (SkillType type : SkillType.values()) {
 | 
				
			||||||
 | 
					                        if (type.equals(SkillType.ALL) || type.isChildSkill()) {
 | 
				
			||||||
 | 
					                            continue;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        mcMMOPlayer.applyXpGain(type, xp);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
                else {
 | 
					                else {
 | 
				
			||||||
                    mcMMOPlayer.applyXpGain(skill, xp);
 | 
					                    mcMMOPlayer.applyXpGain(skill, xp);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                modifiedPlayer = mcMMOPlayer.getPlayer();
 | 
					                modifiedPlayer = mcMMOPlayer.getPlayer();
 | 
				
			||||||
                profile = mcMMOPlayer.getProfile();
 | 
					                
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (modifiedPlayer.isOnline()) {
 | 
					                if (modifiedPlayer.isOnline()) {
 | 
				
			||||||
                    if (skill.equals(SkillType.ALL)) {
 | 
					                    if (skill.equals(SkillType.ALL)) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user