From 26a07e23c4e6ecdab9a507c23f569f729f278d8d Mon Sep 17 00:00:00 2001 From: AlexIIL Date: Sat, 22 Jun 2019 17:27:29 +0100 Subject: [PATCH] Fix Templates blocking other custom models. Currently `TemplateModelVariantProvider.loadModelVariant` will throw `a ModelProviderException` if it doesn't have a model already in the map - however this stops any other mods from providing custom models that are later in their chain. While this behaviour isn't documented (fabric's `ModelVariantProvider` interface doesn't even *mention* `ModelProviderException`) it does say that it should `@return The loaded UnbakedModel, or null if this ModelVariantProvider doesn't handle a specific Identifier` --- .../templates/model/TemplateModelVariantProvider.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/io/github/cottonmc/templates/model/TemplateModelVariantProvider.java b/src/main/java/io/github/cottonmc/templates/model/TemplateModelVariantProvider.java index 2e51f53..6bcf308 100644 --- a/src/main/java/io/github/cottonmc/templates/model/TemplateModelVariantProvider.java +++ b/src/main/java/io/github/cottonmc/templates/model/TemplateModelVariantProvider.java @@ -20,9 +20,7 @@ public class TemplateModelVariantProvider implements ModelVariantProvider { @Override public UnbakedModel loadModelVariant(ModelIdentifier modelId, ModelProviderContext context) throws ModelProviderException { - UnbakedModel variant = variants.get(modelId); - if (variant == null) throw new ModelProviderException("Couldn't find model for ID " + modelId); - return variant; + return variants.get(modelId); } public void registerTemplateModels(Block block, BlockState itemState, Function model) {