Configurable strength and weakness effect modifiers

This commit is contained in:
Zach Brown 2014-08-31 12:31:44 -05:00
parent ab9af61cbf
commit 14ac97ad60
2 changed files with 65 additions and 0 deletions

View File

@ -4,6 +4,24 @@ Date: Tue, 22 Jul 2014 21:05:53 -0500
Subject: [PATCH] mc-dev imports
diff --git a/src/main/java/net/minecraft/server/MobEffectAttackDamage.java b/src/main/java/net/minecraft/server/MobEffectAttackDamage.java
new file mode 100644
index 0000000..3eb029d
--- /dev/null
+++ b/src/main/java/net/minecraft/server/MobEffectAttackDamage.java
@@ -0,0 +1,12 @@
+package net.minecraft.server;
+
+public class MobEffectAttackDamage extends MobEffectList {
+
+ protected MobEffectAttackDamage(int i, boolean flag, int j) {
+ super(i, flag, j);
+ }
+
+ public double a(int i, AttributeModifier attributemodifier) {
+ return this.id == MobEffectList.WEAKNESS.id ? (double) (-0.5F * (float) (i + 1)) : 1.3D * (double) (i + 1);
+ }
+}
diff --git a/src/main/java/net/minecraft/server/RandomPositionGenerator.java b/src/main/java/net/minecraft/server/RandomPositionGenerator.java
new file mode 100644
index 0000000..9342a3f

View File

@ -0,0 +1,47 @@
From 78ba8b100ca7bc2d828c055e28cc37e2660dbe56 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 3eb029d..c448789 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 25a94a6..a7b18e4 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
@@ -161,4 +161,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 );
+ }
}
--
1.9.4.msysgit.1