diff --git a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java index 1aa975263d..b8722fc6b3 100644 --- a/src/main/java/de/hysky/skyblocker/SkyblockerMod.java +++ b/src/main/java/de/hysky/skyblocker/SkyblockerMod.java @@ -26,7 +26,7 @@ import de.hysky.skyblocker.skyblock.itemlist.ItemRepository; import de.hysky.skyblocker.skyblock.quicknav.QuickNav; import de.hysky.skyblocker.skyblock.rift.TheRift; -import de.hysky.skyblocker.skyblock.searchOverlay.SearchOverManager; +import de.hysky.skyblocker.skyblock.searchoverlay.SearchOverManager; import de.hysky.skyblocker.skyblock.shortcut.Shortcuts; import de.hysky.skyblocker.skyblock.special.SpecialEffects; import de.hysky.skyblocker.skyblock.tabhud.TabHud; diff --git a/src/main/java/de/hysky/skyblocker/mixin/ClientPlayerEntityMixin.java b/src/main/java/de/hysky/skyblocker/mixin/ClientPlayerEntityMixin.java index 2a4c38a7c6..ceda9ed4db 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixin/ClientPlayerEntityMixin.java @@ -6,8 +6,8 @@ import de.hysky.skyblocker.skyblock.item.HotbarSlotLock; import de.hysky.skyblocker.skyblock.item.ItemProtection; import de.hysky.skyblocker.skyblock.rift.HealingMelonIndicator; -import de.hysky.skyblocker.skyblock.searchOverlay.OverlayScreen; -import de.hysky.skyblocker.skyblock.searchOverlay.SearchOverManager; +import de.hysky.skyblocker.skyblock.searchoverlay.OverlayScreen; +import de.hysky.skyblocker.skyblock.searchoverlay.SearchOverManager; import de.hysky.skyblocker.utils.Utils; import net.minecraft.block.entity.SignBlockEntity; import net.minecraft.client.MinecraftClient; diff --git a/src/main/java/de/hysky/skyblocker/skyblock/searchOverlay/OverlayScreen.java b/src/main/java/de/hysky/skyblocker/skyblock/searchoverlay/OverlayScreen.java similarity index 99% rename from src/main/java/de/hysky/skyblocker/skyblock/searchOverlay/OverlayScreen.java rename to src/main/java/de/hysky/skyblocker/skyblock/searchoverlay/OverlayScreen.java index e1545c6c98..b8907e274f 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/searchOverlay/OverlayScreen.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/searchoverlay/OverlayScreen.java @@ -1,4 +1,4 @@ -package de.hysky.skyblocker.skyblock.searchOverlay; +package de.hysky.skyblocker.skyblock.searchoverlay; import de.hysky.skyblocker.config.SkyblockerConfigManager; import net.minecraft.client.gui.DrawContext; diff --git a/src/main/java/de/hysky/skyblocker/skyblock/searchOverlay/SearchOverManager.java b/src/main/java/de/hysky/skyblocker/skyblock/searchoverlay/SearchOverManager.java similarity index 96% rename from src/main/java/de/hysky/skyblocker/skyblock/searchOverlay/SearchOverManager.java rename to src/main/java/de/hysky/skyblocker/skyblock/searchoverlay/SearchOverManager.java index b2a453a922..1d740601d0 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/searchOverlay/SearchOverManager.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/searchoverlay/SearchOverManager.java @@ -1,4 +1,4 @@ -package de.hysky.skyblocker.skyblock.searchOverlay; +package de.hysky.skyblocker.skyblock.searchoverlay; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -96,13 +96,15 @@ private static void loadItems() { HashMap namesToId = new HashMap<>(); //get bazaar items - try (Http.ApiResponse response = Http.sendHypixelRequest("skyblock/bazaar", "")) { - JsonObject products = JsonParser.parseString(response.content()).getAsJsonObject().get("products").getAsJsonObject(); + try { + if (TooltipInfoType.BAZAAR.getData() == null) TooltipInfoType.BAZAAR.run(); + + JsonObject products = TooltipInfoType.BAZAAR.getData(); for (Map.Entry entry : products.entrySet()) { if (entry.getValue().isJsonObject()) { JsonObject product = entry.getValue().getAsJsonObject(); - String id = product.get("product_id").getAsString(); - int sellVolume = product.get("quick_status").getAsJsonObject().get("sellVolume").getAsInt(); + String id = product.get("id").getAsString(); + int sellVolume = product.get("sellVolume").getAsInt(); if (sellVolume == 0) continue; //do not add items that do not sell e.g. they are not actual in the bazaar Matcher matcher = BAZAAR_ENCHANTMENT_PATTERN.matcher(id); @@ -334,7 +336,7 @@ private static void pushSign() { } } - static Pair splitString(String s) { + public static Pair splitString(String s) { if (s.length() <= 15) { return Pair.of(s, ""); } diff --git a/src/test/java/de/hysky/skyblocker/skyblock/searchOverlay/SplitStringTest.java b/src/test/java/de/hysky/skyblocker/skyblock/searchoverlay/SplitStringTest.java similarity index 95% rename from src/test/java/de/hysky/skyblocker/skyblock/searchOverlay/SplitStringTest.java rename to src/test/java/de/hysky/skyblocker/skyblock/searchoverlay/SplitStringTest.java index c397b5a47c..a9fd541f78 100644 --- a/src/test/java/de/hysky/skyblocker/skyblock/searchOverlay/SplitStringTest.java +++ b/src/test/java/de/hysky/skyblocker/skyblock/searchoverlay/SplitStringTest.java @@ -1,4 +1,4 @@ -package de.hysky.skyblocker.skyblock.searchOverlay; +package de.hysky.skyblocker.skyblock.searchoverlay; import it.unimi.dsi.fastutil.Pair; import org.junit.jupiter.api.Assertions;