From b2cdf21de58b5ecbfb1e573feb33017ea3465db3 Mon Sep 17 00:00:00 2001 From: GJ Date: Sun, 17 Mar 2013 09:02:15 -0400 Subject: [PATCH] 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 (Thanks @dualspiral!) Closes #843 --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/api/PartyAPI.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 79d967346..7fd92c861 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -12,6 +12,7 @@ Version 1.4.04-dev = Fixed bug where Treefeller would try to cut too many leaves and reach the threshold when it shouldn't = Fixed bug where Mining wasn't awarding double drops = Fixed bug where Shake wouldn't damage mobs whose max health was less than 4 + = 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 (Thanks @dualspiral!) Version 1.4.03 + Added option to advanced.yml to determine the # of enchant levels used when buffing Super Breaker & Giga Drill Breaker diff --git a/src/main/java/com/gmail/nossr50/api/PartyAPI.java b/src/main/java/com/gmail/nossr50/api/PartyAPI.java index e0c83c36e..300972690 100644 --- a/src/main/java/com/gmail/nossr50/api/PartyAPI.java +++ b/src/main/java/com/gmail/nossr50/api/PartyAPI.java @@ -19,9 +19,13 @@ public final class PartyAPI { * This function is designed for API usage. * * @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) { + if (!inParty(player)) { + return null; + } + return UserManager.getPlayer(player).getParty().getName(); }