Archiviert
13
0

[Bleeding] Fire EntityDamageByEntityEvent's for EnderDragon being hit by Projectiles.

Dieser Commit ist enthalten in:
Feildmaster 2012-02-09 21:13:35 -06:00 committet von EvilSeph
Ursprung 7ff8c17568
Commit 391ac23c9a
6 geänderte Dateien mit 8 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -201,8 +201,7 @@ public class EntityArrow extends Entity {
// CraftBukkit start
boolean stick;
if (entity instanceof EntityLiving) {
if (entity instanceof EntityLiving || entity instanceof EntityComplexPart) {
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
Projectile projectile = (Projectile) this.getBukkitEntity();
@ -218,6 +217,7 @@ public class EntityArrow extends Entity {
} else {
stick = movingobjectposition.entity.damageEntity(damagesource, l);
}
if (stick) {
// CraftBukkit end
if (movingobjectposition.entity instanceof EntityLiving) {

Datei anzeigen

@ -8,7 +8,6 @@ import org.bukkit.entity.Projectile;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerEggThrowEvent;
public class EntityEgg extends EntityProjectile {
@ -29,7 +28,7 @@ public class EntityEgg extends EntityProjectile {
// CraftBukkit start
if (movingobjectposition.entity != null) {
boolean stick;
if (movingobjectposition.entity instanceof EntityLiving) {
if (movingobjectposition.entity instanceof EntityLiving || movingobjectposition.entity instanceof EntityComplexPart) {
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
Projectile projectile = (Projectile) this.getBukkitEntity();

Datei anzeigen

@ -5,7 +5,6 @@ import java.util.List;
// CraftBukkit start
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
import org.bukkit.entity.Explosive;
import org.bukkit.entity.Projectile;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -189,7 +188,7 @@ public class EntityFireball extends Entity {
// CraftBukkit start
if (movingobjectposition.entity != null) {
boolean stick;
if (movingobjectposition.entity instanceof EntityLiving) {
if (movingobjectposition.entity instanceof EntityLiving || movingobjectposition.entity instanceof EntityComplexPart) {
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
Projectile projectile = (Projectile) this.getBukkitEntity();

Datei anzeigen

@ -192,7 +192,7 @@ public class EntityFishingHook extends Entity {
if (movingobjectposition.entity != null) {
// CraftBukkit start
boolean stick;
if (movingobjectposition.entity instanceof EntityLiving) {
if (movingobjectposition.entity instanceof EntityLiving || movingobjectposition.entity instanceof EntityComplexPart) {
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
Projectile projectile = (Projectile) this.getBukkitEntity();

Datei anzeigen

@ -36,8 +36,8 @@ public class EntitySmallFireball extends EntityFireball {
boolean stick;
org.bukkit.entity.Entity damagee = movingEntity.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);
pluginManager.callEvent(event);
@ -50,6 +50,7 @@ public class EntitySmallFireball extends EntityFireball {
} else {
stick = movingEntity.damageEntity(DamageSource.fireball(this, this.shooter), 5);
}
if (stick) {
// if the fireball 'sticks', ignite the target
EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(projectile, damagee, 5);

Datei anzeigen

@ -34,7 +34,7 @@ public class EntitySnowball extends EntityProjectile {
boolean stick = false;
if (movingEntity != null) {
if (movingEntity instanceof EntityLiving) {
if (movingEntity instanceof EntityLiving || movingEntity instanceof EntityComplexPart) {
org.bukkit.entity.Entity damagee = movingEntity.getBukkitEntity();
Projectile projectile = (Projectile) this.getBukkitEntity();