Removed CallEvent from dealDamage(), we don't need it. Fixes #170

This commit is contained in:
nossr50 2012-02-13 19:09:14 -08:00
parent b4637a825e
commit e77be3350f
2 changed files with 2 additions and 12 deletions

View File

@ -16,7 +16,6 @@
*/
package com.gmail.nossr50;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.*;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -377,11 +376,7 @@ public class Combat
* @param cause DamageCause to pass to damage event
*/
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());
target.damage(dmg);
}
/**
@ -392,11 +387,7 @@ public class Combat
* @param attacker Player to pass to event as damager
*/
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);
if(ede.isCancelled()) return;
target.damage(ede.getDamage());
target.damage(dmg);
}
public static boolean pvpAllowed(EntityDamageByEntityEvent event, World world)

View File

@ -33,7 +33,6 @@ import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.Combat;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;