diff --git a/src/main/java/com/arazadaz/dd/api/origins/Origin.java b/src/main/java/com/arazadaz/dd/api/origins/Origin.java index a337efe..80ddb02 100644 --- a/src/main/java/com/arazadaz/dd/api/origins/Origin.java +++ b/src/main/java/com/arazadaz/dd/api/origins/Origin.java @@ -92,17 +92,17 @@ public double getDifficultyHere(Vec3 dstPos, DifficultyType type, RadiusMode rMo switch(rMode){ case CIRCLE -> { - difficulty = runModifiers(modifierIterator, context, 0, dstPos); + difficulty = getDifficultyAndRunModifiers(modifierIterator, context, 0, dstPos); return getFinalDifficulty(difficulty); } case SQUARE -> { - difficulty = runModifiers(modifierIterator, context, 1, dstPos); + difficulty = getDifficultyAndRunModifiers(modifierIterator, context, 1, dstPos); return getFinalDifficulty(difficulty); } case CUSTOM -> { - difficulty = runModifiers(modifierIterator, context, 2, dstPos); + difficulty = getDifficultyAndRunModifiers(modifierIterator, context, 2, dstPos); return getFinalDifficulty(difficulty); } @@ -116,7 +116,7 @@ private double getFinalDifficulty(double finalDifficulty){ return finalDifficulty; } - private double runModifiers(Iterator modifierIterator, DDContext context, int formula, Vec3 dstPos){ //Formula can be 0, 1, or 2 with those values representing circle, square, and custom respectively. + private double getDifficultyAndRunModifiers(Iterator modifierIterator, DDContext context, int formula, Vec3 dstPos){ //Formula can be 0, 1, or 2 with those values representing circle, square, and custom respectively. double base = new FormulaInterpreter().run(this.formulas[formula], this, dstPos); while(modifierIterator.hasNext()){ diff --git a/src/main/java/com/arazadaz/dd/config/Config.java b/src/main/java/com/arazadaz/dd/config/Config.java index 1e94f7e..47d490a 100644 --- a/src/main/java/com/arazadaz/dd/config/Config.java +++ b/src/main/java/com/arazadaz/dd/config/Config.java @@ -34,7 +34,7 @@ public class Config public static final ModConfigSpec.ConfigValue GLOBAL_FORMULAS = BUILDER .comment("The default formulas used for Origins if the values weren't specified at their creation. Three formulas: circle, square, and custom in that order") - .define("Global formulas", "'(distance/range)*100', 'max(abs(dst.x-src.x)/range*100, abs(dst.y-src.y)/range*100)', '(50/100)*100'"); + .define("Global formulas", "'(distance/range)*100', 'max(abs(dst.x-src.x)/range*100, abs(dst.z-src.z)/range*100)', '(50/100)*100'"); // a list of strings that are treated as resource locations for items private static final ModConfigSpec.ConfigValue> USER_DEFINED_ORIGINS = BUILDER