diff options
| author | Lulonaut <lulonaut@lulonaut.tech> | 2023-08-30 13:17:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-30 21:17:48 +1000 |
| commit | 7b1ec0196ec068a469eb49fedc624347dd2a9158 (patch) | |
| tree | dabd66b871c681474c8843b1f76131b9e0b0f64a /src/main/java/io/github/moulberry/notenoughupdates/util/ProfileApiSyncer.java | |
| parent | 25440fae997ec65ac8aef795d746b91a9466c462 (diff) | |
| download | notenoughupdates-7b1ec0196ec068a469eb49fedc624347dd2a9158.tar.gz notenoughupdates-7b1ec0196ec068a469eb49fedc624347dd2a9158.tar.bz2 notenoughupdates-7b1ec0196ec068a469eb49fedc624347dd2a9158.zip | |
Fix bestiary page in PV (#805)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/ProfileApiSyncer.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/util/ProfileApiSyncer.java | 39 |
1 files changed, 0 insertions, 39 deletions
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 ed88a6a5..5a4e1c9e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ProfileApiSyncer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ProfileApiSyncer.java @@ -19,10 +19,7 @@ package io.github.moulberry.notenoughupdates.util; -import com.google.gson.JsonObject; -import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.profileviewer.SkyblockProfiles; -import net.minecraft.client.Minecraft; import java.util.HashMap; import java.util.function.Consumer; @@ -65,40 +62,4 @@ public class ProfileApiSyncer { } return time; } - - public void tick() { - if (Minecraft.getMinecraft().thePlayer == null) return; - - long resyncTime = getCurrentResyncTime(); - - if (resyncTime < 0) return; - - long currentTime = System.currentTimeMillis(); - - if (currentTime - lastResync > resyncTime) { - lastResync = currentTime; - resyncTimes.clear(); - - for (Runnable r : syncingCallbacks.values()) r.run(); - syncingCallbacks.clear(); - - forceResync(); - } - } - - private void forceResync() { - if (Minecraft.getMinecraft().thePlayer == null) return; - - String uuid = Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", ""); - NotEnoughUpdates.INSTANCE.manager.apiUtils - .newHypixelApiRequest("/skyblock/profiles") - .queryArgument("uuid", uuid) - .requestJson() - .thenAcceptAsync((profile) -> { - SkyblockProfiles skyblockProfiles = new SkyblockProfiles(NotEnoughUpdates.profileViewer, uuid); - for (Consumer<SkyblockProfiles> c : finishSyncCallbacks.values()) - c.accept((skyblockProfiles)); - finishSyncCallbacks.clear(); - }, MinecraftExecutor.OnThread); - } } |
