From 610bc42815b87ba2a16c9d21db8559dd2307f51e Mon Sep 17 00:00:00 2001 From: bm01 Date: Sat, 2 Feb 2013 05:06:47 +0100 Subject: [PATCH] Fixing no Xp gain from previous commit --- src/main/java/com/gmail/nossr50/datatypes/McMMOPlayer.java | 6 ++++-- src/main/java/com/gmail/nossr50/party/ShareHandler.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/datatypes/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/McMMOPlayer.java index 825a2b9b0..c575c94c0 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/McMMOPlayer.java @@ -104,8 +104,10 @@ public class McMMOPlayer { } if (party != null && !ShareHandler.isRunning()) { - ShareHandler.handleEqualXpShare(xp, this, skillType); - return; + // Return if the Xp has been shared + if (ShareHandler.handleEqualXpShare(xp, this, skillType)) { + return; + } } if ((skillType.getMaxLevel() < profile.getSkillLevel(skillType) + 1) || (Misc.getPowerLevelCap() < getPowerLevel() + 1)) { diff --git a/src/main/java/com/gmail/nossr50/party/ShareHandler.java b/src/main/java/com/gmail/nossr50/party/ShareHandler.java index 55d60a631..0224a2796 100644 --- a/src/main/java/com/gmail/nossr50/party/ShareHandler.java +++ b/src/main/java/com/gmail/nossr50/party/ShareHandler.java @@ -37,8 +37,9 @@ public final class ShareHandler { * @param xp Xp without party sharing * @param mcMMOPlayer Player initiating the Xp gain * @param skillType Skill being used + * @return True is the xp has been shared */ - public static void handleEqualXpShare(int xp, McMMOPlayer mcMMOPlayer, SkillType skillType) { + public static boolean handleEqualXpShare(int xp, McMMOPlayer mcMMOPlayer, SkillType skillType) { running = true; Party party = mcMMOPlayer.getParty(); @@ -48,7 +49,7 @@ public final class ShareHandler { if (nearMembers.isEmpty()) { running = false; - return; + return false; } double partySize = nearMembers.size() + 1; @@ -63,6 +64,7 @@ public final class ShareHandler { } running = false; + return true; } public static boolean isRunning() {