From 770dfca32889b7d8e9c4fbc511966b3f0020a65f Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Sun, 4 Sep 2022 16:35:50 -0500 Subject: [PATCH] Fix dumps --- .../java/org/geysermc/geyser/dump/DumpInfo.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java b/core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java index da52d064c..4c2d24dd4 100644 --- a/core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java +++ b/core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java @@ -70,7 +70,7 @@ public class DumpInfo { private final String cpuName; private final Locale systemLocale; private final String systemEncoding; - private Properties gitInfo; + private final GitInfo gitInfo; private final GeyserConfiguration config; private final Floodgate floodgate; private final Object2IntMap userPlatforms; @@ -89,11 +89,7 @@ public class DumpInfo { this.systemLocale = Locale.getDefault(); this.systemEncoding = System.getProperty("file.encoding"); - try (InputStream stream = GeyserImpl.getInstance().getBootstrap().getResource("git.properties")) { - this.gitInfo = new Properties(); - this.gitInfo.load(stream); - } catch (IOException ignored) { - } + this.gitInfo = new GitInfo(GeyserImpl.VERSION, GeyserImpl.BUILD_NUMBER, GeyserImpl.GIT_VERSION, GeyserImpl.BRANCH); this.config = GeyserImpl.getInstance().getConfig(); this.floodgate = new Floodgate(); @@ -300,4 +296,13 @@ public class DumpInfo { public String main; public List authors; } + + @Getter + @AllArgsConstructor + public static class GitInfo { + private final String version; + private final String buildNumber; + private final String commitHash; + private final String branchName; + } }