mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Fix to NPE in the Party API getPartyName method when the target isn't in a party.
It now returns "null" if the player isn't in a party.
This commit is contained in:
parent
dafa690a09
commit
811ba7d6fc
@ -9,7 +9,8 @@ Key:
|
|||||||
|
|
||||||
Version 1.4.04-dev
|
Version 1.4.04-dev
|
||||||
= Fixed bug where trying to activate a Chimaera Wing would require one item too much
|
= Fixed bug where trying to activate a Chimaera Wing would require one item too much
|
||||||
= Fixed bug where Treefeller would try to cut too many leaves and reach the threshold when it shouldn't
|
= Fixed bug where Treefeller would try to cut too many leaves and reach the threshold when it shouldn't
|
||||||
|
= Fixed bug where the API would fail if the name of a player's current party is requested when the player isn't in one.
|
||||||
|
|
||||||
Version 1.4.03
|
Version 1.4.03
|
||||||
+ Added option to advanced.yml to determine the # of enchant levels used when buffing Super Breaker & Giga Drill Breaker
|
+ Added option to advanced.yml to determine the # of enchant levels used when buffing Super Breaker & Giga Drill Breaker
|
||||||
|
@ -19,9 +19,12 @@ public final class PartyAPI {
|
|||||||
* This function is designed for API usage.
|
* This function is designed for API usage.
|
||||||
*
|
*
|
||||||
* @param player The player to check the party name of
|
* @param player The player to check the party name of
|
||||||
* @return the name of the player's party
|
* @return the name of the player's party, or null if not in a party
|
||||||
*/
|
*/
|
||||||
public static String getPartyName(Player player) {
|
public static String getPartyName(Player player) {
|
||||||
|
if (!inParty(player)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return UserManager.getPlayer(player).getParty().getName();
|
return UserManager.getPlayer(player).getParty().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user