From 863b84db346770fc36847ffa0a71e44679fc6bea Mon Sep 17 00:00:00 2001 From: SHsuperCM Date: Tue, 14 Sep 2021 05:44:48 +0300 Subject: Fixed absolute paths not working when set from resourcepack root Fixes #20 --- src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/java/shcm/shsupercm') 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 3e8fca0..e306cbe 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 @@ -342,6 +342,13 @@ public abstract class CIT { pathIdentifier = new Identifier(pathIdentifier.getNamespace(), path); if (packContains.test(pathIdentifier)) return pathIdentifier; + else if (path.startsWith("assets/")) { + path = path.substring(7); + int sep = path.indexOf('/'); + pathIdentifier = new Identifier(path.substring(0, sep), path.substring(sep + 1)); + if (packContains.test(pathIdentifier)) + return pathIdentifier; + } } LinkedList pathParts = new LinkedList<>(Arrays.asList(propertyIdentifier.getPath().split("/"))); -- cgit