summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authorThinkofname <thinkofdeath@spigotmc.org>2016-03-31 12:50:58 +0100
committerThinkofname <thinkofdeath@spigotmc.org>2016-03-31 12:50:58 +0100
commit6247aa00cc50cff563dc17811db1c3f4a9f1487c (patch)
treed8d8b619ef52347ac5aa6824edb4741c79debfae /nms-patches
parent45bb40353aac654c7861a41c5ddbe0f8d781a4fb (diff)
downloadcraftbukkit-6247aa00cc50cff563dc17811db1c3f4a9f1487c.tar
craftbukkit-6247aa00cc50cff563dc17811db1c3f4a9f1487c.tar.gz
craftbukkit-6247aa00cc50cff563dc17811db1c3f4a9f1487c.tar.lz
craftbukkit-6247aa00cc50cff563dc17811db1c3f4a9f1487c.tar.xz
craftbukkit-6247aa00cc50cff563dc17811db1c3f4a9f1487c.zip
SPIGOT-2101: Check the result of damageEntity before applying knockback from sweep attacks
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/EntityHuman.patch25
1 files changed, 19 insertions, 6 deletions
diff --git a/nms-patches/EntityHuman.patch b/nms-patches/EntityHuman.patch
index 052ba400..a72bb09f 100644
--- a/nms-patches/EntityHuman.patch
+++ b/nms-patches/EntityHuman.patch
@@ -278,7 +278,20 @@
}
}
-@@ -925,11 +1029,28 @@
+@@ -915,8 +1019,11 @@
+ EntityLiving entityliving = (EntityLiving) iterator.next();
+
+ if (entityliving != this && entityliving != entity && !this.r(entityliving) && this.h(entityliving) < 9.0D) {
++ // CraftBukkit start - Only apply knockback if the damage hits
++ if (entityliving.damageEntity(DamageSource.playerAttack(this), 1.0F)) {
+ entityliving.a(this, 0.4F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)));
+- entityliving.damageEntity(DamageSource.playerAttack(this), 1.0F);
++ }
++ // CraftBukkit end
+ }
+ }
+
+@@ -925,11 +1032,28 @@
}
if (entity instanceof EntityPlayer && entity.velocityChanged) {
@@ -307,7 +320,7 @@
}
if (flag2) {
-@@ -991,7 +1112,8 @@
+@@ -991,7 +1115,8 @@
if (itemstack3 != null && object instanceof EntityLiving) {
itemstack3.a((EntityLiving) object, this);
@@ -317,7 +330,7 @@
this.a(EnumHand.MAIN_HAND, (ItemStack) null);
}
}
-@@ -1001,7 +1123,14 @@
+@@ -1001,7 +1126,14 @@
this.a(StatisticList.y, Math.round(f5 * 10.0F));
if (j > 0) {
@@ -333,7 +346,7 @@
}
if (this.world instanceof WorldServer && f5 > 2.0F) {
-@@ -1090,6 +1219,20 @@
+@@ -1090,6 +1222,20 @@
this.stopRiding();
}
@@ -354,7 +367,7 @@
this.setSize(0.2F, 0.2F);
if (this.world.isLoaded(blockposition)) {
EnumDirection enumdirection = (EnumDirection) this.world.getType(blockposition).get(BlockFacingHorizontal.FACING);
-@@ -1172,6 +1315,23 @@
+@@ -1172,6 +1318,23 @@
this.world.everyoneSleeping();
}
@@ -378,7 +391,7 @@
this.sleepTicks = flag ? 0 : 100;
if (flag2) {
this.setRespawnPosition(this.bedPosition, false);
-@@ -1222,9 +1382,11 @@
+@@ -1222,9 +1385,11 @@
if (blockposition != null) {
this.e = blockposition;
this.f = flag;