diff options
Diffstat (limited to 'src/main/java/shcm')
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java | 9 | ||||
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITItem.java | 2 |
2 files changed, 10 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 5971b35..e304e4d 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 @@ -349,6 +349,15 @@ public abstract class CIT { if (packContains.test(pathIdentifier)) return pathIdentifier; } + pathIdentifier = new Identifier(pathIdentifier.getNamespace(), switch (extension) { + case ".png" -> "textures/"; + case ".json" -> "models/"; + + /* UNREACHABLE FAILSAFE */ + default -> ""; + } + path); + if (packContains.test(pathIdentifier)) + return pathIdentifier; } LinkedList<String> pathParts = new LinkedList<>(Arrays.asList(propertyIdentifier.getPath().split("/"))); diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITItem.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITItem.java index f85ec75..278b427 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITItem.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITItem.java @@ -58,7 +58,7 @@ public class CITItem extends CIT { if (assetIdentifier != null) assetIdentifiers.put(null, assetIdentifier); else if (modelProp != null && !modelProp.startsWith("models")) { - assetIdentifier = resolvePath(identifier, "models/" + modelProp, ".json", id -> pack.resourcePack.contains(ResourceType.CLIENT_RESOURCES, id)); + assetIdentifier = resolvePath(identifier, modelProp, ".json", id -> pack.resourcePack.contains(ResourceType.CLIENT_RESOURCES, id)); if (assetIdentifier != null) assetIdentifiers.put(null, assetIdentifier); } |