aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2023-07-16 02:22:24 +1000
committerGitHub <noreply@github.com>2023-07-15 18:22:24 +0200
commit5cd149b7f1ee77db531eea14520e305515af5165 (patch)
tree3112198acf1dfbf9be9522148645ebfd6d4963db /src/main/java/io
parente05840f4ad02579ae66fb75defbac6f686610e56 (diff)
downloadNotEnoughUpdates-5cd149b7f1ee77db531eea14520e305515af5165.tar.gz
NotEnoughUpdates-5cd149b7f1ee77db531eea14520e305515af5165.tar.bz2
NotEnoughUpdates-5cd149b7f1ee77db531eea14520e305515af5165.zip
Makes vamp slayer work properly with the rng meter tooltip thingy (#769)
Makes vamp slayer work properly with the rng meter tooltip thingy. After the terraforming I did to this file it looks fine? Requires updated repo
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java
index 6806bc87..2cb01f23 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java
@@ -218,14 +218,17 @@ public class ItemTooltipRngListener {
!leveling.has("slayer_boss_xp") ||
!leveling.has("slayer_highest_tier") ||
!leveling.has("slayer_tier_colors") ||
- !leveling.has("rng_meter_dungeon_score")) {
+ !leveling.has("rng_meter_dungeon_score") ||
+ !leveling.has("fancy_name_to_slayer") ||
+ !leveling.has("slayer_boss_xp_type")) {
Utils.showOutdatedRepoNotification();
return;
}
- List<Integer> slayerExp = new ArrayList<>();
+
+ List<Integer> defaultSlayerExp = new ArrayList<>();
for (JsonElement element : leveling.get("slayer_boss_xp").getAsJsonArray()) {
- slayerExp.add(element.getAsInt());
+ defaultSlayerExp.add(element.getAsInt());
}
List<String> slayerColors = new ArrayList<>();
@@ -234,14 +237,23 @@ public class ItemTooltipRngListener {
}
for (Map.Entry<String, JsonElement> entry : leveling.get("slayer_highest_tier").getAsJsonObject().entrySet()) {
- String slayerName = entry.getKey();
+ String slayerFancyName = entry.getKey();
+ String slayerName = leveling.get("fancy_name_to_slayer").getAsJsonObject().get(slayerFancyName).getAsString();
+
int maxTier = entry.getValue().getAsInt();
LinkedHashMap<String, Integer> singleSlayerData = new LinkedHashMap<>();
for (int i = 0; i < maxTier; i++) {
String name = slayerColors.get(i) + "Tier " + (i + 1);
- singleSlayerData.put(name, slayerExp.get(i));
+ if (leveling.get("slayer_boss_xp_type").getAsJsonObject().get(slayerName) != null) {
+ singleSlayerData.put(
+ name,
+ leveling.get("slayer_boss_xp_type").getAsJsonObject().get(slayerName).getAsJsonArray().get(i).getAsInt()
+ );
+ } else {
+ singleSlayerData.put(name, defaultSlayerExp.get(i));
+ }
}
- slayerData.put(slayerName, singleSlayerData);
+ slayerData.put(slayerFancyName, singleSlayerData);
}
for (Map.Entry<String, JsonElement> entry : leveling.get("rng_meter_dungeon_score").getAsJsonObject().entrySet()) {