@@ -56,7 +56,7 @@ index 6162631e863dd15c7fdb70dbde2f85d273c7020b..e75322367764805443f9a9f5639d804b
56
56
return;
57
57
}
58
58
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
59
- index 74dcfabdc66ef289b8d6a5c6606579b5321af1db..7a48140d6f16ab56550f70a6d5aef53c2f71401b 100644
59
+ index 74dcfabdc66ef289b8d6a5c6606579b5321af1db..ddf9acf79356d6fff5caa436f67641512fb16f59 100644
60
60
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
61
61
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
62
62
@@ -183,6 +183,7 @@ public abstract class Player extends LivingEntity {
@@ -76,10 +76,12 @@ index 74dcfabdc66ef289b8d6a5c6606579b5321af1db..7a48140d6f16ab56550f70a6d5aef53c
76
76
sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility
77
77
++i;
78
78
flag1 = true;
79
- @@ -1324,10 +1325,24 @@ public abstract class Player extends LivingEntity {
79
+ @@ -1324,10 +1325,26 @@ public abstract class Player extends LivingEntity {
80
80
81
81
if (flag5) {
82
82
if (i > 0) {
83
+ - if (target instanceof LivingEntity) {
84
+ - ((LivingEntity) target).knockback((double) ((float) i * 0.5F), (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.ENTITY_ATTACK); // CraftBukkit
83
85
+ // Sakura start - configure extra sprinting knockback
84
86
+ float extraKnockback = (float) i * 0.5F;
85
87
+ long millis = System.currentTimeMillis();
@@ -93,8 +95,9 @@ index 74dcfabdc66ef289b8d6a5c6606579b5321af1db..7a48140d6f16ab56550f70a6d5aef53c
93
95
+ // -0.5 is to negate the vanilla sprinting knockback
94
96
+ extraKnockback += -0.5F + (float) knockbackToApply;
95
97
+ }
96
- if (target instanceof LivingEntity) {
97
- - ((LivingEntity) target).knockback((double) ((float) i * 0.5F), (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.ENTITY_ATTACK); // CraftBukkit
98
+ + if (extraKnockback == 0.0) {
99
+ + // required
100
+ + } else if (target instanceof LivingEntity) {
98
101
+ ((LivingEntity) target).knockback((double) (extraKnockback), (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.ENTITY_ATTACK); // CraftBukkit
99
102
} else {
100
103
- target.push((double) (-Mth.sin(this.getYRot() * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (Mth.cos(this.getYRot() * 0.017453292F) * (float) i * 0.5F), this); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
@@ -103,7 +106,7 @@ index 74dcfabdc66ef289b8d6a5c6606579b5321af1db..7a48140d6f16ab56550f70a6d5aef53c
103
106
}
104
107
105
108
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D));
106
- @@ -1349,7 +1364 ,7 @@ public abstract class Player extends LivingEntity {
109
+ @@ -1349,7 +1366 ,7 @@ public abstract class Player extends LivingEntity {
107
110
if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
108
111
// CraftBukkit start - Only apply knockback if the damage hits
109
112
if (entityliving.hurt(this.damageSources().playerAttack(this).sweep().critical(flag2), f4)) { // Paper - add critical damage API
0 commit comments