From ec20dec8b923ac6fa4c794d4ab2242552b8fc2e7 Mon Sep 17 00:00:00 2001 From: SHsuperCM Date: Thu, 2 Sep 2021 18:19:35 +0300 Subject: v0.4.4: Fixed literal model paths not loading if "models" prefix is not specified Fixes #7 --- .../java/shcm/shsupercm/fabric/citresewn/pack/cits/CITItem.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main/java/shcm/shsupercm/fabric') 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 280e8c1..397f4a6 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 @@ -43,9 +43,15 @@ public class CITItem extends CIT { if (this.items.size() == 0) throw new Exception("CIT must target at least one item type"); - Identifier assetIdentifier = resolvePath(identifier, properties.getProperty("model"), ".json", pack.resourcePack); + String modelProp = properties.getProperty("model"); + Identifier assetIdentifier = resolvePath(identifier, modelProp, ".json", pack.resourcePack); if (assetIdentifier != null) assetIdentifiers.put(null, assetIdentifier); + else if (modelProp != null && !modelProp.startsWith("models")) { + assetIdentifier = resolvePath(identifier, "models/" + modelProp, ".json", pack.resourcePack); + if (assetIdentifier != null) + assetIdentifiers.put(null, assetIdentifier); + } for (Object o : properties.keySet()) if (o instanceof String property && property.startsWith("model.")) { -- cgit