mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	NPE fix for McMMOPlayerExperienceEvent
This commit is contained in:
		@@ -29,7 +29,13 @@ public abstract class McMMOPlayerExperienceEvent extends PlayerEvent implements
 | 
			
		||||
    protected McMMOPlayerExperienceEvent(Player player, PrimarySkillType skill, XPGainReason xpGainReason) {
 | 
			
		||||
        super(player);
 | 
			
		||||
        this.skill = skill;
 | 
			
		||||
        this.skillLevel = UserManager.getPlayer(player).getSkillLevel(skill);
 | 
			
		||||
 | 
			
		||||
        if(UserManager.getPlayer(player) != null) {
 | 
			
		||||
            this.skillLevel = UserManager.getPlayer(player).getSkillLevel(skill);
 | 
			
		||||
        } else {
 | 
			
		||||
            this.skillLevel = 0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        this.xpGainReason = xpGainReason;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -74,10 +74,6 @@ import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
public class mcMMO extends JavaPlugin {
 | 
			
		||||
    public static final String ULTRA_PERMISSONS = "UltraPermissons";
 | 
			
		||||
    public static final String UP_WARNING_2 = "Stop using " + ULTRA_PERMISSONS + " with mcMMO immediately!";
 | 
			
		||||
    public static final String UP_WARNING_1 = "mcMMO has detected " + ULTRA_PERMISSONS + " on your server, users have reported a severe plugin conflict between these two plugins which severely degrades server performance";
 | 
			
		||||
    public static final String UP_WARNING_3 = "The author of UltraPermissions has passed away and its unlikely this issue will ever be solved";
 | 
			
		||||
    /* Managers */
 | 
			
		||||
    private static PlatformManager platformManager;
 | 
			
		||||
    private static ChunkManager       placeStore;
 | 
			
		||||
@@ -152,6 +148,11 @@ public class mcMMO extends JavaPlugin {
 | 
			
		||||
 | 
			
		||||
    public static FixedMetadataValue metadataValue;
 | 
			
		||||
 | 
			
		||||
    public static final String ULTRA_PERMISSONS = "UltraPermissons";
 | 
			
		||||
    public static final String UP_WARNING_2 = "Stop using " + ULTRA_PERMISSONS + " with mcMMO immediately!";
 | 
			
		||||
    public static final String UP_WARNING_1 = "mcMMO has detected " + ULTRA_PERMISSONS + " on your server, users have reported a severe plugin conflict between these two plugins which severely degrades server performance";
 | 
			
		||||
    public static final String UP_WARNING_3 = "The author of UltraPermissions has passed away and its unlikely this issue will ever be solved";
 | 
			
		||||
 | 
			
		||||
    public mcMMO() {
 | 
			
		||||
        p = this;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user