diff options
| author | kr45732 <52721908+kr45732@users.noreply.github.com> | 2023-06-08 10:00:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-08 16:00:04 +0200 |
| commit | 8115922b37e375285c2a72dbdbb5d83fd942e27c (patch) | |
| tree | e0d6cb5228493e8bb032465cbb2dfd95b4946e43 /src/main/java/io/github/moulberry/notenoughupdates/util | |
| parent | a6fb7bfb97d313b665085a52a660150f1da26065 (diff) | |
| download | notenoughupdates-8115922b37e375285c2a72dbdbb5d83fd942e27c.tar.gz notenoughupdates-8115922b37e375285c2a72dbdbb5d83fd942e27c.tar.bz2 notenoughupdates-8115922b37e375285c2a72dbdbb5d83fd942e27c.zip | |
PV Overhaul (#708)
Co-authored-by: Lulonaut <lulonaut@tutanota.de>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util')
3 files changed, 10 insertions, 8 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java index aaae0031..d10ae721 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java @@ -25,6 +25,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.listener.ItemTooltipListener; import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; @@ -81,7 +82,7 @@ public class ItemUtils { "ewogICJ0aW1lc3RhbXAiIDogMTYzNTk1NzQ4ODQxNywKICAicHJvZmlsZUlkIiA6ICJmNThkZWJkNTlmNTA0MjIyOGY2MDIyMjExZDRjMTQwYyIsCiAgInByb2ZpbGVOYW1lIiA6ICJ1bnZlbnRpdmV0YWxlbnQiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2I5NTFmZWQ2YTdiMmNiYzIwMzY5MTZkZWM3YTQ2YzRhNTY0ODE1NjRkMTRmOTQ1YjZlYmMwMzM4Mjc2NmQzYiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9"; } ItemStack skull = Utils.createSkull( - "§r§6" + NumberFormat.getInstance().format(coinAmount) + " Coins", + "§r§6" + StringUtils.formatNumber(coinAmount) + " Coins", uuid, texture ); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ProfileApiSyncer.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ProfileApiSyncer.java index b90e8087..67ed7c7b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ProfileApiSyncer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ProfileApiSyncer.java @@ -20,7 +20,7 @@ package io.github.moulberry.notenoughupdates.util; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; -import io.github.moulberry.notenoughupdates.profileviewer.ProfileViewer; +import io.github.moulberry.notenoughupdates.profileviewer.SkyblockProfiles; import net.minecraft.client.Minecraft; import java.util.HashMap; @@ -31,7 +31,7 @@ public class ProfileApiSyncer { private final HashMap<String, Long> resyncTimes = new HashMap<>(); private final HashMap<String, Runnable> syncingCallbacks = new HashMap<>(); - private final HashMap<String, Consumer<ProfileViewer.Profile>> finishSyncCallbacks = new HashMap<>(); + private final HashMap<String, Consumer<SkyblockProfiles>> finishSyncCallbacks = new HashMap<>(); private long lastResync; public static ProfileApiSyncer getInstance() { @@ -50,7 +50,7 @@ public class ProfileApiSyncer { String id, long timeBetween, Runnable syncingCallback, - Consumer<ProfileViewer.Profile> finishSyncCallback + Consumer<SkyblockProfiles> finishSyncCallback ) { resyncTimes.put(id, timeBetween); syncingCallbacks.put(id, syncingCallback); @@ -89,8 +89,8 @@ public class ProfileApiSyncer { if (Minecraft.getMinecraft().thePlayer == null) return; String uuid = Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", ""); - NotEnoughUpdates.profileViewer.getProfileReset(uuid, (profile) -> { - for (Consumer<ProfileViewer.Profile> c : finishSyncCallbacks.values()) c.accept(profile); + NotEnoughUpdates.profileViewer.getOrLoadSkyblockProfiles(uuid, (profile) -> { + for (Consumer<SkyblockProfiles> c : finishSyncCallbacks.values()) c.accept(profile); finishSyncCallbacks.clear(); }); } 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 94bfbee8..c4c85597 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java @@ -25,6 +25,7 @@ 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; @@ -230,8 +231,8 @@ public class XPInformation { "runecrafting" }; - private void onApiUpdated(ProfileViewer.Profile profile) { - Map<String, ProfileViewer.Level> skyblockInfo = profile.getSkyblockInfo(null); + private void onApiUpdated(SkyblockProfiles profile) { + Map<String, ProfileViewer.Level> skyblockInfo = profile.getLatestProfile().getLevelingInfo(); for (String skill : skills) { SkillInfo info = new SkillInfo(); |
