From 8c5ea484eb2920fef328bd46d89d644d452815cb Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 19 Jan 2019 15:10:42 -0800 Subject: [PATCH] XP Bars will no longer update for party xp or vampirism xp --- .../com/gmail/nossr50/datatypes/player/McMMOPlayer.java | 5 +++-- src/main/java/com/gmail/nossr50/listeners/SelfListener.java | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java index d2f6e89fe..f8c87cfcf 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -142,9 +142,10 @@ public class McMMOPlayer { experienceBarManager.hideExperienceBar(primarySkillType); }*/ - public void processPostXpEvent(PrimarySkillType primarySkillType, mcMMO plugin) + public void processPostXpEvent(XPGainReason xpGainReason, PrimarySkillType primarySkillType, mcMMO plugin) { - updateXPBar(primarySkillType, plugin); + if(xpGainReason != XPGainReason.SHARED_PVP && xpGainReason != XPGainReason.SHARED_PVE && xpGainReason != XPGainReason.VAMPIRISM) + updateXPBar(primarySkillType, plugin); } public void updateXPBar(PrimarySkillType primarySkillType, mcMMO plugin) diff --git a/src/main/java/com/gmail/nossr50/listeners/SelfListener.java b/src/main/java/com/gmail/nossr50/listeners/SelfListener.java index 3ee6dc104..75e7848c8 100644 --- a/src/main/java/com/gmail/nossr50/listeners/SelfListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/SelfListener.java @@ -63,7 +63,7 @@ public class SelfListener implements Listener { if (event.getXpGainReason() == XPGainReason.COMMAND) { //Update the XP Bar - mcMMOPlayer.processPostXpEvent(primarySkillType, plugin); + mcMMOPlayer.processPostXpEvent(event.getXpGainReason(), primarySkillType, plugin); return; } @@ -72,7 +72,7 @@ public class SelfListener implements Listener { if (threshold <= 0 || !ExperienceConfig.getInstance().getDiminishedReturnsEnabled()) { // Diminished returns is turned off //Update the XP Bar - mcMMOPlayer.processPostXpEvent(primarySkillType, plugin); + mcMMOPlayer.processPostXpEvent(event.getXpGainReason(), primarySkillType, plugin); return; } @@ -118,6 +118,6 @@ public class SelfListener implements Listener { //Update the XP Bar if(!event.isCancelled()) - mcMMOPlayer.processPostXpEvent(primarySkillType, plugin); + mcMMOPlayer.processPostXpEvent(event.getXpGainReason(), primarySkillType, plugin); } }