fix for entity damaged by projectile event

By: Andrew Ardill <andrew.ardill@gmail.com>
This commit is contained in:
Bukkit/Spigot 2011-01-20 20:22:34 +11:00
parent 396f22f816
commit a5351d75bb
2 changed files with 8 additions and 1 deletions

View File

@ -16,6 +16,12 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent implements Canc
super(Event.Type.ENTITY_DAMAGEDBY_ENTITY, damagee, cause, damage);
this.damager = damager;
}
protected EntityDamageByEntityEvent(Type damageType, Entity damager, Entity damagee, DamageCause cause, int damage)
{
super(damageType, damagee, cause, damage);
this.damager = damager;
}
/**
* Returns the entity that damaged the defender.

View File

@ -3,6 +3,7 @@ package org.bukkit.event.entity;
import java.util.Random;
import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
@ -10,7 +11,7 @@ public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
private boolean bounce;
public EntityDamageByProjectileEvent(Entity damager, Entity damagee, Entity projectile, DamageCause cause, int damage) {
super(damager, damagee, cause, damage);
super(Event.Type.ENTITY_DAMAGEDBY_PROJECTILE, damager, damagee, cause, damage);
this.projectile = projectile;
Random random = new Random();
this.bounce = random.nextBoolean();