Skip to content

Commit

Permalink
Fix detecting assets dir for 13w24a+
Browse files Browse the repository at this point in the history
  • Loading branch information
Moresteck committed Oct 25, 2024
1 parent b56b5fa commit 9d36ba7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main/java/uk/betacraft/legacyfix/util/AssetUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,15 @@ public static long getAssetSizeFromExpectedPath(String path) {

// Used by GameDirPatch
public static boolean isExpectedAssetsDir(String path) {
return new File(LegacyFixLauncher.getGameDir(), "assets").getPath().equals(path);
return getExpectedAssetsDir().getPath().equals(path);
}

public static File getExpectedAssetsDir() {
// 13w16a-13w23b
if (LegacyFixLauncher.hasKey("usesWorkDir"))
return new File(LegacyFixLauncher.getGameDir(), "assets");
else // 13w24a-13w48b
return ASSETS_DIR;
}

// Used by GameDirPatch
Expand All @@ -194,7 +202,7 @@ public static File[] getAssetsAsFileArray() {
List<File> listFiles = new LinkedList<File>();

for (AssetObject asset : assets) {
listFiles.add(new File(new File(LegacyFixLauncher.getGameDir(), "assets"), asset.key));
listFiles.add(new File(getExpectedAssetsDir(), asset.key));
}

return listFiles.toArray(new File[0]);
Expand Down

0 comments on commit 9d36ba7

Please sign in to comment.