From 38778ba299c1126f81902d4ba872d922a6d08cc3 Mon Sep 17 00:00:00 2001 From: Phoebe <77941535+catgirlseraid@users.noreply.github.com> Date: Fri, 17 May 2024 00:50:59 +1200 Subject: Fix pv text input accepting inputs when it shouldn't (#1168) Co-authored-by: SeRaid <77941535+SeRaid743@users.noreply.github.com> --- .../moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 6194b2dd..68a34d02 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -946,13 +946,14 @@ public class GuiProfileViewer extends GuiScreen { if (playerNameTextField.getFocus()) { if (keyCode == Keyboard.KEY_RETURN) { + String name = playerNameTextField.getText(); currentPage = ProfileViewerPage.LOADING; NotEnoughUpdates.profileViewer.loadPlayerByName( playerNameTextField.getText(), profile -> { //todo: invalid name if (profile != null) { profile.resetCache(); - ProfileViewerUtils.saveSearch(playerNameTextField.getText()); + ProfileViewerUtils.saveSearch(name); } Minecraft.getMinecraft().displayGuiScreen(new GuiProfileViewer(profile)); } -- cgit