Update changelog and fix bug

This commit is contained in:
NuclearW
2012-01-29 16:05:46 -05:00
parent 0b5a60e4c6
commit 3552b756e0
2 changed files with 14 additions and 2 deletions

View File

@ -361,8 +361,7 @@ public class Combat
* @param dmg Amount of damage to attempt to do
*/
public static void dealDamage(LivingEntity target, int dmg){
EntityDamageEvent ede = new EntityDamageEvent(target, EntityDamageEvent.DamageCause.CUSTOM, dmg);
Bukkit.getPluginManager().callEvent(ede);
dealDamage(target, dmg, EntityDamageEvent.DamageCause.CUSTOM);
}
/**
@ -375,6 +374,9 @@ public class Combat
public static void dealDamage(LivingEntity target, int dmg, DamageCause cause) {
EntityDamageEvent ede = new EntityDamageEvent(target, cause, dmg);
Bukkit.getPluginManager().callEvent(ede);
if(ede.isCancelled()) return;
target.damage(ede.getDamage());
}
/**
@ -387,6 +389,8 @@ public class Combat
public static void dealDamage(LivingEntity target, int dmg, Player attacker) {
EntityDamageEvent ede = new EntityDamageByEntityEvent(attacker, target, EntityDamageEvent.DamageCause.ENTITY_ATTACK, dmg);
Bukkit.getPluginManager().callEvent(ede);
target.damage(ede.getDamage());
}
public static boolean pvpAllowed(EntityDamageByEntityEvent event, World world)