geforkt von Mirrors/Paper
[Bleeding] Fire EntityDamageByEntityEvent's for EnderDragon being hit by Projectiles.
Dieser Commit ist enthalten in:
Ursprung
7ff8c17568
Commit
391ac23c9a
@ -201,8 +201,7 @@ public class EntityArrow extends Entity {
|
|||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
boolean stick;
|
boolean stick;
|
||||||
if (entity instanceof EntityLiving) {
|
if (entity instanceof EntityLiving || entity instanceof EntityComplexPart) {
|
||||||
|
|
||||||
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
|
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
|
||||||
Projectile projectile = (Projectile) this.getBukkitEntity();
|
Projectile projectile = (Projectile) this.getBukkitEntity();
|
||||||
|
|
||||||
@ -218,6 +217,7 @@ public class EntityArrow extends Entity {
|
|||||||
} else {
|
} else {
|
||||||
stick = movingobjectposition.entity.damageEntity(damagesource, l);
|
stick = movingobjectposition.entity.damageEntity(damagesource, l);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stick) {
|
if (stick) {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
if (movingobjectposition.entity instanceof EntityLiving) {
|
if (movingobjectposition.entity instanceof EntityLiving) {
|
||||||
|
@ -8,7 +8,6 @@ import org.bukkit.entity.Projectile;
|
|||||||
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
|
||||||
import org.bukkit.event.player.PlayerEggThrowEvent;
|
import org.bukkit.event.player.PlayerEggThrowEvent;
|
||||||
|
|
||||||
public class EntityEgg extends EntityProjectile {
|
public class EntityEgg extends EntityProjectile {
|
||||||
@ -29,7 +28,7 @@ public class EntityEgg extends EntityProjectile {
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (movingobjectposition.entity != null) {
|
if (movingobjectposition.entity != null) {
|
||||||
boolean stick;
|
boolean stick;
|
||||||
if (movingobjectposition.entity instanceof EntityLiving) {
|
if (movingobjectposition.entity instanceof EntityLiving || movingobjectposition.entity instanceof EntityComplexPart) {
|
||||||
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
|
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
|
||||||
Projectile projectile = (Projectile) this.getBukkitEntity();
|
Projectile projectile = (Projectile) this.getBukkitEntity();
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ import java.util.List;
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
|
||||||
import org.bukkit.entity.Explosive;
|
import org.bukkit.entity.Explosive;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
@ -189,7 +188,7 @@ public class EntityFireball extends Entity {
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (movingobjectposition.entity != null) {
|
if (movingobjectposition.entity != null) {
|
||||||
boolean stick;
|
boolean stick;
|
||||||
if (movingobjectposition.entity instanceof EntityLiving) {
|
if (movingobjectposition.entity instanceof EntityLiving || movingobjectposition.entity instanceof EntityComplexPart) {
|
||||||
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
|
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
|
||||||
Projectile projectile = (Projectile) this.getBukkitEntity();
|
Projectile projectile = (Projectile) this.getBukkitEntity();
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ public class EntityFishingHook extends Entity {
|
|||||||
if (movingobjectposition.entity != null) {
|
if (movingobjectposition.entity != null) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
boolean stick;
|
boolean stick;
|
||||||
if (movingobjectposition.entity instanceof EntityLiving) {
|
if (movingobjectposition.entity instanceof EntityLiving || movingobjectposition.entity instanceof EntityComplexPart) {
|
||||||
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
|
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
|
||||||
Projectile projectile = (Projectile) this.getBukkitEntity();
|
Projectile projectile = (Projectile) this.getBukkitEntity();
|
||||||
|
|
||||||
|
@ -36,8 +36,8 @@ public class EntitySmallFireball extends EntityFireball {
|
|||||||
boolean stick;
|
boolean stick;
|
||||||
org.bukkit.entity.Entity damagee = movingEntity.getBukkitEntity();
|
org.bukkit.entity.Entity damagee = movingEntity.getBukkitEntity();
|
||||||
Projectile projectile = (Projectile) this.getBukkitEntity();
|
Projectile projectile = (Projectile) this.getBukkitEntity();
|
||||||
if (movingEntity instanceof EntityLiving) {
|
|
||||||
|
|
||||||
|
if (movingEntity instanceof EntityLiving || movingEntity instanceof EntityComplexPart) {
|
||||||
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(projectile, damagee, EntityDamageEvent.DamageCause.PROJECTILE, 5);
|
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(projectile, damagee, EntityDamageEvent.DamageCause.PROJECTILE, 5);
|
||||||
pluginManager.callEvent(event);
|
pluginManager.callEvent(event);
|
||||||
|
|
||||||
@ -50,6 +50,7 @@ public class EntitySmallFireball extends EntityFireball {
|
|||||||
} else {
|
} else {
|
||||||
stick = movingEntity.damageEntity(DamageSource.fireball(this, this.shooter), 5);
|
stick = movingEntity.damageEntity(DamageSource.fireball(this, this.shooter), 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stick) {
|
if (stick) {
|
||||||
// if the fireball 'sticks', ignite the target
|
// if the fireball 'sticks', ignite the target
|
||||||
EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(projectile, damagee, 5);
|
EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(projectile, damagee, 5);
|
||||||
|
@ -34,7 +34,7 @@ public class EntitySnowball extends EntityProjectile {
|
|||||||
boolean stick = false;
|
boolean stick = false;
|
||||||
|
|
||||||
if (movingEntity != null) {
|
if (movingEntity != null) {
|
||||||
if (movingEntity instanceof EntityLiving) {
|
if (movingEntity instanceof EntityLiving || movingEntity instanceof EntityComplexPart) {
|
||||||
org.bukkit.entity.Entity damagee = movingEntity.getBukkitEntity();
|
org.bukkit.entity.Entity damagee = movingEntity.getBukkitEntity();
|
||||||
Projectile projectile = (Projectile) this.getBukkitEntity();
|
Projectile projectile = (Projectile) this.getBukkitEntity();
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren