From b53bf856e6c5541ef8902e58fe58ca29d4a50703 Mon Sep 17 00:00:00 2001 From: Meredith Espinosa Date: Wed, 19 Jun 2019 18:19:11 -0700 Subject: [PATCH] update loom, make loadModelVariant throw properly --- build.gradle | 10 ++++------ .../templates/model/TemplateModelVariantProvider.java | 4 +++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 42ff60f..59c7231 100755 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { } } dependencies { - classpath "net.fabricmc:fabric-loom:0.2.3-SNAPSHOT" + classpath "net.fabricmc:fabric-loom:0.2.4-SNAPSHOT" } } @@ -30,7 +30,7 @@ if(rootProject.file('private.gradle').exists()) { //Publishing details archivesBaseName = "templates" group = "io.github.cottonmc" -version = "1.0.0+1.14.2" +version = "1.0.1+1.14.2" minecraft { refmapName = 'mixins.templates.refmap.json' @@ -43,12 +43,10 @@ repositories { dependencies { minecraft "com.mojang:minecraft:1.14.2" mappings "net.fabricmc:yarn:1.14.2+build.7" - modCompile "net.fabricmc:fabric-loader:0.4.8+build.154" - modCompile "net.fabricmc.fabric-api:fabric-api:0.3.0+build.185" + modApi "net.fabricmc:fabric-loader:0.4.8+build.154" + modApi "net.fabricmc.fabric-api:fabric-api:0.3.0+build.185" implementation "com.google.code.findbugs:jsr305:3.0.2" - - implementation "blue.endless:jankson:1.1.2" } processResources { 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 6bcf308..2e51f53 100644 --- a/src/main/java/io/github/cottonmc/templates/model/TemplateModelVariantProvider.java +++ b/src/main/java/io/github/cottonmc/templates/model/TemplateModelVariantProvider.java @@ -20,7 +20,9 @@ public class TemplateModelVariantProvider implements ModelVariantProvider { @Override public UnbakedModel loadModelVariant(ModelIdentifier modelId, ModelProviderContext context) throws ModelProviderException { - return variants.get(modelId); + UnbakedModel variant = variants.get(modelId); + if (variant == null) throw new ModelProviderException("Couldn't find model for ID " + modelId); + return variant; } public void registerTemplateModels(Block block, BlockState itemState, Function model) {