Skip to content

Commit

Permalink
Add the Minecraft version as a cache input to the download assets task.
Browse files Browse the repository at this point in the history
This fixes an issue where the assets index would not be generated when the minecraft version changes without the assets changing.
  • Loading branch information
modmuss50 committed Aug 5, 2022
1 parent c4240ef commit 305b480
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/net/fabricmc/loom/task/DownloadAssetsTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public abstract class DownloadAssetsTask extends AbstractLoomTask {
@Input
public abstract Property<String> getAssetsHash();

@Input
public abstract Property<String> getMinecraftVersion();

@OutputDirectory
public abstract RegularFileProperty getAssetsDirectory();

Expand All @@ -74,6 +77,8 @@ public DownloadAssetsTask() {

getAssetsDirectory().set(assetsDir);
getAssetsHash().set(versionInfo.assetIndex().sha1());
getMinecraftVersion().set(versionInfo.id());
getMinecraftVersion().finalizeValue();

if (versionInfo.assets().equals("legacy")) {
getLegacyResourcesDirectory().set(new File(assetsDir, "/legacy/" + versionInfo.id()));
Expand Down

0 comments on commit 305b480

Please sign in to comment.