Skip to content

Commit

Permalink
Fix changing patch version not affecting mapped game jars
Browse files Browse the repository at this point in the history
Fixes #167.
  • Loading branch information
Juuxel committed Nov 16, 2023
1 parent cedc76e commit 7a1adf4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ public void remapJar() throws Exception {
fillClientExtraJar();
}

this.dirty = false;
DependencyProvider.addDependency(project, minecraftClientExtra, Constants.Configurations.FORGE_EXTRA);
}

Expand Down Expand Up @@ -595,6 +594,13 @@ public Path getMinecraftPatchedJar() {
return minecraftPatchedJar;
}

/**
* Checks whether the provider's state is dirty (regenerating jars).
*/
public boolean isDirty() {
return dirty;
}

public enum Type {
CLIENT_ONLY("client", "client", (patch, userdev) -> patch.clientPatches),
SERVER_ONLY("server", "server", (patch, userdev) -> patch.serverPatches),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import net.fabricmc.loom.build.IntermediaryNamespaces;
import net.fabricmc.loom.configuration.ConfigContext;
import net.fabricmc.loom.configuration.mods.dependency.LocalMavenHelper;
import net.fabricmc.loom.configuration.providers.forge.minecraft.ForgeMinecraftProvider;
import net.fabricmc.loom.configuration.providers.mappings.IntermediaryMappingsProvider;
import net.fabricmc.loom.configuration.providers.mappings.MappingConfiguration;
import net.fabricmc.loom.configuration.providers.mappings.TinyMappingsService;
Expand Down Expand Up @@ -178,6 +179,11 @@ private boolean areOutputsValid(List<RemappedJars> remappedJars) {
}
}

// Architectury: regenerate jars if patches have changed.
if (minecraftProvider instanceof ForgeMinecraftProvider withForge && withForge.getPatchedProvider().isDirty()) {
return false;
}

return true;
}

Expand Down

0 comments on commit 7a1adf4

Please sign in to comment.