aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/shcm/shsupercm/fabric/citresewn/pack
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2022-06-10 08:57:05 +0300
committerSHsuperCM <shsupercm@gmail.com>2022-06-10 08:57:05 +0300
commit0935c49b8432f80350b4dd6c5a4d29e7626ccff7 (patch)
treecdea4d92ce25491a64d2cf8c9c43d9fb1c6144b3 /src/main/java/shcm/shsupercm/fabric/citresewn/pack
parentffa0e186440249e1657268d036ec3036974b9fe9 (diff)
downloadCITResewn-0935c49b8432f80350b4dd6c5a4d29e7626ccff7.tar.gz
CITResewn-0935c49b8432f80350b4dd6c5a4d29e7626ccff7.tar.bz2
CITResewn-0935c49b8432f80350b4dd6c5a4d29e7626ccff7.zip
Updated target version to 1.19
Using combined input from PRs #152 and #155 Thank you so much for your help @HarvelsX and @MeeniMc Co-Authored-By: MeeniMc <68366846+MeeniMC@users.noreply.github.com> Co-Authored-By: HarvelsX <90945793+harvelsx@users.noreply.github.com>
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/pack')
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java
index 4b5d23a..7155435 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java
@@ -63,18 +63,19 @@ public final class PackParser { private PackParser() {}
public static List<CIT<?>> parseCITs(ResourceManager resourceManager) {
List<CIT<?>> cits = new ArrayList<>();
- for (String root : ROOTS)
- for (Identifier identifier : resourceManager.findResources(root + "/cit", s -> s.endsWith(".properties"))) {
+ for (String root : ROOTS) {
+ for (Map.Entry<Identifier, Resource> entry : resourceManager.findResources(root + "/cit", s -> s.getPath().endsWith(".properties")).entrySet()) {
String packName = null;
- try (Resource resource = resourceManager.getResource(identifier)) {
- cits.add(parseCIT(PropertyGroup.tryParseGroup(packName = resource.getResourcePackName(), identifier, resource.getInputStream()), resourceManager));
+ try {
+ cits.add(parseCIT(PropertyGroup.tryParseGroup(packName = entry.getValue().getResourcePackName(), entry.getKey(), entry.getValue().getInputStream()), resourceManager));
} catch (CITParsingException e) {
CITResewn.logErrorLoading(e.getMessage());
} catch (Exception e) {
- CITResewn.logErrorLoading("Errored while loading cit: " + identifier + (packName == null ? "" : " from " + packName));
+ CITResewn.logErrorLoading("Errored while loading cit: " + entry.getKey() + (packName == null ? "" : " from " + packName));
e.printStackTrace();
}
}
+ }
return cits;
}