mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 21:56:47 +01:00
40 lines
1023 B
Java
40 lines
1023 B
Java
package com.gmail.nossr50.skills;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
|
import com.gmail.nossr50.util.skills.PerksUtils;
|
|
|
|
public abstract class SkillManager {
|
|
protected McMMOPlayer mcMMOPlayer;
|
|
protected int activationChance;
|
|
protected SkillType skill;
|
|
|
|
public SkillManager(McMMOPlayer mcMMOPlayer, SkillType skill) {
|
|
this.mcMMOPlayer = mcMMOPlayer;
|
|
this.activationChance = PerksUtils.handleLuckyPerks(mcMMOPlayer.getPlayer(), skill);
|
|
this.skill = skill;
|
|
}
|
|
|
|
public McMMOPlayer getMcMMOPlayer() {
|
|
return mcMMOPlayer;
|
|
}
|
|
|
|
public Player getPlayer() {
|
|
return mcMMOPlayer.getPlayer();
|
|
}
|
|
|
|
public int getSkillLevel() {
|
|
return mcMMOPlayer.getSkillLevel(skill);
|
|
}
|
|
|
|
public int getActivationChance() {
|
|
return activationChance;
|
|
}
|
|
|
|
public void applyXpGain(float xp) {
|
|
mcMMOPlayer.beginXpGain(skill, xp);
|
|
}
|
|
}
|