mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Wrap these inside McMMOPlayer for easier access.
This commit is contained in:
@ -3,7 +3,6 @@ package com.gmail.nossr50.skills;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.util.skills.PerksUtils;
|
||||
|
||||
@ -26,12 +25,8 @@ public abstract class SkillManager {
|
||||
return mcMMOPlayer.getPlayer();
|
||||
}
|
||||
|
||||
public PlayerProfile getProfile() {
|
||||
return mcMMOPlayer.getProfile();
|
||||
}
|
||||
|
||||
public int getSkillLevel() {
|
||||
return mcMMOPlayer.getProfile().getSkillLevel(skill);
|
||||
return mcMMOPlayer.getSkillLevel(skill);
|
||||
}
|
||||
|
||||
public int getActivationChance() {
|
||||
|
@ -396,6 +396,6 @@ public class HerbalismManager extends SkillManager {
|
||||
}
|
||||
|
||||
private byte getGreenThumbStage() {
|
||||
return (byte) Math.min(Math.min(getProfile().getSkillLevel(skill), Herbalism.greenThumbStageMaxLevel) / Herbalism.greenThumbStageChangeLevel, 4);
|
||||
return (byte) Math.min(Math.min(getSkillLevel(), Herbalism.greenThumbStageMaxLevel) / Herbalism.greenThumbStageChangeLevel, 4);
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ public class MiningManager extends SkillManager {
|
||||
tnt.setFuseTicks(0);
|
||||
targetBlock.setType(Material.AIR);
|
||||
|
||||
getProfile().setAbilityDATS(AbilityType.BLAST_MINING, System.currentTimeMillis());
|
||||
mcMMOPlayer.setAbilityDATS(AbilityType.BLAST_MINING, System.currentTimeMillis());
|
||||
mcMMOPlayer.setAbilityInformed(AbilityType.BLAST_MINING, false);
|
||||
new AbilityCooldownTask(mcMMOPlayer, AbilityType.BLAST_MINING).runTaskLaterAsynchronously(mcMMO.p, AbilityType.BLAST_MINING.getCooldown() * Misc.TICK_CONVERSION_FACTOR);
|
||||
}
|
||||
|
Reference in New Issue
Block a user