mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Add config change multiplier critical damage value
This commit is contained in:
@@ -1,39 +0,0 @@
|
|||||||
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/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
|
||||||
index fc0e571b62a9bd40df2d3d066cf374e12004a6d8..bc3c67e8f70890831a0bb1799a3b7c10852b1273 100644
|
|
||||||
--- a/net/minecraft/world/entity/player/Player.java
|
|
||||||
+++ b/net/minecraft/world/entity/player/Player.java
|
|
||||||
@@ -1309,7 +1309,7 @@ public abstract class Player extends LivingEntity {
|
|
||||||
flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits
|
|
||||||
if (flag2) {
|
|
||||||
damagesource = damagesource.critical(true); // Paper start - critical damage API
|
|
||||||
- f *= 1.5F;
|
|
||||||
+ f *= this.level().purpurConfig.playerCriticalDamageMultiplier; // Purpur
|
|
||||||
}
|
|
||||||
|
|
||||||
float f3 = f + f1;
|
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
index fb10c66da40ba5e4d0eb5b567d177bbcb2c0fd4c..b5712c7aa0de07736c7e6ae0686ed36ed3629235 100644
|
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -367,6 +367,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);
|
|
||||||
@@ -386,6 +387,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 boolean silkTouchEnabled = false;
|
|
||||||
@@ -32,6 +32,15 @@
|
|||||||
this.cooldowns.tick();
|
this.cooldowns.tick();
|
||||||
this.updatePlayerPose();
|
this.updatePlayerPose();
|
||||||
if (this.currentImpulseContextResetGraceTime > 0) {
|
if (this.currentImpulseContextResetGraceTime > 0) {
|
||||||
|
@@ -1264,7 +_,7 @@
|
||||||
|
flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits
|
||||||
|
if (flag2) {
|
||||||
|
damageSource = damageSource.critical(true); // Paper start - critical damage API
|
||||||
|
- f *= 1.5F;
|
||||||
|
+ f *= this.level().purpurConfig.playerCriticalDamageMultiplier; // Purpur - Add config change multiplier critical damage value
|
||||||
|
}
|
||||||
|
|
||||||
|
float f2 = f + f1;
|
||||||
@@ -1877,7 +_,23 @@
|
@@ -1877,7 +_,23 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -359,6 +359,7 @@ public class PurpurWorldConfig {
|
|||||||
public boolean creativeOnePunch = false;
|
public boolean creativeOnePunch = false;
|
||||||
public boolean playerSleepNearMonsters = false;
|
public boolean playerSleepNearMonsters = false;
|
||||||
public boolean playersSkipNight = true;
|
public boolean playersSkipNight = true;
|
||||||
|
public double playerCriticalDamageMultiplier = 1.5D;
|
||||||
private void playerSettings() {
|
private void playerSettings() {
|
||||||
if (PurpurConfig.version < 19) {
|
if (PurpurConfig.version < 19) {
|
||||||
boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
|
boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
|
||||||
@@ -378,6 +379,7 @@ public class PurpurWorldConfig {
|
|||||||
creativeOnePunch = getBoolean("gameplay-mechanics.player.one-punch-in-creative", creativeOnePunch);
|
creativeOnePunch = getBoolean("gameplay-mechanics.player.one-punch-in-creative", creativeOnePunch);
|
||||||
playerSleepNearMonsters = getBoolean("gameplay-mechanics.player.sleep-ignore-nearby-mobs", playerSleepNearMonsters);
|
playerSleepNearMonsters = getBoolean("gameplay-mechanics.player.sleep-ignore-nearby-mobs", playerSleepNearMonsters);
|
||||||
playersSkipNight = getBoolean("gameplay-mechanics.player.can-skip-night", playersSkipNight);
|
playersSkipNight = getBoolean("gameplay-mechanics.player.can-skip-night", playersSkipNight);
|
||||||
|
playerCriticalDamageMultiplier = getDouble("gameplay-mechanics.player.critical-damage-multiplier", playerCriticalDamageMultiplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean silkTouchEnabled = false;
|
public boolean silkTouchEnabled = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user