From e626a7fc50494db7265f05e13ef3dd26ee35a82b Mon Sep 17 00:00:00 2001 From: medievalshell Date: Thu, 28 May 2026 12:33:50 +0200 Subject: [PATCH] feat: version string tied to project version + "Extended" title The :about / :info hotel-info title was hardcoded ("Arcturus Morningstar 4.1.0") and drifted from the real build. Now Emulator.version reads the jar manifest's Implementation-Version (= ${project.version}, added via the assembly plugin) and falls back to MAJOR.MINOR.BUILD only outside a jar. Title becomes "Arcturus Morningstar Extended " (e.g. 4.2.24). --- Emulator/pom.xml | 1 + Emulator/src/main/java/com/eu/habbo/Emulator.java | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Emulator/pom.xml b/Emulator/pom.xml index 1f4ed186..ff8e57c4 100644 --- a/Emulator/pom.xml +++ b/Emulator/pom.xml @@ -38,6 +38,7 @@ com.eu.habbo.Emulator + true diff --git a/Emulator/src/main/java/com/eu/habbo/Emulator.java b/Emulator/src/main/java/com/eu/habbo/Emulator.java index 1a9fe716..de1a4e86 100644 --- a/Emulator/src/main/java/com/eu/habbo/Emulator.java +++ b/Emulator/src/main/java/com/eu/habbo/Emulator.java @@ -39,12 +39,23 @@ public final class Emulator { private static final String OS_NAME = (System.getProperty("os.name") != null ? System.getProperty("os.name") : "Unknown"); private static final String CLASS_PATH = (System.getProperty("java.class.path") != null ? System.getProperty("java.class.path") : "Unknown"); + // Fallback version, only used when running outside a packaged jar (e.g. from + // the IDE). In production the version comes from the jar manifest below. public final static int MAJOR = 4; public final static int MINOR = 1; public final static int BUILD = 0; public final static String PREVIEW = ""; - public static final String version = "Arcturus Morningstar" + " " + MAJOR + "." + MINOR + "." + BUILD + " " + PREVIEW; + // Tied to the Maven project version: read from the jar manifest + // (Implementation-Version = ${project.version}, see pom assembly plugin). + private static String resolveVersionNumber() { + String implementation = Emulator.class.getPackage().getImplementationVersion(); + if (implementation != null && !implementation.isEmpty()) return implementation; + String fallback = MAJOR + "." + MINOR + "." + BUILD; + return PREVIEW.isEmpty() ? fallback : fallback + " " + PREVIEW; + } + + public static final String version = "Arcturus Morningstar Extended " + resolveVersionNumber(); private static final String logo = "\n" + "███╗ ███╗ ██████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ ███████╗████████╗ █████╗ ██████╗ \n" +