aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ModelLoaderMixin.java
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2021-09-03 10:10:18 +0300
committerSHsuperCM <shsupercm@gmail.com>2021-09-03 10:10:18 +0300
commit8fc272f9596b37e71bf4ff70f5d784a76bdef143 (patch)
treec5abc3158d773ffc94d5c4b79e3423e36d67b491 /src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ModelLoaderMixin.java
parentec20dec8b923ac6fa4c794d4ab2242552b8fc2e7 (diff)
downloadCITResewn-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.java4
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));
}