mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Added API to XP events to get XP gain reason
This commit is contained in:
@ -12,6 +12,7 @@ import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.XPGainReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
@ -62,7 +63,7 @@ public class AcrobaticsManager extends SkillManager {
|
||||
|
||||
// Why do we check respawn cooldown here?
|
||||
if (SkillUtils.cooldownExpired(mcMMOPlayer.getRespawnATS(), Misc.PLAYER_RESPAWN_COOLDOWN_SECONDS)) {
|
||||
applyXpGain((float) (damage * Acrobatics.dodgeXpModifier));
|
||||
applyXpGain((float) (damage * Acrobatics.dodgeXpModifier), XPGainReason.PVP);
|
||||
}
|
||||
|
||||
return modifiedDamage;
|
||||
@ -88,12 +89,12 @@ public class AcrobaticsManager extends SkillManager {
|
||||
|
||||
if (!isFatal(modifiedDamage) && SkillUtils.activationSuccessful(SecondaryAbility.ROLL, player, getSkillLevel(), activationChance)) {
|
||||
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Text"));
|
||||
applyXpGain(calculateRollXP(damage, true));
|
||||
applyXpGain(calculateRollXP(damage, true), XPGainReason.PVE);
|
||||
|
||||
return modifiedDamage;
|
||||
}
|
||||
else if (!isFatal(damage)) {
|
||||
applyXpGain(calculateRollXP(damage, false));
|
||||
applyXpGain(calculateRollXP(damage, false), XPGainReason.PVE);
|
||||
}
|
||||
|
||||
lastFallLocation = player.getLocation();
|
||||
@ -112,12 +113,12 @@ public class AcrobaticsManager extends SkillManager {
|
||||
|
||||
if (!isFatal(modifiedDamage) && SkillUtils.activationSuccessful(SecondaryAbility.GRACEFUL_ROLL, getPlayer(), getSkillLevel(), activationChance)) {
|
||||
getPlayer().sendMessage(LocaleLoader.getString("Acrobatics.Ability.Proc"));
|
||||
applyXpGain(calculateRollXP(damage, true));
|
||||
applyXpGain(calculateRollXP(damage, true), XPGainReason.PVE);
|
||||
|
||||
return modifiedDamage;
|
||||
}
|
||||
else if (!isFatal(damage)) {
|
||||
applyXpGain(calculateRollXP(damage, false));
|
||||
applyXpGain(calculateRollXP(damage, false), XPGainReason.PVE);
|
||||
}
|
||||
|
||||
return damage;
|
||||
|
Reference in New Issue
Block a user