aboutsummaryrefslogtreecommitdiff
path: root/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/SupplyFakeModelPatch.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/texturePacks/java/moe/nea/firmament/mixins/custommodels/SupplyFakeModelPatch.java')
-rw-r--r--src/texturePacks/java/moe/nea/firmament/mixins/custommodels/SupplyFakeModelPatch.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/SupplyFakeModelPatch.java b/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/SupplyFakeModelPatch.java
index 3b5fbd0..850ea53 100644
--- a/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/SupplyFakeModelPatch.java
+++ b/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/SupplyFakeModelPatch.java
@@ -48,13 +48,13 @@ public class SupplyFakeModelPatch {
Map<Identifier, ItemAsset> newModels = new HashMap<>(oldModels.contents());
var resources = resourceManager.findResources(
"models/item",
- id -> id.getNamespace().equals("firmskyblock")
- && id.getPath().endsWith(".json")
- && !id.getPath().substring("models/item/".length()).contains("/"));
+ id -> (id.getNamespace().equals("firmskyblock") || id.getNamespace().equals("cittofirmgenerated"))
+ && id.getPath().endsWith(".json"));
for (Map.Entry<Identifier, Resource> model : resources.entrySet()) {
var resource = model.getValue();
var itemModelId = model.getKey().withPath(it -> it.substring("models/item/".length(), it.length() - ".json".length()));
var genericModelId = itemModelId.withPrefixedPath("item/");
+ var itemAssetId = itemModelId.withPrefixedPath("items/");
// TODO: inject tint indexes based on the json data here
ItemModel.Unbaked unbakedModel = new BasicItemModel.Unbaked(genericModelId, List.of());
// TODO: add a filter using the pack.mcmeta to opt out of this behaviour
@@ -64,7 +64,7 @@ public class SupplyFakeModelPatch {
} catch (Exception e) {
ErrorUtil.INSTANCE.softError("Could not create resource for fake model supplication: " + model.getKey(), e);
}
- if (resourceManager.getResource(itemModelId)
+ if (resourceManager.getResource(itemAssetId.withSuffixedPath(".json"))
.map(Resource::getPack)
.map(it -> isResourcePackNewer(resourceManager, it, resource.getPack()))
.orElse(true)) {
@@ -83,7 +83,7 @@ public class SupplyFakeModelPatch {
var pack = manager.streamResourcePacks()
.filter(it -> it == null_ || it == proposal)
.collect(findLast());
- return pack.orElse(null) == proposal;
+ return pack.orElse(null_) != null_;
}
private static <T> Collector<T, ?, Optional<T>> findLast() {