Skip to content

Commit

Permalink
Better prefixing of resources
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Apr 27, 2024
1 parent e8826c9 commit 5ba3c0a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ public static void forMod(Function<String, Path> inJarPathGetter, String modId,
Config.INSTANCE.get().extract().put(modId, defaultExtraction);
}
if (extractionState == Config.ExtractionState.UNEXTRACTED) {
QUEUED_RESOURCES.put("__unextracted_" + modId, (s, type) -> {
QUEUED_RESOURCES.put("unextracted/" + modId, (s, type) -> {
if (defaultResources.stream().noneMatch(f -> Files.exists(f.resolve(type.getDirectory()))))
return null;
return () -> new AutoMetadataPathPackResources(s, "", defaultResources, type);
});
QUEUED_STATIC_RESOURCES.put("__unextracted_" + modId, (s, type) -> {
QUEUED_STATIC_RESOURCES.put("unextracted/" + modId, (s, type) -> {
if (defaultResources.stream().noneMatch(f -> Files.exists(f.resolve(GLOBAL_PREFIX + type.getDirectory()))))
return null;
return () -> new AutoMetadataPathPackResources(s, GLOBAL_PREFIX, defaultResources, type);
Expand Down Expand Up @@ -321,10 +321,10 @@ public static List<Pair<String, Pack.ResourcesSupplier>> getPackResources(PackTy
for (var file : files.toList()) {
if (Files.isDirectory(file)) {
Pack.ResourcesSupplier packResources = wrap(s -> new AutoMetadataPathPackResources(s, "", List.of(file), type));
packs.add(new Pair<>(file.getFileName().toString(), packResources));
packs.add(new Pair<>("directory/"+file.getFileName().toString(), packResources));
} else if (file.getFileName().toString().endsWith(".zip")) {
Pack.ResourcesSupplier packResources = wrap(s -> new AutoMetadataPathPackResources(s, "", List.of(file), type));
packs.add(new Pair<>(file.getFileName().toString(), packResources));
packs.add(new Pair<>("file/"+file.getFileName().toString(), packResources));
}
}
} catch (IOException ignored) {
Expand Down

0 comments on commit 5ba3c0a

Please sign in to comment.