From 886524bb94b6a9f549d15fdd74535206406f0100 Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 3 May 2019 21:06:22 +0700 Subject: [PATCH] =?UTF-8?q?[ANY]=20=D0=9F=D0=B5=D1=80=D0=B5=D0=BC=D0=B5?= =?UTF-8?q?=D1=89=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B2=D1=81=D0=B5=D0=B3=D0=BE?= =?UTF-8?q?=20=D0=BB=D0=B8=D1=88=D0=BD=D0=B5=D0=B3=D0=BE=20=D0=B8=D0=B7=20?= =?UTF-8?q?libLauncher=20=D0=B2=20LauncherAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/ru/gravit/launchserver/LaunchServer.java | 7 ++++--- .../gravit/launchserver/binary/EXEL4JLauncherBinary.java | 6 +++--- .../launchserver/command/basic/VersionCommand.java | 3 ++- .../java/ru/gravit/launchserver/modules/CoreModule.java | 3 +-- .../java/ru/gravit/launcher/client/ClientLauncher.java | 3 ++- .../ru/gravit/launcher/managers/SettingsManager.java | 2 +- .../src/main/java/ru/gravit/launcher/AutogenConfig.java | 0 .../main/java/ru/gravit/launcher/ClientPermissions.java | 0 .../src/main/java/ru/gravit/launcher/HWID.java | 0 .../src/main/java/ru/gravit/launcher/Launcher.java | 9 --------- .../src/main/java/ru/gravit/launcher/LauncherConfig.java | 0 .../java/ru/gravit/launcher/LauncherHWIDInterface.java | 0 .../src/main/java/ru/gravit/launcher/OshiHWID.java | 0 .../ru/gravit/launcher}/config/JsonConfigurable.java | 2 +- .../java/ru/gravit/launcher/managers/ConfigManager.java | 2 +- .../java/ru/gravit/launcher/profiles/ClientProfile.java | 0 .../java/ru/gravit/launcher/profiles/PlayerProfile.java | 0 .../main/java/ru/gravit/launcher/profiles/Texture.java | 0 .../launcher/profiles/optional/OptionalDepend.java | 0 .../gravit/launcher/profiles/optional/OptionalFile.java | 0 .../gravit/launcher/profiles/optional/OptionalType.java | 0 .../launcher/request/JsonResultSerializeAdapter.java | 0 .../ru/gravit/launcher/request/RequestException.java | 0 .../java/ru/gravit/launcher/request/RequestType.java | 0 .../java/ru/gravit/launcher/request/ResultInterface.java | 0 .../java/ru/gravit/launcher/request/UpdateAction.java | 0 .../java/ru/gravit/launcher/server/ServerWrapper.java | 2 +- libLauncher/src/main/java/ru/gravit/utils/Version.java | 9 +++++++++ .../main/java/ru/gravit/utils/helper/FormatHelper.java | 8 ++++---- .../src/main/java/ru/gravit/utils/helper/IOHelper.java | 5 ++--- 30 files changed, 31 insertions(+), 30 deletions(-) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/AutogenConfig.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/ClientPermissions.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/HWID.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/Launcher.java (93%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/LauncherConfig.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/LauncherHWIDInterface.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/OshiHWID.java (100%) rename {libLauncher/src/main/java/ru/gravit/utils => LauncherAPI/src/main/java/ru/gravit/launcher}/config/JsonConfigurable.java (98%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/managers/ConfigManager.java (96%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/profiles/PlayerProfile.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/profiles/Texture.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/profiles/optional/OptionalDepend.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/profiles/optional/OptionalFile.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/profiles/optional/OptionalType.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/request/JsonResultSerializeAdapter.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/request/RequestException.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/request/RequestType.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/request/ResultInterface.java (100%) rename {libLauncher => LauncherAPI}/src/main/java/ru/gravit/launcher/request/UpdateAction.java (100%) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java index a4d64d67..11719c05 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java @@ -34,10 +34,11 @@ import ru.gravit.launchserver.manangers.hook.SocketHookManager; import ru.gravit.launchserver.socket.ServerSocketHandler; import ru.gravit.launchserver.websocket.NettyServerSocketHandler; +import ru.gravit.utils.Version; import ru.gravit.utils.command.CommandHandler; import ru.gravit.utils.command.JLineCommandHandler; import ru.gravit.utils.command.StdCommandHandler; -import ru.gravit.utils.config.JsonConfigurable; +import ru.gravit.launcher.config.JsonConfigurable; import ru.gravit.utils.helper.*; import java.io.*; @@ -688,8 +689,8 @@ private void generateConfigIfNotExists(boolean testEnv) throws IOException { newConfig.launch4j = new ExeConf(); newConfig.launch4j.enabled = true; newConfig.launch4j.copyright = "© GravitLauncher Team"; - newConfig.launch4j.fileDesc = "GravitLauncher ".concat(Launcher.getVersion().getVersionString()); - newConfig.launch4j.fileVer = Launcher.getVersion().getVersionString().concat(".").concat(String.valueOf(Launcher.getVersion().patch)); + newConfig.launch4j.fileDesc = "GravitLauncher ".concat(Version.getVersion().getVersionString()); + newConfig.launch4j.fileVer = Version.getVersion().getVersionString().concat(".").concat(String.valueOf(Version.getVersion().patch)); newConfig.launch4j.internalName = "Launcher"; newConfig.launch4j.trademarks = "This product is licensed under GPLv3"; newConfig.launch4j.txtFileVersion = "%s, build %d"; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/EXEL4JLauncherBinary.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/EXEL4JLauncherBinary.java index ba669376..ea0826ea 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/EXEL4JLauncherBinary.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/EXEL4JLauncherBinary.java @@ -3,8 +3,8 @@ import net.sf.launch4j.Builder; import net.sf.launch4j.Log; import net.sf.launch4j.config.*; -import ru.gravit.launcher.Launcher; import ru.gravit.launchserver.LaunchServer; +import ru.gravit.utils.Version; import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.LogHelper; @@ -108,8 +108,8 @@ private void setConfig() { ConfigPersister.getInstance().setAntConfig(config, null); } - private static String VERSION = Launcher.getVersion().getVersionString(); - private static int BUILD = Launcher.getVersion().build; + private static String VERSION = Version.getVersion().getVersionString(); + private static int BUILD = Version.getVersion().build; public static String formatVars(String mask) { return String.format(mask, VERSION, BUILD); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/VersionCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/VersionCommand.java index 3a2c94d7..ce51ce94 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/VersionCommand.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/VersionCommand.java @@ -3,6 +3,7 @@ import ru.gravit.launcher.Launcher; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.command.Command; +import ru.gravit.utils.Version; import ru.gravit.utils.helper.LogHelper; public final class VersionCommand extends Command { @@ -22,6 +23,6 @@ public String getUsageDescription() { @Override public void invoke(String... args) { - LogHelper.subInfo("LaunchServer version: %d.%d.%d (build #%d)", Launcher.MAJOR, Launcher.MINOR, Launcher.PATCH, Launcher.BUILD); + LogHelper.subInfo("LaunchServer version: %d.%d.%d (build #%d)", Version.MAJOR, Version.MINOR, Version.PATCH, Version.BUILD); } } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/modules/CoreModule.java b/LaunchServer/src/main/java/ru/gravit/launchserver/modules/CoreModule.java index 35ee3c83..ba311709 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/modules/CoreModule.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/modules/CoreModule.java @@ -1,6 +1,5 @@ package ru.gravit.launchserver.modules; -import ru.gravit.launcher.Launcher; import ru.gravit.launcher.modules.Module; import ru.gravit.launcher.modules.ModuleContext; import ru.gravit.utils.Version; @@ -18,7 +17,7 @@ public String getName() { @Override public Version getVersion() { - return Launcher.getVersion(); + return Version.getVersion(); } @Override diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java index e3dc7e66..a061a280 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java @@ -16,6 +16,7 @@ import ru.gravit.launcher.serialize.stream.StreamObject; import ru.gravit.launcher.utils.DirWatcher; import ru.gravit.utils.PublicURLClassLoader; +import ru.gravit.utils.Version; import ru.gravit.utils.helper.*; import ru.gravit.utils.helper.JVMHelper.OS; @@ -201,7 +202,7 @@ private static void addClientArgs(Collection args, ClientProfile profile Collections.addAll(args, "--assetsDir", params.assetDir.toString()); Collections.addAll(args, "--resourcePackDir", params.clientDir.resolve(RESOURCEPACKS_DIR).toString()); if (version.compareTo(ClientProfile.Version.MC194) >= 0) - Collections.addAll(args, "--versionType", "Launcher v" + Launcher.getVersion().getVersionString()); + Collections.addAll(args, "--versionType", "Launcher v" + Version.getVersion().getVersionString()); // Add server args if (params.autoEnter) { diff --git a/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java b/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java index bd1b49ca..180f7da5 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java +++ b/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java @@ -6,7 +6,7 @@ import ru.gravit.launcher.hasher.HashedDir; import ru.gravit.launcher.serialize.HInput; import ru.gravit.launcher.serialize.HOutput; -import ru.gravit.utils.config.JsonConfigurable; +import ru.gravit.launcher.config.JsonConfigurable; import ru.gravit.utils.helper.IOHelper; import java.io.IOException; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/AutogenConfig.java b/LauncherAPI/src/main/java/ru/gravit/launcher/AutogenConfig.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/AutogenConfig.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/AutogenConfig.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java b/LauncherAPI/src/main/java/ru/gravit/launcher/ClientPermissions.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/ClientPermissions.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/HWID.java b/LauncherAPI/src/main/java/ru/gravit/launcher/HWID.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/HWID.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/HWID.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java b/LauncherAPI/src/main/java/ru/gravit/launcher/Launcher.java similarity index 93% rename from libLauncher/src/main/java/ru/gravit/launcher/Launcher.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/Launcher.java index f2b79330..0e72e96e 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/Launcher.java @@ -57,11 +57,6 @@ public final class Launcher { public static final String CONFIG_SCRIPT_FILE = "config.js"; private static final Pattern UUID_PATTERN = Pattern.compile("-", Pattern.LITERAL); - public static final int MAJOR = 5; - public static final int MINOR = 0; - public static final int PATCH = 0; - public static final int BUILD = 4; - public static final Version.Type RELEASE = Version.Type.BETA; public static GsonManager gsonManager; @LauncherAPI @@ -119,10 +114,6 @@ public static String toHash(UUID uuid) { return UUID_PATTERN.matcher(uuid.toString()).replaceAll(""); } - public static Version getVersion() { - return new Version(MAJOR, MINOR, PATCH, BUILD, RELEASE); - } - public static void applyLauncherEnv(LauncherConfig.LauncherEnvironment env) { switch (env) { case DEV: diff --git a/libLauncher/src/main/java/ru/gravit/launcher/LauncherConfig.java b/LauncherAPI/src/main/java/ru/gravit/launcher/LauncherConfig.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/LauncherConfig.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/LauncherConfig.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/LauncherHWIDInterface.java b/LauncherAPI/src/main/java/ru/gravit/launcher/LauncherHWIDInterface.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/LauncherHWIDInterface.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/LauncherHWIDInterface.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/OshiHWID.java b/LauncherAPI/src/main/java/ru/gravit/launcher/OshiHWID.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/OshiHWID.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/OshiHWID.java diff --git a/libLauncher/src/main/java/ru/gravit/utils/config/JsonConfigurable.java b/LauncherAPI/src/main/java/ru/gravit/launcher/config/JsonConfigurable.java similarity index 98% rename from libLauncher/src/main/java/ru/gravit/utils/config/JsonConfigurable.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/config/JsonConfigurable.java index 230b76ac..0a58295b 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/config/JsonConfigurable.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/config/JsonConfigurable.java @@ -1,4 +1,4 @@ -package ru.gravit.utils.config; +package ru.gravit.launcher.config; import ru.gravit.launcher.Launcher; import ru.gravit.launcher.LauncherAPI; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/managers/ConfigManager.java b/LauncherAPI/src/main/java/ru/gravit/launcher/managers/ConfigManager.java similarity index 96% rename from libLauncher/src/main/java/ru/gravit/launcher/managers/ConfigManager.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/managers/ConfigManager.java index d2269162..9ade8c6c 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/managers/ConfigManager.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/managers/ConfigManager.java @@ -1,6 +1,6 @@ package ru.gravit.launcher.managers; -import ru.gravit.utils.config.JsonConfigurable; +import ru.gravit.launcher.config.JsonConfigurable; import ru.gravit.utils.helper.LogHelper; import ru.gravit.utils.helper.VerifyHelper; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java b/LauncherAPI/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/PlayerProfile.java b/LauncherAPI/src/main/java/ru/gravit/launcher/profiles/PlayerProfile.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/profiles/PlayerProfile.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/profiles/PlayerProfile.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/Texture.java b/LauncherAPI/src/main/java/ru/gravit/launcher/profiles/Texture.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/profiles/Texture.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/profiles/Texture.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/optional/OptionalDepend.java b/LauncherAPI/src/main/java/ru/gravit/launcher/profiles/optional/OptionalDepend.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/profiles/optional/OptionalDepend.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/profiles/optional/OptionalDepend.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/optional/OptionalFile.java b/LauncherAPI/src/main/java/ru/gravit/launcher/profiles/optional/OptionalFile.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/profiles/optional/OptionalFile.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/profiles/optional/OptionalFile.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/optional/OptionalType.java b/LauncherAPI/src/main/java/ru/gravit/launcher/profiles/optional/OptionalType.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/profiles/optional/OptionalType.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/profiles/optional/OptionalType.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/request/JsonResultSerializeAdapter.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/JsonResultSerializeAdapter.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/request/JsonResultSerializeAdapter.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/request/JsonResultSerializeAdapter.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/request/RequestException.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/RequestException.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/request/RequestException.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/request/RequestException.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/request/RequestType.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/RequestType.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/request/RequestType.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/request/RequestType.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/request/ResultInterface.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/ResultInterface.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/request/ResultInterface.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/request/ResultInterface.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/request/UpdateAction.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/UpdateAction.java similarity index 100% rename from libLauncher/src/main/java/ru/gravit/launcher/request/UpdateAction.java rename to LauncherAPI/src/main/java/ru/gravit/launcher/request/UpdateAction.java diff --git a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java index 15710be1..abc1f8ef 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java @@ -11,7 +11,7 @@ import ru.gravit.launcher.request.update.ProfilesRequest; import ru.gravit.launcher.server.setup.ServerWrapperSetup; import ru.gravit.utils.PublicURLClassLoader; -import ru.gravit.utils.config.JsonConfigurable; +import ru.gravit.launcher.config.JsonConfigurable; import ru.gravit.utils.helper.CommonHelper; import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.LogHelper; diff --git a/libLauncher/src/main/java/ru/gravit/utils/Version.java b/libLauncher/src/main/java/ru/gravit/utils/Version.java index 8fba1455..f4654b65 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/Version.java +++ b/libLauncher/src/main/java/ru/gravit/utils/Version.java @@ -15,6 +15,11 @@ public final class Version { public final int build; @LauncherAPI public final Type release; + public static final int MAJOR = 5; + public static final int MINOR = 0; + public static final int PATCH = 0; + public static final int BUILD = 4; + public static final Version.Type RELEASE = Version.Type.BETA; @LauncherAPI public Version(int major, int minor, int patch) { @@ -43,6 +48,10 @@ public Version(int major, int minor, int patch, int build, Type release) { this.release = release; } + public static Version getVersion() { + return new Version(MAJOR, MINOR, PATCH, BUILD, RELEASE); + } + @Override @LauncherAPI public boolean equals(Object o) { diff --git a/libLauncher/src/main/java/ru/gravit/utils/helper/FormatHelper.java b/libLauncher/src/main/java/ru/gravit/utils/helper/FormatHelper.java index 4a688b2e..6ec9d685 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/helper/FormatHelper.java +++ b/libLauncher/src/main/java/ru/gravit/utils/helper/FormatHelper.java @@ -1,7 +1,7 @@ package ru.gravit.utils.helper; import org.fusesource.jansi.Ansi; -import ru.gravit.launcher.Launcher; +import ru.gravit.utils.Version; /* * Nashorn при инициализации LogHelper пытается инициализировтаь все доступные в нем методы. @@ -59,8 +59,8 @@ static String ansiFormatVersion(String product) { fgBright(Ansi.Color.MAGENTA).a("GravitLauncher "). // sashok724's fgBright(Ansi.Color.BLUE).a("(fork sashok724's Launcher) "). fgBright(Ansi.Color.CYAN).a(product). // Product - fgBright(Ansi.Color.WHITE).a(" v").fgBright(Ansi.Color.BLUE).a(Launcher.getVersion().toString()). // Version - fgBright(Ansi.Color.WHITE).a(" (build #").fgBright(Ansi.Color.RED).a(Launcher.getVersion().build).fgBright(Ansi.Color.WHITE).a(')'). // Build# + fgBright(Ansi.Color.WHITE).a(" v").fgBright(Ansi.Color.BLUE).a(Version.getVersion().toString()). // Version + fgBright(Ansi.Color.WHITE).a(" (build #").fgBright(Ansi.Color.RED).a(Version.getVersion().build).fgBright(Ansi.Color.WHITE).a(')'). // Build# reset().toString(); // To file } @@ -79,7 +79,7 @@ public static String rawFormat(LogHelper.Level level, String dateTime, boolean s } static String formatVersion(String product) { - return String.format("GravitLauncher (fork sashok724's Launcher) %s v%s", product, Launcher.getVersion().toString()); + return String.format("GravitLauncher (fork sashok724's Launcher) %s v%s", product, Version.getVersion().toString()); } static String formatLicense(String product) { diff --git a/libLauncher/src/main/java/ru/gravit/utils/helper/IOHelper.java b/libLauncher/src/main/java/ru/gravit/utils/helper/IOHelper.java index e1249504..0885aeb4 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/helper/IOHelper.java +++ b/libLauncher/src/main/java/ru/gravit/utils/helper/IOHelper.java @@ -1,6 +1,5 @@ package ru.gravit.utils.helper; -import ru.gravit.launcher.Launcher; import ru.gravit.launcher.LauncherAPI; import javax.imageio.ImageIO; @@ -10,8 +9,8 @@ import java.net.*; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import java.nio.file.*; import java.nio.file.FileSystem; +import java.nio.file.*; import java.nio.file.attribute.BasicFileAttributes; import java.util.Collections; import java.util.Set; @@ -229,7 +228,7 @@ public static byte[] getResourceBytes(String name) throws IOException { @LauncherAPI public static URL getResourceURL(String name) throws NoSuchFileException { - URL url = Launcher.class.getResource('/' + name); + URL url = IOHelper.class.getResource('/' + name); if (url == null) throw new NoSuchFileException(name); return url;