mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Fix NPE from unloaded profiles in HolidayManager
This commit is contained in:
parent
e8021e81e6
commit
9c342f24cd
@ -3,6 +3,7 @@ package com.gmail.nossr50.util;
|
|||||||
import com.gmail.nossr50.commands.skills.AprilCommand;
|
import com.gmail.nossr50.commands.skills.AprilCommand;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||||
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
@ -367,7 +368,10 @@ public final class HolidayManager {
|
|||||||
if(!Config.getInstance().isAprilFoolsAllowed())
|
if(!Config.getInstance().isAprilFoolsAllowed())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int levelTotal = Misc.getRandom().nextInt(1 + UserManager.getPlayer(player).getSkillLevel(PrimarySkillType.MINING)) + 1;
|
final McMMOPlayer mmoPlayer = UserManager.getPlayer(player);
|
||||||
|
if (mmoPlayer == null) return;
|
||||||
|
|
||||||
|
int levelTotal = Misc.getRandom().nextInt(1 + mmoPlayer.getSkillLevel(PrimarySkillType.MINING)) + 1;
|
||||||
SoundManager.sendSound(player, player.getLocation(), SoundType.LEVEL_UP);
|
SoundManager.sendSound(player, player.getLocation(), SoundType.LEVEL_UP);
|
||||||
NotificationManager.sendPlayerInformation(player, NotificationType.HOLIDAY, "Holiday.AprilFools.Levelup", StringUtils.getCapitalized(fakeSkillType.toString()), String.valueOf(levelTotal));
|
NotificationManager.sendPlayerInformation(player, NotificationType.HOLIDAY, "Holiday.AprilFools.Levelup", StringUtils.getCapitalized(fakeSkillType.toString()), String.valueOf(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