mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-31 21:37:39 +01:00
fix for entity damaged by projectile event
By: Andrew Ardill <andrew.ardill@gmail.com>
This commit is contained in:
parent
396f22f816
commit
a5351d75bb
@ -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.
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user