Fix bug where mcMMO damage wasn't awarding XP.

Fixes #1400
This commit is contained in:
GJ
2013-09-09 12:00:37 -04:00
parent 14daee3b1b
commit 71ab678945
5 changed files with 18 additions and 14 deletions

View File

@ -348,7 +348,7 @@ public final class CombatUtils {
* @param damage Amount of damage to attempt to do
*/
public static void dealDamage(LivingEntity target, double damage) {
dealDamage(target, damage, DamageCause.CUSTOM, null);
dealDamage(target, damage, DamageCause.CUSTOM, null, null, null);
}
/**
@ -358,8 +358,8 @@ public final class CombatUtils {
* @param damage Amount of damage to attempt to do
* @param attacker Player to pass to event as damager
*/
public static void dealDamage(LivingEntity target, double damage, LivingEntity attacker) {
dealDamage(target, damage, DamageCause.ENTITY_ATTACK, attacker);
public static void dealDamage(LivingEntity target, double damage, LivingEntity attacker, McMMOPlayer mcMMOPlayer, SkillType skill) {
dealDamage(target, damage, DamageCause.ENTITY_ATTACK, attacker, mcMMOPlayer, skill);
}
/**
@ -369,7 +369,7 @@ public final class CombatUtils {
* @param damage Amount of damage to attempt to do
* @param attacker Player to pass to event as damager
*/
public static void dealDamage(LivingEntity target, double damage, DamageCause cause, Entity attacker) {
public static void dealDamage(LivingEntity target, double damage, DamageCause cause, Entity attacker, McMMOPlayer mcMMOPlayer, SkillType skill) {
if (target.isDead()) {
return;
}
@ -385,6 +385,10 @@ public final class CombatUtils {
damage = damageEvent.getDamage();
}
if (mcMMOPlayer != null) {
startGainXp(mcMMOPlayer, target, skill);
}
target.damage(damage);
}
@ -432,7 +436,7 @@ public final class CombatUtils {
break;
}
dealDamage(livingEntity, damageAmount, attacker);
dealDamage(livingEntity, damageAmount, attacker, UserManager.getPlayer(attacker), type);
numberOfTargets--;
}
}