mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Removed getSkillLevel, it doesn't belong to SkillType
This commit is contained in:
parent
35f243a6e6
commit
6d9db06305
@ -5,6 +5,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
import org.bukkit.event.player.PlayerEvent;
|
import org.bukkit.event.player.PlayerEvent;
|
||||||
|
|
||||||
import com.gmail.nossr50.skills.utilities.SkillType;
|
import com.gmail.nossr50.skills.utilities.SkillType;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic event for mcMMO experience events.
|
* Generic event for mcMMO experience events.
|
||||||
@ -16,7 +17,7 @@ public abstract class McMMOPlayerExperienceEvent extends PlayerEvent {
|
|||||||
protected McMMOPlayerExperienceEvent(Player player, SkillType skill) {
|
protected McMMOPlayerExperienceEvent(Player player, SkillType skill) {
|
||||||
super(player);
|
super(player);
|
||||||
this.skill = skill;
|
this.skill = skill;
|
||||||
this.skillLevel = skill.getSkillLevel(player);
|
this.skillLevel = Users.getPlayer(player).getProfile().getSkillLevel(skill);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5,6 +5,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
import org.bukkit.event.player.PlayerEvent;
|
import org.bukkit.event.player.PlayerEvent;
|
||||||
|
|
||||||
import com.gmail.nossr50.skills.utilities.SkillType;
|
import com.gmail.nossr50.skills.utilities.SkillType;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic event for mcMMO skill handling.
|
* Generic event for mcMMO skill handling.
|
||||||
@ -16,7 +17,7 @@ public abstract class McMMOPlayerSkillEvent extends PlayerEvent {
|
|||||||
protected McMMOPlayerSkillEvent(Player player, SkillType skill) {
|
protected McMMOPlayerSkillEvent(Player player, SkillType skill) {
|
||||||
super(player);
|
super(player);
|
||||||
this.skill = skill;
|
this.skill = skill;
|
||||||
this.skillLevel = skill.getSkillLevel(player);
|
this.skillLevel = Users.getPlayer(player).getProfile().getSkillLevel(skill);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,7 +4,6 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.Users;
|
|
||||||
|
|
||||||
public enum SkillType {
|
public enum SkillType {
|
||||||
ACROBATICS(Config.getInstance().getLevelCapAcrobatics(), Config.getInstance().getFormulaMultiplierAcrobatics()),
|
ACROBATICS(Config.getInstance().getLevelCapAcrobatics(), Config.getInstance().getFormulaMultiplierAcrobatics()),
|
||||||
@ -129,17 +128,6 @@ public enum SkillType {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the skill level for this skill.
|
|
||||||
*
|
|
||||||
* @param player The player to check
|
|
||||||
* @return the player's skill level
|
|
||||||
*/
|
|
||||||
public int getSkillLevel(Player player) {
|
|
||||||
// TODO: Child skills aren't handled here
|
|
||||||
return Users.getPlayer(player).getProfile().getSkillLevel(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: This is a little "hacky", we probably need to add something to distinguish child skills in the enum, or to use another enum for them
|
// TODO: This is a little "hacky", we probably need to add something to distinguish child skills in the enum, or to use another enum for them
|
||||||
public boolean isChildSkill() {
|
public boolean isChildSkill() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
|
Loading…
Reference in New Issue
Block a user