diff options
author | LifeIsAParadox <LifeIsAParadox@users.noreply.github.com> | 2021-09-01 21:36:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-01 21:36:09 +0200 |
commit | 2cebb1c86a1175d55a8f882736376edf8a08973e (patch) | |
tree | 1f76ba572d8d38bdfc24ed86c332111db76cc4fc /src/main/java/me/xmrvizzy/skyblocker/skyblock/item | |
parent | aac20f1232c8e9ead465e9b6fd78574720dd4f82 (diff) | |
parent | 15474e314e7a03922b475ce2a40a634faebe0b38 (diff) | |
download | Skyblocker-2cebb1c86a1175d55a8f882736376edf8a08973e.tar.gz Skyblocker-2cebb1c86a1175d55a8f882736376edf8a08973e.tar.bz2 Skyblocker-2cebb1c86a1175d55a8f882736376edf8a08973e.zip |
Merge branch 'master' into price-download-rewrite
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock/item')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java | 16 |
1 files changed, 7 insertions, 9 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 d5301167..59ff2e45 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java @@ -30,19 +30,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); @@ -88,6 +85,7 @@ public class PriceInfoTooltip { return internalname; } + public static JsonObject downloadPrices() { JsonObject result = null; try { |