diff options
author | ExternalTime <84183548+ExternalTime@users.noreply.github.com> | 2021-08-30 11:29:46 +0200 |
---|---|---|
committer | ExternalTime <84183548+ExternalTime@users.noreply.github.com> | 2021-08-30 11:29:46 +0200 |
commit | e64cdeba8f9b738cdc822a89b04a39508093f6ee (patch) | |
tree | 6dfe3fafa0644efad0d08527f10118ca8e7ec258 /src | |
parent | 1c2af56c0d14b7d91ea222e0fab222fccccb4513 (diff) | |
download | Skyblocker-e64cdeba8f9b738cdc822a89b04a39508093f6ee.tar.gz Skyblocker-e64cdeba8f9b738cdc822a89b04a39508093f6ee.tar.bz2 Skyblocker-e64cdeba8f9b738cdc822a89b04a39508093f6ee.zip |
Moved null check before the variable is first used
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java | 13 |
1 files changed, 5 insertions, 8 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..30e19c0f 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java @@ -41,14 +41,11 @@ public class PriceInfoTooltip { 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); |