aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/mixin/compat/lambdabettergrass/PackParserMixin.java26
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java6
2 files changed, 3 insertions, 29 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/compat/lambdabettergrass/PackParserMixin.java b/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/compat/lambdabettergrass/PackParserMixin.java
deleted file mode 100644
index 69e432c..0000000
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/compat/lambdabettergrass/PackParserMixin.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package shcm.shsupercm.fabric.citresewn.mixin.compat.lambdabettergrass;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.ModifyVariable;
-import shcm.shsupercm.fabric.citresewn.pack.PackParser;
-
-import java.io.IOException;
-
-@SuppressWarnings("UnresolvedMixinReference")
-@Mixin(value = PackParser.class, remap = false)
-public class PackParserMixin {
- @ModifyVariable(method = "loadGlobalProperties(Lnet/minecraft/resource/ResourceManager;Lshcm/shsupercm/fabric/citresewn/pack/GlobalProperties;)Lshcm/shsupercm/fabric/citresewn/pack/GlobalProperties;", at =
- @At(value = "INVOKE", target = "shcm/shsupercm/fabric/citresewn/CITResewn.logErrorLoading(Ljava/lang/String;)V"))
- private static IOException citresewn$compat$lambdabettergrass$muteStacktrace(IOException exception) {
- if (exception.getMessage().contains("lambdabettergrass"))
- return new IOException() {
- @Override
- public void printStackTrace() {
- //no
- }
- };
-
- return exception;
- }
-}
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 9f57760..cd85af1 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java
@@ -17,7 +17,6 @@ import shcm.shsupercm.fabric.citresewn.pack.format.PropertyKey;
import shcm.shsupercm.fabric.citresewn.pack.format.PropertyValue;
import java.io.FileNotFoundException;
-import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@@ -44,9 +43,10 @@ public final class PackParser { private PackParser() {}
for (String root : ROOTS) {
Identifier identifier = new Identifier(namespace, root + "/cit.properties");
try {
- globalProperties.load(pack.getName(), identifier, pack.open(ResourceType.CLIENT_RESOURCES, identifier));
+ if (pack.contains(ResourceType.CLIENT_RESOURCES, identifier))
+ globalProperties.load(pack.getName(), identifier, pack.open(ResourceType.CLIENT_RESOURCES, identifier));
} catch (FileNotFoundException ignored) {
- } catch (IOException e) {
+ } catch (Exception e) {
CITResewn.logErrorLoading("Errored while loading global properties: " + identifier + " from " + pack.getName());
e.printStackTrace();
}