diff --git a/src/main/java/net/aoqia/loom/task/launch/GenerateDLIConfigTask.java b/src/main/java/net/aoqia/loom/task/launch/GenerateDLIConfigTask.java index 417e37521..924f52a10 100644 --- a/src/main/java/net/aoqia/loom/task/launch/GenerateDLIConfigTask.java +++ b/src/main/java/net/aoqia/loom/task/launch/GenerateDLIConfigTask.java @@ -65,7 +65,6 @@ public GenerateDLIConfigTask() { getCommonGameJarPath().set(getGameJarPath("common")); } - getClientInstallPath().set(new File(getExtension().getFiles().getUserCache(), "assets").getAbsolutePath()); getNativesDirectoryPath() .set(getExtension().getFiles().getNativesDirectory(getProject()).getAbsolutePath()); getDevLauncherConfig().set(getExtension().getFiles().getDevLauncherConfig()); @@ -80,35 +79,38 @@ public GenerateDLIConfigTask() { @Input protected abstract Property getSplitSourceSets(); - @Input - protected abstract Property getPlainConsole(); - @Input protected abstract Property getANSISupportedIDE(); - @Input - @Optional - protected abstract Property getClassPathGroups(); - - @Input - protected abstract Property getLog4jConfigPaths(); + private static boolean ansiSupportedIde(Project project) { + File rootDir = project.getRootDir(); + return new File(rootDir, ".vscode").exists() + || new File(rootDir, ".idea").exists() + || new File(rootDir, ".project").exists() + || (Arrays.stream(rootDir.listFiles()) + .anyMatch(file -> file.getName().endsWith(".iws"))); + } @Input - @Optional - protected abstract Property getClientGameJarPath(); + protected abstract Property getPlainConsole(); @Input @Optional - protected abstract Property getCommonGameJarPath(); + protected abstract Property getClassPathGroups(); - @Input - protected abstract Property getClientInstallPath(); + /** + * See: https://github.com/FabricMC/fabric-loader/pull/585. + */ + private static String buildClassPathGroups(Project project) { + return LoomGradleExtension.get(project).getMods().stream() + .map(modSettings -> SourceSetHelper.getClasspath(modSettings, project).stream() + .map(File::getAbsolutePath) + .collect(Collectors.joining(File.pathSeparator))) + .collect(Collectors.joining(File.pathSeparator + File.pathSeparator)); + } @Input - protected abstract Property getNativesDirectoryPath(); - - @OutputFile - protected abstract RegularFileProperty getDevLauncherConfig(); + protected abstract Property getLog4jConfigPaths(); private static String getAllLog4JConfigFiles(Project project) { return LoomGradleExtension.get(project).getLog4jConfigs().getFiles().stream() @@ -116,6 +118,10 @@ private static String getAllLog4JConfigFiles(Project project) { .collect(Collectors.joining(",")); } + @Input + @Optional + protected abstract Property getClientGameJarPath(); + private String getGameJarPath(String env) { MappedZomboidProvider.Split split = (MappedZomboidProvider.Split) getExtension().getNamedZomboidProvider(); @@ -127,28 +133,15 @@ private String getGameJarPath(String env) { }; } - /** - * See: https://github.com/FabricMC/fabric-loader/pull/585. - */ - private static String buildClassPathGroups(Project project) { - return LoomGradleExtension.get(project).getMods().stream() - .map(modSettings -> SourceSetHelper.getClasspath(modSettings, project).stream() - .map(File::getAbsolutePath) - .collect(Collectors.joining(File.pathSeparator))) - .collect(Collectors.joining(File.pathSeparator + File.pathSeparator)); - } - - private static boolean ansiSupportedIde(Project project) { - File rootDir = project.getRootDir(); - return new File(rootDir, ".vscode").exists() - || new File(rootDir, ".idea").exists() - || new File(rootDir, ".project").exists() - || (Arrays.stream(rootDir.listFiles()) - .anyMatch(file -> file.getName().endsWith(".iws"))); - } + @Input + @Optional + protected abstract Property getCommonGameJarPath(); @Input - protected abstract Property getServerInstallPath(); + protected abstract Property getNativesDirectoryPath(); + + @OutputFile + protected abstract RegularFileProperty getDevLauncherConfig(); @TaskAction public void run() throws IOException {