Archiviert
13
0

SPIGOT-2101: Check the result of damageEntity before applying knockback from sweep attacks

Dieser Commit ist enthalten in:
Thinkofname 2016-03-31 12:50:58 +01:00
Ursprung 45bb40353a
Commit 6247aa00cc

Datei anzeigen

@ -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;