Wrap these inside McMMOPlayer for easier access.

This commit is contained in:
GJ
2013-10-29 11:02:57 -04:00
parent a8d1376533
commit 97b9214d6e
17 changed files with 105 additions and 74 deletions

View File

@ -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() {

View File

@ -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);
}
}

View File

@ -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);
}