From 15aee5b18ae592d2042c2684ac8555170f41b473 Mon Sep 17 00:00:00 2001 From: mezz Date: Fri, 7 Apr 2017 16:48:00 -0700 Subject: [PATCH] Skip loading models if there is a fatal mod dependency error (#3772) Close #3768 --- .../java/net/minecraftforge/client/model/ModelLoader.java | 4 ++++ .../net/minecraftforge/fml/client/FMLClientHandler.java | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraftforge/client/model/ModelLoader.java b/src/main/java/net/minecraftforge/client/model/ModelLoader.java index ab33c3d81..1ff76c7c1 100644 --- a/src/main/java/net/minecraftforge/client/model/ModelLoader.java +++ b/src/main/java/net/minecraftforge/client/model/ModelLoader.java @@ -94,6 +94,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidUtil; import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.common.FMLLog; import net.minecraftforge.fml.common.ProgressManager; import net.minecraftforge.fml.common.ProgressManager.ProgressBar; @@ -151,6 +152,9 @@ public final class ModelLoader extends ModelBakery @Override public IRegistry setupModelRegistry() { + if (FMLClientHandler.instance().hasError()) // skip loading models if we're just going to show a fatal error screen + return bakedRegistry; + isLoading = true; loadBlocks(); loadVariantItemModels(); diff --git a/src/main/java/net/minecraftforge/fml/client/FMLClientHandler.java b/src/main/java/net/minecraftforge/fml/client/FMLClientHandler.java index 828811cfc..53611c68b 100644 --- a/src/main/java/net/minecraftforge/fml/client/FMLClientHandler.java +++ b/src/main/java/net/minecraftforge/fml/client/FMLClientHandler.java @@ -333,6 +333,12 @@ public class FMLClientHandler implements IFMLSidedHandler client.displayCrashReport(new CrashReport(message, t)); throw Throwables.propagate(t); } + + public boolean hasError() + { + return modsMissing != null || wrongMC != null || customError != null || dupesFound != null || modSorting != null || j8onlymods != null || multipleModsErrored != null; + } + /** * Called a bit later on during initialization to finish loading mods * Also initializes key bindings @@ -340,7 +346,7 @@ public class FMLClientHandler implements IFMLSidedHandler */ public void finishMinecraftLoading() { - if (modsMissing != null || wrongMC != null || customError!=null || dupesFound!=null || modSorting!=null || j8onlymods!=null || multipleModsErrored !=null) + if (hasError()) { SplashProgress.finish(); return;