Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small search overlay changes #548

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/de/hysky/skyblocker/SkyblockerMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -96,13 +96,15 @@ private static void loadItems() {
HashMap<String, String> 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<String, JsonElement> 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);
Expand Down Expand Up @@ -334,7 +336,7 @@ private static void pushSign() {
}
}

static Pair<String, String> splitString(String s) {
public static Pair<String, String> splitString(String s) {
if (s.length() <= 15) {
return Pair.of(s, "");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Loading