summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2015-01-25 10:45:02 +1100
committermd_5 <git@md-5.net>2015-01-25 10:45:02 +1100
commitc8f17232cf6eacbebf9b7feb4763d22fedc6daec (patch)
treec671366f16423bad3c28d08509d0a31678016bf7
parent0d52f683db2cc482636355dc2e954fa87060a270 (diff)
downloadcraftbukkit-c8f17232cf6eacbebf9b7feb4763d22fedc6daec.tar
craftbukkit-c8f17232cf6eacbebf9b7feb4763d22fedc6daec.tar.gz
craftbukkit-c8f17232cf6eacbebf9b7feb4763d22fedc6daec.tar.lz
craftbukkit-c8f17232cf6eacbebf9b7feb4763d22fedc6daec.tar.xz
craftbukkit-c8f17232cf6eacbebf9b7feb4763d22fedc6daec.zip
SPIGOT-161: Don't apply velocity changes if we didn't damage on explosion.
-rw-r--r--nms-patches/Explosion.patch18
1 files changed, 11 insertions, 7 deletions
diff --git a/nms-patches/Explosion.patch b/nms-patches/Explosion.patch
index 89089e0d..a5ef1741 100644
--- a/nms-patches/Explosion.patch
+++ b/nms-patches/Explosion.patch
@@ -1,5 +1,5 @@
---- ../work/decompile-8eb82bde//net/minecraft/server/Explosion.java 2014-11-28 17:43:43.189707433 +0000
-+++ src/main/java/net/minecraft/server/Explosion.java 2014-11-28 17:38:22.000000000 +0000
+--- ../work/decompile-8eb82bde/net/minecraft/server/Explosion.java 2015-01-25 10:44:43.764182684 +1100
++++ src/main/java/net/minecraft/server/Explosion.java 2015-01-25 10:44:43.768182687 +1100
@@ -8,6 +8,12 @@
import java.util.List;
import java.util.Map;
@@ -49,22 +49,26 @@
hashset.add(blockposition);
}
-@@ -112,7 +125,14 @@
+@@ -112,7 +125,17 @@
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.damageEntity(DamageSource.explosion(this), (float) ((int) ((d13 * d13 + d13) / 2.0D * 8.0D * (double) f3 + 1.0D)));
++ 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) {
++ continue;
++ }
+ // CraftBukkit end
+
double d14 = EnchantmentProtection.a(entity, d13);
entity.motX += d8 * d14;
-@@ -140,6 +160,35 @@
+@@ -140,6 +163,35 @@
BlockPosition blockposition;
if (this.b) {
@@ -100,7 +104,7 @@
iterator = this.blocks.iterator();
while (iterator.hasNext()) {
-@@ -170,7 +219,8 @@
+@@ -170,7 +222,8 @@
if (block.getMaterial() != Material.AIR) {
if (block.a(this)) {
@@ -110,7 +114,7 @@
}
this.world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 3);
-@@ -184,8 +234,12 @@
+@@ -184,8 +237,12 @@
while (iterator.hasNext()) {
blockposition = (BlockPosition) iterator.next();