mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Account for level 0
This commit is contained in:
parent
8d200ea653
commit
0b4b272223
@ -369,12 +369,12 @@ public final class HolidayManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (newValue % modifier == 0) {
|
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) {
|
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.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 + ")");
|
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())));
|
ParticleEffectUtils.fireworkParticleShower(player, ALL_COLORS.get(Misc.getRandom().nextInt(ALL_COLORS.size())));
|
||||||
|
Loading…
Reference in New Issue
Block a user