CavePVP-Stuff/cSpigot-master/spigot-server-Patches/0036-Configurable-strength-and-weakness-effect-modifiers.patch
2023-05-01 19:59:40 +01:00

48 lines
2.1 KiB
Diff

From efd0b7fa3999def5fe30ab80baed8fcd73addc21 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Sun, 31 Aug 2014 12:13:32 -0500
Subject: [PATCH] Configurable strength and weakness effect modifiers
diff --git a/src/main/java/net/minecraft/server/MobEffectAttackDamage.java b/src/main/java/net/minecraft/server/MobEffectAttackDamage.java
index 3eb029d46..c44878931 100644
--- a/src/main/java/net/minecraft/server/MobEffectAttackDamage.java
+++ b/src/main/java/net/minecraft/server/MobEffectAttackDamage.java
@@ -1,5 +1,7 @@
package net.minecraft.server;
+import org.github.paperspigot.PaperSpigotConfig;
+
public class MobEffectAttackDamage extends MobEffectList {
protected MobEffectAttackDamage(int i, boolean flag, int j) {
@@ -7,6 +9,7 @@ public class MobEffectAttackDamage extends MobEffectList {
}
public double a(int i, AttributeModifier attributemodifier) {
- return this.id == MobEffectList.WEAKNESS.id ? (double) (-0.5F * (float) (i + 1)) : 1.3D * (double) (i + 1);
+ // PaperSpigot - Configurable modifiers for strength and weakness effects
+ return this.id == MobEffectList.WEAKNESS.id ? (double) (PaperSpigotConfig.weaknessEffectModifier * (float) (i + 1)) : PaperSpigotConfig.strengthEffectModifier * (double) (i + 1);
}
}
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
index fe43f8aeb..0091cbf1e 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
@@ -163,4 +163,12 @@ public class PaperSpigotConfig
Bukkit.getLogger().log( Level.INFO, "Disabling player interaction limiter, your server may be more vulnerable to malicious users" );
}
}
+
+ public static double strengthEffectModifier;
+ public static double weaknessEffectModifier;
+ private static void effectModifiers()
+ {
+ strengthEffectModifier = getDouble( "effect-modifiers.strength", 1.3D );
+ weaknessEffectModifier = getDouble( "effect-modifiers.weakness", -0.5D );
+ }
}
--
2.13.3