mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
parent
6d0fe4fb58
commit
9b4070d971
@ -1,4 +1,5 @@
|
|||||||
Version 2.1.196
|
Version 2.1.196
|
||||||
|
Fixed a possible null error for our SelfListener
|
||||||
Crossbows can now be fished up with enchantments
|
Crossbows can now be fished up with enchantments
|
||||||
|
|
||||||
NOTES:
|
NOTES:
|
||||||
|
@ -33,6 +33,13 @@ public class SelfListener implements Listener {
|
|||||||
public void onPlayerLevelUp(McMMOPlayerLevelUpEvent event) {
|
public void onPlayerLevelUp(McMMOPlayerLevelUpEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
PrimarySkillType skill = event.getSkill();
|
PrimarySkillType skill = event.getSkill();
|
||||||
|
|
||||||
|
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||||
|
|
||||||
|
//TODO: Handle proper validation at the event level
|
||||||
|
if(mcMMOPlayer == null || !mcMMOPlayer.getProfile().isLoaded())
|
||||||
|
return;
|
||||||
|
|
||||||
if(player.isOnline()) {
|
if(player.isOnline()) {
|
||||||
//Players can gain multiple levels especially during xprate events
|
//Players can gain multiple levels especially during xprate events
|
||||||
for(int i = 0; i < event.getLevelsGained(); i++)
|
for(int i = 0; i < event.getLevelsGained(); i++)
|
||||||
@ -73,6 +80,11 @@ public class SelfListener implements Listener {
|
|||||||
public void onPlayerXpGain(McMMOPlayerXpGainEvent event) {
|
public void onPlayerXpGain(McMMOPlayerXpGainEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||||
|
|
||||||
|
//TODO: Handle proper validation at the event level
|
||||||
|
if(mcMMOPlayer == null || !mcMMOPlayer.getProfile().isLoaded())
|
||||||
|
return;
|
||||||
|
|
||||||
PrimarySkillType primarySkillType = event.getSkill();
|
PrimarySkillType primarySkillType = event.getSkill();
|
||||||
|
|
||||||
if(mcMMOPlayer.isDebugMode()) {
|
if(mcMMOPlayer.isDebugMode()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user