mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-24 14:16:45 +01:00
7d83dd8283
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.
31 lines
916 B
Java
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;
|
|
}
|
|
}
|