Patch updates

This commit is contained in:
Cryptite
2024-01-20 17:15:39 -06:00
parent 846a8957d0
commit 4c65932eff
48 changed files with 222 additions and 366 deletions

View File

@@ -1,23 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cryptite <cryptite@gmail.com>
Date: Tue, 25 Apr 2023 08:17:39 -0500
Subject: [PATCH] Add Preventing KB Bonus to PlayerPreAttackEntityEvent
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 58b59a76db1acbbc7977abc53b2c8b2e5475eda2..64df32011e94cb68cfa32a3a236a70cfc1da7c05 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1270,7 +1270,11 @@ public abstract class Player extends LivingEntity {
boolean flag = f2 > 0.9F;
boolean flag1 = false;
byte b0 = 0;
- int i = b0 + EnchantmentHelper.getKnockbackBonus(this);
+ int i = b0; // Slice start
+ if (!playerAttackEntityEvent.isPreventKnockbackBonus()) {
+ i += EnchantmentHelper.getKnockbackBonus(this);
+ }
+ // Slice end
if (this.isSprinting() && flag) {
sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility