diff options
author | SHsuperCM <shsupercm@gmail.com> | 2021-12-31 09:19:22 +0200 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2021-12-31 09:19:22 +0200 |
commit | 31b76bc7de1a7200218f17b5fc5dec35a1218d67 (patch) | |
tree | cd6b74b0e5fd757effabc2c73f7a11ff7fe8f61f /src/main/java/shcm/shsupercm/fabric/citresewn | |
parent | 2faff65ff44deb5042bc95be6926506962775586 (diff) | |
download | CITResewn-31b76bc7de1a7200218f17b5fc5dec35a1218d67.tar.gz CITResewn-31b76bc7de1a7200218f17b5fc5dec35a1218d67.tar.bz2 CITResewn-31b76bc7de1a7200218f17b5fc5dec35a1218d67.zip |
Made textures in CIT json models always use the asset resolver
Fixes #79
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn')
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITItem.java | 10 |
1 files changed, 3 insertions, 7 deletions
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 813b6e0..6bb20fd 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 @@ -301,13 +301,9 @@ public class CITItem extends CIT { ((JsonUnbakedModelAccessor) json).getTextureMap().replaceAll((layer, original) -> { Optional<SpriteIdentifier> left = original.left(); if (left.isPresent()) { - String originalPath = left.get().getTextureId().getPath(); - String[] split = originalPath.split("/"); - if (originalPath.startsWith("./") || (split.length > 2 && split[1].equals("cit"))) { - Identifier resolvedIdentifier = resolvePath(identifier, originalPath, ".png", id -> pack.resourcePack.contains(ResourceType.CLIENT_RESOURCES, id)); - if (resolvedIdentifier != null) - return Either.left(new SpriteIdentifier(left.get().getAtlasId(), new ResewnTextureIdentifier(resolvedIdentifier))); - } + Identifier resolvedIdentifier = resolvePath(identifier, left.get().getTextureId().getPath(), ".png", resourceManager::containsResource); + if (resolvedIdentifier != null) + return Either.left(new SpriteIdentifier(left.get().getAtlasId(), new ResewnTextureIdentifier(resolvedIdentifier))); } return original; }); |