26 lines
1.8 KiB
Diff
26 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Cryptite <cryptite@gmail.com>
|
|
Date: Tue, 25 Apr 2023 08:16:50 -0500
|
|
Subject: [PATCH] Add Force Crit 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 3e597833b57377b855505b8a0f2744801c791f90..04a68a4f0c642984bd2b95bfb0d7d2bd887d18f0 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
@@ -1278,10 +1278,11 @@ public abstract class Player extends LivingEntity {
|
|
flag1 = true;
|
|
}
|
|
|
|
- boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity; // Paper - Add critical damage API - conflict on change
|
|
+ boolean forceCrit = playerAttackEntityEvent.isForceCrit();
|
|
+ boolean flag2 = forceCrit || (flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity); // Paper - Add critical damage API - conflict on change // Slice
|
|
|
|
- flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper
|
|
- flag2 = flag2 && !this.isSprinting();
|
|
+ flag2 = flag2 && !level().paperConfig().entities.behavior.disablePlayerCrits; // Paper
|
|
+ flag2 = forceCrit || (flag2 && !this.isSprinting()); // Slice
|
|
if (flag2) {
|
|
f *= 1.5F;
|
|
}
|