3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-16 11:30:06 +01:00

Configurable strength and weakness effect modifiers

Dieser Commit ist enthalten in:
Zach Brown 2014-08-31 12:31:44 -05:00
Ursprung ab9af61cbf
Commit 14ac97ad60
2 geänderte Dateien mit 65 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -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

Datei anzeigen

@ -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