mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
UserManager::getPlayer returns null again (oopsie)
This commit is contained in:
parent
2a053a0be2
commit
f6e01ea910
@ -7,6 +7,12 @@ Key:
|
||||
! Change
|
||||
- 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
|
||||
Fixed NullPointerException errors when trying to grab PlayerProfiles for players who have not loaded
|
||||
Added new locale string Profile.PendingLoad
|
||||
|
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>2.1.41</version>
|
||||
<version>2.1.42-SNAPSHOT</version>
|
||||
<name>mcMMO</name>
|
||||
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
||||
<scm>
|
||||
|
@ -101,12 +101,12 @@ public final class UserManager {
|
||||
* @param player target player
|
||||
* @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
|
||||
if(player.hasMetadata(mcMMO.playerDataKey))
|
||||
return (McMMOPlayer) player.getMetadata(mcMMO.playerDataKey).get(0).value();
|
||||
else
|
||||
throw new McMMOPlayerNotFoundException(player);
|
||||
return null;
|
||||
}
|
||||
|
||||
private static McMMOPlayer retrieveMcMMOPlayer(String playerName, boolean offlineValid) {
|
||||
|
Loading…
Reference in New Issue
Block a user