mcMMO/src/main/java/com/gmail/nossr50/skills/SkillManager.java
bm01 7d83dd8283 Put McMMOPlayer to use where it made sense
It's basically a wrapper for anything related to players, as a
consequence Users.getProfile() is now depreciated.
Also removed SkillTools.xpProcessing() because of some redundancy with
McMMOPlayer.addXp().
+ some cleanup for consistency sake.
2013-02-01 06:38:25 +01:00

31 lines
916 B
Java

package com.gmail.nossr50.skills;
import com.gmail.nossr50.datatypes.McMMOPlayer;
import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
public abstract class SkillManager {
protected McMMOPlayer mcMMOPlayer;
protected int skillLevel;
protected int activationChance;
public SkillManager(McMMOPlayer mcMMOPlayer, SkillType skill) {
this.mcMMOPlayer = mcMMOPlayer;
this.skillLevel = mcMMOPlayer.getProfile().getSkillLevel(skill);
this.activationChance = Misc.calculateActivationChance(Permissions.lucky(mcMMOPlayer.getPlayer(), skill));
}
public McMMOPlayer getMcMMOPlayer() {
return mcMMOPlayer;
}
public int getSkillLevel() {
return skillLevel;
}
public int getActivationChance() {
return activationChance;
}
}