mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 14:46:46 +01:00
Fixed an NPE that may occur with random chances on a player without loaded data
Also correct changelog version
This commit is contained in:
parent
1e2f11f4f9
commit
ac29c51d6e
@ -1,9 +1,8 @@
|
||||
Version 2.1.101
|
||||
mcnotify command now checks that it's being executed by a player
|
||||
Fixed some concurrency concerns around BleedTasks
|
||||
|
||||
Version 2.1.100
|
||||
Corrected some mistakes made in the updated Russian locale (thanks myfbone!)
|
||||
mcnotify command now checks that it's being executed by a player
|
||||
Fixed some concurrency concerns around BleedTasks
|
||||
Fixed an NPE that may occur with random chances on a player without loaded data
|
||||
|
||||
Version 2.1.99
|
||||
MASSIVE update to the Russian locale (ru) credit to myfbone
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.gmail.nossr50.util.random;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
@ -21,10 +22,12 @@ public class RandomChanceSkill implements RandomChanceExecution {
|
||||
this.subSkillType = subSkillType;
|
||||
this.probabilityCap = RandomChanceUtil.LINEAR_CURVE_VAR;
|
||||
|
||||
if(player != null)
|
||||
this.skillLevel = UserManager.getPlayer(player).getSkillLevel(primarySkillType);
|
||||
else
|
||||
final McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
if (player != null && mcMMOPlayer != null) {
|
||||
this.skillLevel = mcMMOPlayer.getSkillLevel(primarySkillType);
|
||||
} else {
|
||||
this.skillLevel = 0;
|
||||
}
|
||||
|
||||
if(player != null)
|
||||
isLucky = Permissions.lucky(player, primarySkillType);
|
||||
@ -42,10 +45,12 @@ public class RandomChanceSkill implements RandomChanceExecution {
|
||||
this.primarySkillType = subSkillType.getParentSkill();
|
||||
this.subSkillType = subSkillType;
|
||||
|
||||
if(player != null)
|
||||
this.skillLevel = UserManager.getPlayer(player).getSkillLevel(primarySkillType);
|
||||
else
|
||||
final McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
if (player != null && mcMMOPlayer != null) {
|
||||
this.skillLevel = mcMMOPlayer.getSkillLevel(primarySkillType);
|
||||
} else {
|
||||
this.skillLevel = 0;
|
||||
}
|
||||
|
||||
if(player != null)
|
||||
isLucky = Permissions.lucky(player, primarySkillType);
|
||||
|
Loading…
Reference in New Issue
Block a user