From 82938fe8d42d5107e1e6ca0cadb220d5f0ae84ad Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sun, 16 Jul 2023 13:36:45 +0700 Subject: [PATCH] [FIX] Remove old style assets folder --- .../command/hash/DownloadClientCommand.java | 2 +- .../command/hash/MakeProfileCommand.java | 2 +- .../launchserver/helper/MakeProfileHelper.java | 15 ++------------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadClientCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadClientCommand.java index 09922041..43f147d0 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadClientCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadClientCommand.java @@ -86,7 +86,7 @@ public void invoke(String... args) throws IOException, CommandException { if (version.compareTo(ClientProfileVersions.MINECRAFT_1_7_10) <= 0) { logger.warn("Minecraft 1.7.9 and below not supported. Use at your own risk"); } - MakeProfileHelper.MakeProfileOption[] options = MakeProfileHelper.getMakeProfileOptionsFromDir(clientDir, version, Files.exists(server.updatesDir.resolve("assets"))); + MakeProfileHelper.MakeProfileOption[] options = MakeProfileHelper.getMakeProfileOptionsFromDir(clientDir, version); for (MakeProfileHelper.MakeProfileOption option : options) { logger.debug("Detected option {}", option.getClass().getSimpleName()); } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/MakeProfileCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/MakeProfileCommand.java index 98997e04..476024f9 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/MakeProfileCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/MakeProfileCommand.java @@ -33,7 +33,7 @@ public String getUsageDescription() { public void invoke(String... args) throws Exception { verifyArgs(args, 3); ClientProfile.Version version = parseClientVersion(args[1]); - MakeProfileHelper.MakeProfileOption[] options = MakeProfileHelper.getMakeProfileOptionsFromDir(server.updatesDir.resolve(args[2]), version, Files.exists(server.updatesDir.resolve("assets"))); + MakeProfileHelper.MakeProfileOption[] options = MakeProfileHelper.getMakeProfileOptionsFromDir(server.updatesDir.resolve(args[2]), version); for (MakeProfileHelper.MakeProfileOption option : options) { logger.info("Detected option {}", option); } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/helper/MakeProfileHelper.java b/LaunchServer/src/main/java/pro/gravit/launchserver/helper/MakeProfileHelper.java index 0491160d..2b4453f5 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/helper/MakeProfileHelper.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/helper/MakeProfileHelper.java @@ -19,11 +19,7 @@ public static ClientProfile makeProfile(ClientProfile.Version version, String ti ClientProfileBuilder builder = new ClientProfileBuilder(); builder.setVersion(version); builder.setDir(title); - if (findOption(options, MakeProfileOptionGlobalAssets.class).isPresent()) { - builder.setAssetDir("assets"); - } else { - builder.setAssetDir("asset" + version.toCleanString()); - } + builder.setAssetDir("assets"); builder.setAssetIndex(version.toString()); builder.setInfo("Server description"); builder.setTitle(title); @@ -209,7 +205,7 @@ private static String getLog4jVersion(Path dir) throws IOException { return null; } - public static MakeProfileOption[] getMakeProfileOptionsFromDir(Path dir, ClientProfile.Version version, boolean globalAssets) throws IOException { + public static MakeProfileOption[] getMakeProfileOptionsFromDir(Path dir, ClientProfile.Version version) throws IOException { List options = new ArrayList<>(2); if (Files.exists(dir.resolve("forge.jar"))) { options.add(new MakeProfileOptionForge()); @@ -247,9 +243,6 @@ public static MakeProfileOption[] getMakeProfileOptionsFromDir(Path dir, ClientP if (Files.exists(dir.resolve("libraries/forge/launchwrapper-1.12-launcherfixed.jar.jar")) || Files.exists(dir.resolve("libraries/net/minecraft/launchwrapper"))) { options.add(new MakeProfileOptionLaunchWrapper()); } - if (globalAssets) { - options.add(new MakeProfileOptionGlobalAssets()); - } return options.toArray(new MakeProfileOption[0]); } @@ -325,10 +318,6 @@ public static class MakeProfileOptionLaunchWrapper implements MakeProfileOption } - public static class MakeProfileOptionGlobalAssets implements MakeProfileOption { - - } - public static class MakeProfileOptionFabric implements MakeProfileOption { public String jimfsPath; public String guavaPath;