diff options
author | Yasin <LifeIsAParadox@users.noreply.github.com> | 2023-08-07 22:38:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-07 22:38:08 +0200 |
commit | f46f40de3a3b1adeccc192134eb445f5294850f5 (patch) | |
tree | 2cecff78cd049b0fddd10e8756b21872316330fa /src/main/java | |
parent | f052d24f6c293204705624426deb7c821dd155ac (diff) | |
parent | 9bb935a43aaf19292743ae248c19c3e1a30f2180 (diff) | |
download | Skyblocker-f46f40de3a3b1adeccc192134eb445f5294850f5.tar.gz Skyblocker-f46f40de3a3b1adeccc192134eb445f5294850f5.tar.bz2 Skyblocker-f46f40de3a3b1adeccc192134eb445f5294850f5.zip |
Merge pull request #232 from LifeIsAParadox/update-mod-to-1.11.1
update mod to 1.11.1
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/skyblock/FairySouls.java | 6 |
1 files changed, 5 insertions, 1 deletions
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<Void> fairySoulsLoaded; + private static int maxSouls = 0; private static final Map<String, Set<BlockPos>> fairySouls = new HashMap<>(); private static final Map<String, Map<String, Set<BlockPos>>> 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<String, JsonElement> 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<BlockPos> fairySoulsForLocation = ImmutableSet.builder(); |