aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2022-09-29 17:25:37 +0200
committerGitHub <noreply@github.com>2022-09-29 17:25:37 +0200
commit2dd4a2b36211c380c0bf4e231859dfafd3c04a5b (patch)
tree20cde26c05f32699ccb91cda1d37b67f4eea6c62 /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
parentcbcc4c3b4004cbf3f86aeab515ea94a93b4efd1e (diff)
downloadnotenoughupdates-2dd4a2b36211c380c0bf4e231859dfafd3c04a5b.tar.gz
notenoughupdates-2dd4a2b36211c380c0bf4e231859dfafd3c04a5b.tar.bz2
notenoughupdates-2dd4a2b36211c380c0bf4e231859dfafd3c04a5b.zip
Add custom keystore and refactor HypixelApi.java (#318)
* Add custom keystore and refactor HypixelApi.java * Fix inputstream leak (+ less console spam) * Fix HOTM crash * Use api selected variable to find best profile * Number formatting * Make old profiles show again Co-authored-by: nopo <nopotheemail@gmail.com>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
index 83d8fab9..094f3892 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
@@ -165,7 +165,9 @@ public class GuiProfileViewer extends GuiScreen {
NotEnoughUpdates.INSTANCE.config.profileViewer.showPronounsInPv
? Optional.ofNullable(profile).map(it -> Utils.parseDashlessUUID(it.getUuid()))
: Optional.<UUID>empty(),
- uuid -> CompletableFuture.supplyAsync(() -> uuid.flatMap(PronounDB::getPronounsFor))
+ uuid -> uuid.isPresent()
+ ? PronounDB.getPronounsFor(uuid.get())
+ : CompletableFuture.completedFuture(Optional.empty())
);
public final GuiElementTextField playerNameTextField;
public final GuiElementTextField inventoryTextField = new GuiElementTextField("", GuiElementTextField.SCALE_TEXT);