diff options
| author | Lulonaut <lulonaut@lulonaut.tech> | 2023-08-30 13:51:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-30 13:51:35 +0200 |
| commit | 2f768fbe0e87debd50ac2ea6d929fa6867a73c0f (patch) | |
| tree | 36de54f68a76f29a4eae9848c7a0015eec5c4779 /src/main/java/io/github/moulberry/notenoughupdates/util | |
| parent | de22a446533d682ee87c18f0406560a868c3ea79 (diff) | |
| download | notenoughupdates-2f768fbe0e87debd50ac2ea6d929fa6867a73c0f.tar.gz notenoughupdates-2f768fbe0e87debd50ac2ea6d929fa6867a73c0f.tar.bz2 notenoughupdates-2f768fbe0e87debd50ac2ea6d929fa6867a73c0f.zip | |
parse tab list for skill info (#780)
Co-authored-by: nopo <nopotheemail@gmail.com>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java index 0a501415..117545c9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 NotEnoughUpdates contributors + * Copyright (C) 2022-2023 NotEnoughUpdates contributors * * This file is part of NotEnoughUpdates. * @@ -24,15 +24,12 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.util.StringUtils; -import io.github.moulberry.notenoughupdates.profileviewer.ProfileViewer; -import io.github.moulberry.notenoughupdates.profileviewer.SkyblockProfiles; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -210,46 +207,4 @@ public class XPInformation { } updateWithPercentage.clear(); } - - public void tick() { - ProfileApiSyncer.getInstance().requestResync("xpinformation", 5 * 60 * 1000, - () -> { - }, this::onApiUpdated - ); - } - - private static final String[] skills = { - "taming", - "mining", - "foraging", - "enchanting", - "carpentry", - "farming", - "combat", - "fishing", - "alchemy", - "runecrafting" - }; - - private void onApiUpdated(SkyblockProfiles profile) { - Map<String, ProfileViewer.Level> skyblockInfo = profile.getLatestProfile().getLevelingInfo(); - if (skyblockInfo == null) { - return; - } - - for (String skill : skills) { - SkillInfo info = new SkillInfo(); - - ProfileViewer.Level levelInfo = skyblockInfo.get(skill); - float level = levelInfo.level; - - info.totalXp = levelInfo.totalXp; - info.currentXpMax = levelInfo.maxXpForLevel; - info.level = (int) level; - info.currentXp = (level % 1) * info.currentXpMax; - info.fromApi = true; - - skillInfoMap.put(skill.toLowerCase(), info); - } - } } |
