From 7ffce90fc701a653c50d857316b57f989552ea07 Mon Sep 17 00:00:00 2001 From: SHsuperCM Date: Tue, 14 Sep 2021 05:33:12 +0300 Subject: Fixed empty asset resolution ignoring double extension --- src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/shcm/shsupercm/fabric') diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java index 98e94f6..3e8fca0 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java @@ -323,7 +323,10 @@ public abstract class CIT { */ public static Identifier resolvePath(Identifier propertyIdentifier, String path, String extension, Predicate packContains) { if (path == null) { - Identifier pathIdentifier = new Identifier(propertyIdentifier.getNamespace(), propertyIdentifier.getPath().replace(".properties", extension)); + path = propertyIdentifier.getPath().substring(0, propertyIdentifier.getPath().length() - 11); + if (!path.endsWith(extension)) + path = path + extension; + Identifier pathIdentifier = new Identifier(propertyIdentifier.getNamespace(), path); return packContains.test(pathIdentifier) ? pathIdentifier : null; } -- cgit