diff options
author | Jedediah Smith <jedediah@silencegreys.com> | 2015-08-31 18:06:13 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2015-08-31 18:06:13 +1000 |
commit | 9a17f01ff1f19045f1f8a4fd4ee4b4a368cabb14 (patch) | |
tree | deceea4f19f6194053cf8a883a4c332b540dff07 /nms-patches/Explosion.patch | |
parent | 53fac9f1b6c3aa44e7c5c93db2950cb1d6beadc3 (diff) | |
download | craftbukkit-9a17f01ff1f19045f1f8a4fd4ee4b4a368cabb14.tar craftbukkit-9a17f01ff1f19045f1f8a4fd4ee4b4a368cabb14.tar.gz craftbukkit-9a17f01ff1f19045f1f8a4fd4ee4b4a368cabb14.tar.lz craftbukkit-9a17f01ff1f19045f1f8a4fd4ee4b4a368cabb14.tar.xz craftbukkit-9a17f01ff1f19045f1f8a4fd4ee4b4a368cabb14.zip |
SPIGOT-949: Fix damage cooldown reducing explosion knockback
Diffstat (limited to 'nms-patches/Explosion.patch')
-rw-r--r-- | nms-patches/Explosion.patch | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/nms-patches/Explosion.patch b/nms-patches/Explosion.patch index 1b6b56f1..5ee04c65 100644 --- a/nms-patches/Explosion.patch +++ b/nms-patches/Explosion.patch @@ -49,23 +49,24 @@ hashset.add(blockposition); } -@@ -112,7 +125,14 @@ +@@ -112,7 +125,15 @@ double d12 = (double) this.world.a(vec3d, entity.getBoundingBox()); double d13 = (1.0D - d7) * d12; - entity.damageEntity(DamageSource.explosion(this), (float) ((int) ((d13 * d13 + d13) / 2.0D * 8.0D * (double) f3 + 1.0D))); + // entity.damageEntity(DamageSource.explosion(this), (float) ((int) ((d13 * d13 + d13) / 2.0D * 8.0D * (double) f3 + 1.0D)));+ // CraftBukkit start + CraftEventFactory.entityDamage = source; ++ entity.forceExplosionKnockback = false; + boolean wasDamaged = entity.damageEntity(DamageSource.explosion(this), (float) ((int) ((d13 * d13 + d13) / 2.0D * 8.0D * (double) f3 + 1.0D))); + CraftEventFactory.entityDamage = null; -+ if (!wasDamaged && !(entity instanceof EntityTNTPrimed || entity instanceof EntityFallingBlock)) { ++ if (!wasDamaged && !(entity instanceof EntityTNTPrimed || entity instanceof EntityFallingBlock) && !entity.forceExplosionKnockback) { + continue; + } + // CraftBukkit end double d14 = EnchantmentProtection.a(entity, d13); entity.motX += d8 * d14; -@@ -140,6 +160,50 @@ +@@ -140,6 +161,50 @@ BlockPosition blockposition; if (this.b) { @@ -116,7 +117,7 @@ iterator = this.blocks.iterator(); while (iterator.hasNext()) { -@@ -170,7 +234,8 @@ +@@ -170,7 +235,8 @@ if (block.getMaterial() != Material.AIR) { if (block.a(this)) { @@ -126,7 +127,7 @@ } this.world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 3); -@@ -185,7 +250,11 @@ +@@ -185,7 +251,11 @@ while (iterator.hasNext()) { blockposition = (BlockPosition) iterator.next(); if (this.world.getType(blockposition).getBlock().getMaterial() == Material.AIR && this.world.getType(blockposition.down()).getBlock().o() && this.c.nextInt(3) == 0) { @@ -139,7 +140,7 @@ } } } -@@ -197,7 +266,9 @@ +@@ -197,7 +267,9 @@ } public EntityLiving getSource() { |