mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Fixing no Xp gain from previous commit
This commit is contained in:
parent
2006356ccd
commit
610bc42815
@ -104,9 +104,11 @@ public class McMMOPlayer {
|
||||
}
|
||||
|
||||
if (party != null && !ShareHandler.isRunning()) {
|
||||
ShareHandler.handleEqualXpShare(xp, this, skillType);
|
||||
// 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)) {
|
||||
return;
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user