aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/utils/Utils.java
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2022-08-09 20:32:25 -0400
committerGitHub <noreply@github.com>2022-08-09 20:32:25 -0400
commit4d2a84d9fd2f522b2ade9954f8d40f6d80e2b12b (patch)
tree7f762c94a742a07e5c3939e70d35cf7128071b32 /src/main/java/me/Danker/utils/Utils.java
parent48253eddf00cf5d94ecc2eb6b63e7c490b3145be (diff)
parentf56302bee3939677fc3fd015a97b12b5100c45b1 (diff)
downloadSkyblockMod-4d2a84d9fd2f522b2ade9954f8d40f6d80e2b12b.tar.gz
SkyblockMod-4d2a84d9fd2f522b2ade9954f8d40f6d80e2b12b.tar.bz2
SkyblockMod-4d2a84d9fd2f522b2ade9954f8d40f6d80e2b12b.zip
Merge branch 'development' into development
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,