From 5cd149b7f1ee77db531eea14520e305515af5165 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sun, 16 Jul 2023 02:22:24 +1000 Subject: 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 --- .../listener/ItemTooltipRngListener.java | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/main/java/io') 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 slayerExp = new ArrayList<>(); + + List defaultSlayerExp = new ArrayList<>(); for (JsonElement element : leveling.get("slayer_boss_xp").getAsJsonArray()) { - slayerExp.add(element.getAsInt()); + defaultSlayerExp.add(element.getAsInt()); } List slayerColors = new ArrayList<>(); @@ -234,14 +237,23 @@ public class ItemTooltipRngListener { } for (Map.Entry 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 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 entry : leveling.get("rng_meter_dungeon_score").getAsJsonObject().entrySet()) { -- cgit