From 71e5248c8b97a6345a367543bdb8a85477baf81b Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 28 May 2016 22:10:59 +1000 Subject: [PATCH] SPIGOT-636: Decouple EntityCombustByEntity from damageEntity --- nms-patches/EntityArrow.patch | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/nms-patches/EntityArrow.patch b/nms-patches/EntityArrow.patch index 5299df7863..25005044d3 100644 --- a/nms-patches/EntityArrow.patch +++ b/nms-patches/EntityArrow.patch @@ -30,28 +30,22 @@ if (entity != null) { float f = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ); int i = MathHelper.f((double) f * this.damage); -@@ -246,11 +253,18 @@ - damagesource = DamageSource.arrow(this, this.shooter); +@@ -247,7 +254,13 @@ } -+ // CraftBukkit start - Moved damage call -+ if (movingobjectposition.entity.damageEntity(damagesource, (float) i)) { if (this.isBurning() && !(entity instanceof EntityEnderman)) { - entity.setOnFire(5); ++ // CraftBukkit start + EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 5); + org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent); + if (!combustEvent.isCancelled()) { + entity.setOnFire(combustEvent.getDuration()); + } -+ // CraftBukkit end ++ // CraftBukkit end } -- if (entity.damageEntity(damagesource, (float) i)) { -+ // if (entity.damageEntity(damagesource, (float) i)) { // CraftBukkit - moved up - if (entity instanceof EntityLiving) { - EntityLiving entityliving = (EntityLiving) entity; - -@@ -397,6 +411,20 @@ + if (entity.damageEntity(damagesource, (float) i)) { +@@ -397,6 +410,20 @@ public void d(EntityHuman entityhuman) { if (!this.world.isClientSide && this.inGround && this.shake <= 0) { @@ -72,7 +66,7 @@ boolean flag = this.fromPlayer == EntityArrow.PickupStatus.ALLOWED || this.fromPlayer == EntityArrow.PickupStatus.CREATIVE_ONLY && entityhuman.abilities.canInstantlyBuild; if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(this.j())) { -@@ -455,6 +483,12 @@ +@@ -455,6 +482,12 @@ return (b0 & 1) != 0; }