Skip to content

Commit

Permalink
Modpack overrides will now override old overrides, even if they were …
Browse files Browse the repository at this point in the history
…modified
  • Loading branch information
FlowArg committed Nov 24, 2023
1 parent e3e6438 commit 0e50726
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'maven-publish'
apply plugin: 'signing'

group 'fr.flowarg'
version '1.8.2'
version '1.8.3'
archivesBaseName = "flowupdater"

java {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fr/flowarg/flowupdater/FlowUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
public class FlowUpdater
{
/** FlowUpdater's version string constant */
public static final String FU_VERSION = "1.8.1";
public static final String FU_VERSION = "1.8.3";

/** Vanilla version's object to update/install */
private final VanillaVersion vanillaVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class CurseForgeIntegration extends Integration
private static final String CF_API_KEY = "JDJhJDEwJHBFZjhacXFwWE4zbVdtLm5aZ2pBMC5kdm9ibnhlV3hQZWZma2Q5ZEhCRWFid2VaUWh2cUtpJDJhJ";
private static final String MOD_FILE_ENDPOINT = "/v1/mods/{modId}/files/{fileId}";

private boolean changed = false;
private boolean manifestChanged = false;

/**
* Default constructor of a basic Integration.
Expand Down Expand Up @@ -179,7 +179,7 @@ private void extractModPack(@NotNull Path out, boolean installExtFiles) throws E
{
if(Files.notExists(flPath) || entry.getCrc() != FileUtils.getCRC32(flPath))
{
this.changed = true;
this.manifestChanged = true;
this.transferAndClose(flPath, zipFile, entry);
}
continue;
Expand All @@ -188,7 +188,7 @@ private void extractModPack(@NotNull Path out, boolean installExtFiles) throws E
if(entryName.equals("modlist.html"))
continue;

if(!installExtFiles || Files.exists(flPath)) continue;
if(!installExtFiles || (Files.exists(flPath) && entry.getCrc() == FileUtils.getCRC32(flPath))) continue;

if (flPath.getFileName().toString().endsWith(flPath.getFileSystem().getSeparator()))
Files.createDirectories(flPath);
Expand Down Expand Up @@ -237,7 +237,7 @@ private void extractModPack(@NotNull Path out, boolean installExtFiles) throws E

String json = StringUtils.toString(Files.readAllLines(cachePath, StandardCharsets.UTF_8));

if(this.changed || json.contains("\"md5\"") || json.contains("\"length\""))
if(this.manifestChanged || json.contains("\"md5\"") || json.contains("\"length\""))
{
Files.delete(cachePath);
Files.createFile(cachePath);
Expand Down

0 comments on commit 0e50726

Please sign in to comment.