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; package com.gmail.nossr50;
import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.*; import org.bukkit.entity.*;
import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -377,11 +376,7 @@ public class Combat
* @param cause DamageCause to pass to damage event * @param cause DamageCause to pass to damage event
*/ */
public static void dealDamage(LivingEntity target, int dmg, DamageCause cause) { public static void dealDamage(LivingEntity target, int dmg, DamageCause cause) {
EntityDamageEvent ede = new EntityDamageEvent(target, cause, dmg); target.damage(dmg);
Bukkit.getPluginManager().callEvent(ede);
if(ede.isCancelled()) return;
target.damage(ede.getDamage());
} }
/** /**
@ -392,11 +387,7 @@ public class Combat
* @param attacker Player to pass to event as damager * @param attacker Player to pass to event as damager
*/ */
public static void dealDamage(LivingEntity target, int dmg, Player attacker) { public static void dealDamage(LivingEntity target, int dmg, Player attacker) {
EntityDamageEvent ede = new EntityDamageByEntityEvent(attacker, target, EntityDamageEvent.DamageCause.ENTITY_ATTACK, dmg); target.damage(dmg);
Bukkit.getPluginManager().callEvent(ede);
if(ede.isCancelled()) return;
target.damage(ede.getDamage());
} }
public static boolean pvpAllowed(EntityDamageByEntityEvent event, World world) 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.Combat;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;