aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/utils/Utils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/Danker/utils/Utils.java')
-rw-r--r--src/main/java/me/Danker/utils/Utils.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java
index bc02d9e..deb5018 100644
--- a/src/main/java/me/Danker/utils/Utils.java
+++ b/src/main/java/me/Danker/utils/Utils.java
@@ -1,5 +1,7 @@
package me.Danker.utils;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
import me.Danker.DankersSkyblockMod;
import me.Danker.features.ColouredNames;
import me.Danker.features.GoldenEnchants;
@@ -23,8 +25,8 @@ import net.minecraft.util.*;
import org.lwjgl.opengl.GL11;
import java.awt.*;
-import java.util.*;
import java.util.List;
+import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -252,6 +254,16 @@ public class Utils {
}
return limit;
}
+
+ public static int skillLevelToXp(int level) {
+ int sum = 0;
+
+ for (int i = 1; i <= level; i++) {
+ sum += skillXPPerLevel[i];
+ }
+
+ return sum;
+ }
public static double xpToDungeonsLevel(double xp) {
for (int i = 0, xpAdded = 0; i < dungeonsXPPerLevel.length; i++) {
@@ -525,6 +537,16 @@ public class Utils {
}
}
+ public static JsonObject deepCopy(JsonObject obj) {
+ JsonObject newObj = new JsonObject();
+
+ for (Map.Entry<String, JsonElement> entry : obj.entrySet()) {
+ newObj.add(entry.getKey(), entry.getValue());
+ }
+
+ return newObj;
+ }
+
public enum DungeonFloor {
NONE,
E0,