Call EntityKnockbackByEntityEvent for RamTarget Behavior (#6273)
This commit is contained in:
parent
efd7e5182c
commit
b32a3b147c
|
@ -56,7 +56,7 @@ index 0a954a83e29f2ffc622675f671416bdadc1d3f6a..91a0699ba30fa1e9c8172e07f034ea1f
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index ebdd1c2f9c73b484df62bb20825324cf8e339248..2ced732bd024caa0aa282bc23d536accba28b032 100644
|
||||
index 4f3613e8232df3b4d9e10970b9faf9fbdd3b34a2..6e5682fed08a41c7e573e6611fca93bf85019b9f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1537,7 +1537,7 @@ public abstract class Mob extends LivingEntity {
|
||||
|
@ -68,6 +68,19 @@ index ebdd1c2f9c73b484df62bb20825324cf8e339248..2ced732bd024caa0aa282bc23d536acc
|
|||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/RamTarget.java b/src/main/java/net/minecraft/world/entity/ai/behavior/RamTarget.java
|
||||
index f6fd39823f04f8071c616d40a838b01e7159c5a1..e1cdf3ce38404d3f40be59e4cd3ad2b997d63310 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/RamTarget.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/RamTarget.java
|
||||
@@ -75,7 +75,7 @@ public class RamTarget<E extends PathfinderMob> extends Behavior<E> {
|
||||
float f = 0.25F * (float)(i - j);
|
||||
float g = Mth.clamp(pathfinderMob.getSpeed() * 1.65F, 0.2F, 3.0F) + f;
|
||||
float h = livingEntity.isDamageSourceBlocked(DamageSource.mobAttack(pathfinderMob)) ? 0.5F : 1.0F;
|
||||
- livingEntity.knockback((double)(h * g) * this.getKnockbackForce.applyAsDouble(pathfinderMob), this.ramDirection.x(), this.ramDirection.z());
|
||||
+ livingEntity.knockback((double)(h * g) * this.getKnockbackForce.applyAsDouble(pathfinderMob), this.ramDirection.x(), this.ramDirection.z(), pathfinderMob); // Paper
|
||||
this.finishRam(serverLevel, pathfinderMob);
|
||||
serverLevel.playSound((Player)null, pathfinderMob, this.getImpactSound.apply(pathfinderMob), SoundSource.HOSTILE, 1.0F, 1.0F);
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index ce8b5394f418583608bb8965c058660264ddf66c..3db5b3adb9fe4a1682b0a4e75ae3e1f6febb7822 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
|
|
Loading…
Reference in New Issue