From 43400f0a1bd0d4b2b0dd944d7a82019e37206c90 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 2 Aug 2023 13:12:29 +0800 Subject: Refactor Trivia to use FairySouls --- src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java') diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java index ccffdcca..dd8f20e7 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java @@ -20,6 +20,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.Text; import net.minecraft.util.DyeColor; import net.minecraft.util.math.BlockPos; +import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,6 +36,14 @@ public class FairySouls { private static final Map> fairySouls = new HashMap<>(); private static final Map>> foundFairies = new HashMap<>(); + public static CompletableFuture runAsyncAfterFairySoulsLoad(Runnable runnable) { + return fairySoulsLoaded.thenRunAsync(runnable); + } + + public static int getFairySoulsSize(@Nullable String location) { + return location == null ? fairySouls.values().stream().mapToInt(Set::size).sum() : fairySouls.get(location).size(); + } + public static void init() { fairySoulsLoaded = NEURepo.runAsyncAfterLoad(() -> { try { -- cgit From 0d0bd433af7f1250af27dd989b45aa7e5cab5223 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Mon, 7 Aug 2023 17:11:38 +0800 Subject: Fix TriviaTest --- src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java') diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java index dd8f20e7..2bdfa401 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java @@ -37,6 +37,10 @@ public class FairySouls { private static final Map>> foundFairies = new HashMap<>(); public static CompletableFuture runAsyncAfterFairySoulsLoad(Runnable runnable) { + if (fairySoulsLoaded == null) { + LOGGER.error("Fairy Souls have not being initialized yet! Please ensure the Fairy Souls module is initialized before modules calling this method in SkyblockerMod#onInitializeClient. This error can be safely ignore in a test environment."); + return CompletableFuture.completedFuture(null); + } return fairySoulsLoaded.thenRunAsync(runnable); } -- cgit From eeee6cc6aa9db5d2c9711bbfa10c67eccb5300df Mon Sep 17 00:00:00 2001 From: Yasin Date: Mon, 7 Aug 2023 21:04:48 +0200 Subject: update mod to 1.11.1 --- CHANGELOG.md | 18 ++++++++++++++++++ gradle.properties | 2 +- .../me/xmrvizzy/skyblocker/skyblock/FairySouls.java | 6 +++++- 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java') diff --git a/CHANGELOG.md b/CHANGELOG.md index 2957090f..ad152f2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +# Release 1.11.1 + +## Highlight +* Fixes made to the mod to ensure it works with the latest Hypixel changes by @AzureAaron +* Overlay for all TP items by @Julienraptor01 and @kevinthegreat1 + +## What's Changed +* Update buildrelease.yml by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/223 +* Mixins refactor by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/213 +* add cache for beta builds by @LifeIsAParadox in https://github.com/SkyblockerMod/Skyblocker/pull/224 +* Add Overlays for ALL forms of TP by @Julienraptor01 in https://github.com/SkyblockerMod/Skyblocker/pull/220 +* Fix Croesus Helper by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/226 +* Fix broken Hypixel detection by @AzureAaron in https://github.com/SkyblockerMod/Skyblocker/pull/231 +* Random refactors by @kevinthegreat1 in https://github.com/SkyblockerMod/Skyblocker/pull/229 + + +**Full Changelog**: https://github.com/SkyblockerMod/Skyblocker/compare/v1.11.0...v1.11.1 +___ # Release 1.11.0 ## Highlight diff --git a/gradle.properties b/gradle.properties index 6ae74df8..a84834ec 100644 --- a/gradle.properties +++ b/gradle.properties @@ -28,7 +28,7 @@ betterinject_version=0.1.3 occlusionculling_version = 0.0.7-SNAPSHOT # Mod Properties -mod_version = 1.11.0 +mod_version = 1.11.1 maven_group = me.xmrvizzy archives_base_name = skyblocker modrinth_id=y6DuFGwJ \ No newline at end of file diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java index 2bdfa401..b7c4ff2f 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java @@ -33,6 +33,7 @@ import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.lit public class FairySouls { private static final Logger LOGGER = LoggerFactory.getLogger(FairySouls.class); private static CompletableFuture fairySoulsLoaded; + private static int maxSouls = 0; private static final Map> fairySouls = new HashMap<>(); private static final Map>> foundFairies = new HashMap<>(); @@ -45,7 +46,7 @@ public class FairySouls { } public static int getFairySoulsSize(@Nullable String location) { - return location == null ? fairySouls.values().stream().mapToInt(Set::size).sum() : fairySouls.get(location).size(); + return location == null ? maxSouls : fairySouls.get(location).size(); } public static void init() { @@ -54,6 +55,9 @@ public class FairySouls { BufferedReader reader = new BufferedReader(new FileReader(NEURepo.LOCAL_REPO_DIR.resolve("constants").resolve("fairy_souls.json").toFile())); for (Map.Entry fairySoulJson : JsonParser.parseReader(reader).getAsJsonObject().asMap().entrySet()) { if (fairySoulJson.getKey().equals("//") || fairySoulJson.getKey().equals("Max Souls")) { + if (fairySoulJson.getKey().equals("Max Souls")) { + maxSouls = fairySoulJson.getValue().getAsInt(); + } continue; } ImmutableSet.Builder fairySoulsForLocation = ImmutableSet.builder(); -- cgit