From 0935c49b8432f80350b4dd6c5a4d29e7626ccff7 Mon Sep 17 00:00:00 2001 From: SHsuperCM Date: Fri, 10 Jun 2022 08:57:05 +0300 Subject: 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> --- .../java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/pack') 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> parseCITs(ResourceManager resourceManager) { List> 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 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; } -- cgit