From e2a638ce6dd955f2553c1e6c0c76c78a77be0a0f Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Mon, 26 Jul 2021 09:41:26 -0700 Subject: [PATCH] Call EntityKnockbackByEntityEvent for RamTarget Behavior (#6273) --- .../Implement-EntityKnockbackByEntityEvent.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/patches/server/Implement-EntityKnockbackByEntityEvent.patch b/patches/server/Implement-EntityKnockbackByEntityEvent.patch index bfad137387..91f6ed770c 100644 --- a/patches/server/Implement-EntityKnockbackByEntityEvent.patch +++ b/patches/server/Implement-EntityKnockbackByEntityEvent.patch @@ -68,6 +68,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 +@@ -0,0 +0,0 @@ public class RamTarget extends Behavior { + 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java