diff options
author | SHsuperCM <shsupercm@gmail.com> | 2021-09-03 10:10:18 +0300 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2021-09-03 10:10:18 +0300 |
commit | 8fc272f9596b37e71bf4ff70f5d784a76bdef143 (patch) | |
tree | c5abc3158d773ffc94d5c4b79e3423e36d67b491 /src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ModelLoaderMixin.java | |
parent | ec20dec8b923ac6fa4c794d4ab2242552b8fc2e7 (diff) | |
download | CITResewn-8fc272f9596b37e71bf4ff70f5d784a76bdef143.tar.gz CITResewn-8fc272f9596b37e71bf4ff70f5d784a76bdef143.tar.bz2 CITResewn-8fc272f9596b37e71bf4ff70f5d784a76bdef143.zip |
Fixed path resolution not properly working in sub models
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ModelLoaderMixin.java')
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ModelLoaderMixin.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ModelLoaderMixin.java b/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ModelLoaderMixin.java index 78e1a69..e01aec8 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ModelLoaderMixin.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ModelLoaderMixin.java @@ -139,7 +139,7 @@ public abstract class ModelLoaderMixin { String originalPath = left.get().getTextureId().getPath(); String[] split = originalPath.split("/"); if (originalPath.startsWith("./") || (split.length > 2 && split[1].equals("cit"))) { - Identifier resolvedIdentifier = CIT.resolvePath(id, originalPath, ".png", null); + Identifier resolvedIdentifier = CIT.resolvePath(id, originalPath, ".png", identifier -> resourceManager.containsResource(identifier)); if (resolvedIdentifier != null) return Either.left(new SpriteIdentifier(left.get().getAtlasId(), new ResewnTextureIdentifier(resolvedIdentifier))); } @@ -151,7 +151,7 @@ public abstract class ModelLoaderMixin { if (parentId != null) { String[] parentIdPathSplit = parentId.getPath().split("/"); if (parentId.getPath().startsWith("./") || (parentIdPathSplit.length > 2 && parentIdPathSplit[1].equals("cit"))) { - parentId = CIT.resolvePath(id, parentId.getPath(), ".json", null); + parentId = CIT.resolvePath(id, parentId.getPath(), ".json", identifier -> resourceManager.containsResource(identifier)); if (parentId != null) ((JsonUnbakedModelAccessor) json).setParentId(new ResewnItemModelIdentifier(parentId)); } |