XP Bars will no longer update for party xp or vampirism xp

This commit is contained in:
nossr50 2019-01-19 15:10:42 -08:00
parent eb1f097d18
commit 8c5ea484eb
2 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -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);
}
}