From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: DoctaEnkoda <bierquejason@gmail.com>
Date: Mon, 17 May 2021 02:40:13 +0200
Subject: [PATCH] Add config change multiplier critical damage value


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 51e0701385c94822f83e8b628967ef9d36a10085..ace974dd50765602aa234cb7be9151714f072f5a 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1255,7 +1255,7 @@ public abstract class Player extends LivingEntity {
                     flag2 = flag2 && !this.isSprinting();
                     if (flag2) {
                         this.isCritical = true; // Purpur
-                        f *= 1.5F;
+                        f *= this.level.purpurConfig.playerCriticalDamageMultiplier; // Purpur
                     }
 
                     f += f1;
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index a477c7cdf85c7f1a30c0c19d7bb1464058e011e5..198c94a5f41561d5692b8a68bd016b335d562579 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -325,6 +325,7 @@ public class PurpurWorldConfig {
     public boolean creativeOnePunch = false;
     public boolean playerSleepNearMonsters = false;
     public boolean playersSkipNight = true;
+    public double playerCriticalDamageMultiplier = 1.5D;
     private void playerSettings() {
         if (PurpurConfig.version < 19) {
             boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
@@ -346,6 +347,7 @@ public class PurpurWorldConfig {
         creativeOnePunch = getBoolean("gameplay-mechanics.player.one-punch-in-creative", creativeOnePunch);
         playerSleepNearMonsters = getBoolean("gameplay-mechanics.player.sleep-ignore-nearby-mobs", playerSleepNearMonsters);
         playersSkipNight = getBoolean("gameplay-mechanics.player.can-skip-night", playersSkipNight);
+        playerCriticalDamageMultiplier = getDouble("gameplay-mechanics.player.critical-damage-multiplier", playerCriticalDamageMultiplier);
     }
 
     public int snowballDamage = -1;
