diff options
author | SHsuperCM <shsupercm@gmail.com> | 2021-09-14 05:33:12 +0300 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2021-09-14 05:33:12 +0300 |
commit | 7ffce90fc701a653c50d857316b57f989552ea07 (patch) | |
tree | cb67f446569011e2b59c8a20b27bcc29ca865144 /src/main/java/shcm | |
parent | 87e4e3cdbab3c0da7dedd1c8254e992619304f23 (diff) | |
download | CITResewn-7ffce90fc701a653c50d857316b57f989552ea07.tar.gz CITResewn-7ffce90fc701a653c50d857316b57f989552ea07.tar.bz2 CITResewn-7ffce90fc701a653c50d857316b57f989552ea07.zip |
Fixed empty asset resolution ignoring double extension
Diffstat (limited to 'src/main/java/shcm')
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java | 5 |
1 files changed, 4 insertions, 1 deletions
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<Identifier> 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; } |