diff options
author | LifeIsAParadox <LifeIsAParadox@users.noreply.github.com> | 2021-09-01 20:21:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-01 20:21:38 +0200 |
commit | 15474e314e7a03922b475ce2a40a634faebe0b38 (patch) | |
tree | 1cfd40b9fde69ad8b840bb3bd757c913886efe99 /src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java | |
parent | ad40e1586da1f3e07bea69374bc2676b090684dc (diff) | |
parent | 86b68d408a60ce31289129cb4730aba97982a1ec (diff) | |
download | Skyblocker-15474e314e7a03922b475ce2a40a634faebe0b38.tar.gz Skyblocker-15474e314e7a03922b475ce2a40a634faebe0b38.tar.bz2 Skyblocker-15474e314e7a03922b475ce2a40a634faebe0b38.zip |
Merge pull request #2 from ExternalTime/small-fixes
Small fixes
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java index ff02c675..13627403 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java @@ -36,19 +36,16 @@ import me.xmrvizzy.skyblocker.SkyblockerMod; public class PriceInfoTooltip { private JsonObject auctionPricesJson = null; private JsonObject bazaarPricesJson = null; - public static JsonObject prices = PriceInfoTooltip.downloadPrices(); + public static JsonObject prices = downloadPrices(); public static void onInjectTooltip(ItemStack stack, TooltipContext context, List<Text> list) { String name = getInternalNameForItem(stack); try { - if(!list.toString().contains("Avg. BIN Price") && prices.has(name) ){ - if(prices != null){ - - JsonElement getPrice = prices.get(name); - String price = round(getPrice.getAsDouble(), 2); - - list.add(new LiteralText("Avg. BIN Price: ").formatted(Formatting.GOLD).append(new LiteralText(price + " Coins").formatted(Formatting.DARK_AQUA))); - } + if(!list.toString().contains("Avg. BIN Price") && prices != null && prices.has(name) ){ + JsonElement getPrice = prices.get(name); + String price = round(getPrice.getAsDouble(), 2); + + list.add(new LiteralText("Avg. BIN Price: ").formatted(Formatting.GOLD).append(new LiteralText(price + " Coins").formatted(Formatting.DARK_AQUA))); } }catch(Exception e) { MinecraftClient.getInstance().player.sendMessage(new LiteralText(e.toString()), false); @@ -94,7 +91,7 @@ public class PriceInfoTooltip { return internalname; } - public static JsonObject downloadPrices() { + private static JsonObject downloadPrices() { try { downloadUsingStream("https://moulberry.codes/auction_averages_lbin/3day.json.gz", "3day.json.gz"); decompressGzipFile("3day.json.gz", "3day.json"); |