Account for level 0

This commit is contained in:
t00thpick1 2014-04-01 14:58:24 -04:00
parent 8d200ea653
commit 0b4b272223

View File

@ -369,12 +369,12 @@ public final class HolidayManager {
}
if (newValue % modifier == 0) {
mcMMO.p.getHolidayManager().levelUpApril(player, FakeSkillType.getByStatistic(statistic));
mcMMO.getHolidayManager().levelUpApril(player, FakeSkillType.getByStatistic(statistic));
}
}
public void levelUpApril(Player player, FakeSkillType fakeSkillType) {
int levelTotal = Misc.getRandom().nextInt(UserManager.getPlayer(player).getSkillLevel(SkillType.MINING)) + 1;
int levelTotal = Misc.getRandom().nextInt(1 + UserManager.getPlayer(player).getSkillLevel(SkillType.MINING)) + 1;
player.playSound(player.getLocation(), Sound.LEVEL_UP, Misc.LEVELUP_VOLUME, Misc.LEVELUP_PITCH);
player.sendMessage(ChatColor.YELLOW + StringUtils.getCapitalized(fakeSkillType.toString()) + " skill increased by 1. Total (" + levelTotal + ")");
ParticleEffectUtils.fireworkParticleShower(player, ALL_COLORS.get(Misc.getRandom().nextInt(ALL_COLORS.size())));