diff options
author | SHsuperCM <shsupercm@gmail.com> | 2022-10-27 15:45:43 +0300 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2022-10-27 17:20:37 +0300 |
commit | a75d755df8e0c551cd40701017018719667ff6eb (patch) | |
tree | cf15d133065ffa864bbe56f1780b0dc9cf40a9f4 /src/main/java/shcm/shsupercm/fabric/citresewn/pack | |
parent | 237adf03cc55b4120330e2fbc4bc4178c0361f2d (diff) | |
download | CITResewn-a75d755df8e0c551cd40701017018719667ff6eb.tar.gz CITResewn-a75d755df8e0c551cd40701017018719667ff6eb.tar.bz2 CITResewn-a75d755df8e0c551cd40701017018719667ff6eb.zip |
22w43a Bandage
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/pack')
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java | 11 |
1 files changed, 5 insertions, 6 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 ffc242f..590f5a0 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java @@ -1,9 +1,6 @@ package shcm.shsupercm.fabric.citresewn.pack; -import net.minecraft.resource.Resource; -import net.minecraft.resource.ResourceManager; -import net.minecraft.resource.ResourcePack; -import net.minecraft.resource.ResourceType; +import net.minecraft.resource.*; import net.minecraft.util.Identifier; import shcm.shsupercm.fabric.citresewn.CITResewn; import shcm.shsupercm.fabric.citresewn.cit.builtin.conditions.core.FallbackCondition; @@ -18,6 +15,7 @@ import shcm.shsupercm.fabric.citresewn.pack.format.PropertyKey; import shcm.shsupercm.fabric.citresewn.pack.format.PropertyValue; import java.io.FileNotFoundException; +import java.io.InputStream; import java.util.*; import java.util.stream.Collectors; @@ -44,8 +42,9 @@ public final class PackParser { private PackParser() {} for (String root : ROOTS) { Identifier identifier = new Identifier(namespace, root + "/cit.properties"); try { - if (pack.contains(ResourceType.CLIENT_RESOURCES, identifier)) - globalProperties.load(pack.getName(), identifier, pack.open(ResourceType.CLIENT_RESOURCES, identifier)); + InputSupplier<InputStream> citPropertiesSupplier = pack.open(ResourceType.CLIENT_RESOURCES, identifier); + if (citPropertiesSupplier != null) + globalProperties.load(pack.getName(), identifier, citPropertiesSupplier.get()); } catch (FileNotFoundException ignored) { } catch (Exception e) { CITResewn.logErrorLoading("Errored while loading global properties: " + identifier + " from " + pack.getName()); |