aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2021-09-18 18:03:51 +0300
committerSHsuperCM <shsupercm@gmail.com>2021-09-18 18:03:51 +0300
commit78eeb659b0580880fd0de77d12809af35f63f6fb (patch)
treea22d398dd80d697d18a78554ca3d0df5f5e7318f /src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits
parentaaec51a9d15390e911cb93ef2efba9c677821b6e (diff)
downloadCITResewn-78eeb659b0580880fd0de77d12809af35f63f6fb.tar.gz
CITResewn-78eeb659b0580880fd0de77d12809af35f63f6fb.tar.bz2
CITResewn-78eeb659b0580880fd0de77d12809af35f63f6fb.zip
Fixed texture property being ignored when relative assumed model exists
Fixes #30
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits')
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITItem.java18
1 files changed, 14 insertions, 4 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 650d2d9..c99ba12 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
@@ -52,14 +52,24 @@ public class CITItem extends CIT {
if (this.items.size() == 0)
throw new Exception("CIT must target at least one item type");
+ Identifier assetIdentifier;
+ boolean containsTexture = false;
String modelProp = properties.getProperty("model");
- Identifier assetIdentifier = resolvePath(identifier, modelProp, ".json", id -> pack.resourcePack.contains(ResourceType.CLIENT_RESOURCES, id));
- if (assetIdentifier != null)
- assetIdentifiers.put(null, assetIdentifier);
- else if (modelProp != null && !modelProp.startsWith("models")) {
+ if (modelProp == null)
+ for (Object o : properties.keySet())
+ if (o instanceof String property && (property.startsWith("texture") || property.startsWith("tile"))) {
+ containsTexture = true;
+ break;
+ }
+ if (!containsTexture) {
assetIdentifier = resolvePath(identifier, modelProp, ".json", id -> pack.resourcePack.contains(ResourceType.CLIENT_RESOURCES, id));
if (assetIdentifier != null)
assetIdentifiers.put(null, assetIdentifier);
+ else if (modelProp != null) {
+ assetIdentifier = resolvePath(identifier, modelProp, ".json", id -> pack.resourcePack.contains(ResourceType.CLIENT_RESOURCES, id));
+ if (assetIdentifier != null)
+ assetIdentifiers.put(null, assetIdentifier);
+ }
}
for (Object o : properties.keySet())