Fixed XP Bar

This commit is contained in:
nossr50 2012-03-28 19:45:34 -07:00
parent 6c6fb117ea
commit 8b07b189d4
2 changed files with 14 additions and 3 deletions

View File

@ -8,6 +8,7 @@ Key:
- Removal - Removal
Version 1.3.05-dev Version 1.3.05-dev
= Fixed XP bar not updating when XP was gained
= Fixed bug with repairing wooden tools = Fixed bug with repairing wooden tools
= Fixed bug where spawned wolves only had 8 health. = Fixed bug where spawned wolves only had 8 health.
! Changed Tree Feller to account for ability durability loss but not leaves. ! Changed Tree Feller to account for ability durability loss but not leaves.

View File

@ -190,9 +190,9 @@ public class Skills {
*/ */
public static void XpCheckSkill(SkillType skillType, Player player) { public static void XpCheckSkill(SkillType skillType, Player player) {
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);
int skillups = 0;
if (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) { if (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
int skillups = 0;
while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) { while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
if (skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) { if (skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) {
@ -233,6 +233,16 @@ public class Skills {
player.sendMessage(mcLocale.getString("Skills."+capitalized+"Up", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)})); player.sendMessage(mcLocale.getString("Skills."+capitalized+"Up", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)}));
} }
} }
/* Always update XP Bar (Check if no levels were gained first to remove redundancy) */
if(skillups == 0 && player instanceof SpoutPlayer) {
SpoutPlayer sPlayer = (SpoutPlayer) player;
if (sPlayer.isSpoutCraftEnabled()) {
if (LoadProperties.xpbar) {
SpoutStuff.updateXpBar(sPlayer);
}
}
}
} }
/** /**