Add the Minecraft version as a cache input to the download assets task.

This fixes an issue where the assets index would not be generated when the minecraft version changes without the assets changing.
This commit is contained in:
modmuss50
2022-08-05 15:43:20 +01:00
parent d0f63cf652
commit 3dc18a32d4

View File

@@ -55,6 +55,9 @@ public abstract class DownloadAssetsTask extends AbstractLoomTask {
@Input
public abstract Property<Integer> getDownloadThreads();
@Input
public abstract Property<String> getMinecraftVersion();
@OutputDirectory
public abstract RegularFileProperty getAssetsDirectory();
@@ -69,6 +72,8 @@ public abstract class DownloadAssetsTask extends AbstractLoomTask {
getAssetsDirectory().set(assetsDir);
getAssetsHash().set(versionInfo.assetIndex().sha1());
getDownloadThreads().convention(Runtime.getRuntime().availableProcessors());
getMinecraftVersion().set(versionInfo.id());
getMinecraftVersion().finalizeValue();
if (versionInfo.assets().equals("legacy")) {
getLegacyResourcesDirectory().set(new File(assetsDir, "/legacy/" + versionInfo.id()));