From 18c9537df622f5c5dde558ff4d24eef2e5678911 Mon Sep 17 00:00:00 2001 From: 0x150 Date: Thu, 6 Jan 2022 17:32:10 +0100 Subject: [PATCH] fix 2 bruhs --- .../sipprivate/feature/gui/screen/AltManagerScreen.java | 1 + .../me/x150/sipprivate/feature/gui/screen/HomeScreen.java | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/me/x150/sipprivate/feature/gui/screen/AltManagerScreen.java b/src/main/java/me/x150/sipprivate/feature/gui/screen/AltManagerScreen.java index 5f0935c..bdb27ad 100644 --- a/src/main/java/me/x150/sipprivate/feature/gui/screen/AltManagerScreen.java +++ b/src/main/java/me/x150/sipprivate/feature/gui/screen/AltManagerScreen.java @@ -685,6 +685,7 @@ public class AltManagerScreen extends AntiAliasedScreen implements FastTickable storage.cachedName = profile.getUsername(); storage.cachedUuid = profile.getUuid(); downloadTexture(); + storage.valid = true; } catch (Exception ignored) { storage.valid = false; } diff --git a/src/main/java/me/x150/sipprivate/feature/gui/screen/HomeScreen.java b/src/main/java/me/x150/sipprivate/feature/gui/screen/HomeScreen.java index 98e856a..d0f33ac 100644 --- a/src/main/java/me/x150/sipprivate/feature/gui/screen/HomeScreen.java +++ b/src/main/java/me/x150/sipprivate/feature/gui/screen/HomeScreen.java @@ -21,6 +21,7 @@ import net.minecraft.client.util.DefaultSkinHelper; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; import net.minecraft.util.math.MathHelper; +import org.apache.commons.io.IOUtils; import org.lwjgl.BufferUtils; import org.lwjgl.opengl.GL40C; @@ -72,11 +73,9 @@ public class HomeScreen extends AntiAliasedScreen implements FastTickable { loaded = true; try { File execF = new File(HomeScreen.class.getProtectionDomain().getCodeSource().getLocation().toURI()); - File changelog = new File(Objects.requireNonNull(HomeScreen.class.getClassLoader().getResource("changelogLatest.txt")).toURI()); - File version = new File(Objects.requireNonNull(HomeScreen.class.getClassLoader().getResource("version.txt")).toURI()); isDev = execF.isDirectory(); - HomeScreen.version = Files.readString(version.toPath(), StandardCharsets.UTF_8); - HomeScreen.changelog = Files.readString(changelog.toPath(), StandardCharsets.UTF_8); + HomeScreen.version = IOUtils.toString(Objects.requireNonNull(HomeScreen.class.getClassLoader().getResourceAsStream("version.txt")), StandardCharsets.UTF_8); + HomeScreen.changelog = IOUtils.toString(Objects.requireNonNull(HomeScreen.class.getClassLoader().getResourceAsStream("changelogLatest.txt")), StandardCharsets.UTF_8); updateCurrentAccount(this::complete); } catch (Exception e) { e.printStackTrace();