mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-03 10:33:43 +01:00 
			
		
		
		
	UserManager::getPlayer returns null again (oopsie)
This commit is contained in:
		@@ -7,6 +7,12 @@ Key:
 | 
				
			|||||||
  ! Change
 | 
					  ! Change
 | 
				
			||||||
  - Removal
 | 
					  - Removal
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Version 2.1.42
 | 
				
			||||||
 | 
					    Fixed McMMOPlayerNotFoundException being thrown instead of null
 | 
				
			||||||
 | 
					    (API) UserManager.getPlayer() returns null again (oopsie)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    NOTE: Sorry about that, when trying to improve Bungee Cord compatibility I made a big oopsie!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Version 2.1.41
 | 
					Version 2.1.41
 | 
				
			||||||
    Fixed NullPointerException errors when trying to grab PlayerProfiles for players who have not loaded
 | 
					    Fixed NullPointerException errors when trying to grab PlayerProfiles for players who have not loaded
 | 
				
			||||||
    Added new locale string Profile.PendingLoad
 | 
					    Added new locale string Profile.PendingLoad
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							@@ -2,7 +2,7 @@
 | 
				
			|||||||
    <modelVersion>4.0.0</modelVersion>
 | 
					    <modelVersion>4.0.0</modelVersion>
 | 
				
			||||||
    <groupId>com.gmail.nossr50.mcMMO</groupId>
 | 
					    <groupId>com.gmail.nossr50.mcMMO</groupId>
 | 
				
			||||||
    <artifactId>mcMMO</artifactId>
 | 
					    <artifactId>mcMMO</artifactId>
 | 
				
			||||||
    <version>2.1.41</version>
 | 
					    <version>2.1.42-SNAPSHOT</version>
 | 
				
			||||||
    <name>mcMMO</name>
 | 
					    <name>mcMMO</name>
 | 
				
			||||||
    <url>https://github.com/mcMMO-Dev/mcMMO</url>
 | 
					    <url>https://github.com/mcMMO-Dev/mcMMO</url>
 | 
				
			||||||
    <scm>
 | 
					    <scm>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -101,12 +101,12 @@ public final class UserManager {
 | 
				
			|||||||
     * @param player target player
 | 
					     * @param player target player
 | 
				
			||||||
     * @return McMMOPlayer object for this player, null if Player has not been loaded
 | 
					     * @return McMMOPlayer object for this player, null if Player has not been loaded
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static McMMOPlayer getPlayer(Player player) throws McMMOPlayerNotFoundException {
 | 
					    public static McMMOPlayer getPlayer(Player player) {
 | 
				
			||||||
        //Avoid Array Index out of bounds
 | 
					        //Avoid Array Index out of bounds
 | 
				
			||||||
        if(player.hasMetadata(mcMMO.playerDataKey))
 | 
					        if(player.hasMetadata(mcMMO.playerDataKey))
 | 
				
			||||||
            return (McMMOPlayer) player.getMetadata(mcMMO.playerDataKey).get(0).value();
 | 
					            return (McMMOPlayer) player.getMetadata(mcMMO.playerDataKey).get(0).value();
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
            throw new McMMOPlayerNotFoundException(player);
 | 
					            return null;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private static McMMOPlayer retrieveMcMMOPlayer(String playerName, boolean offlineValid) {
 | 
					    private static McMMOPlayer retrieveMcMMOPlayer(String playerName, boolean offlineValid) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user