diff --git a/src/main/java/net/minecraftforge/client/model/obj/OBJLoader.java b/src/main/java/net/minecraftforge/client/model/obj/OBJLoader.java index a2329ab4cd..d669986831 100644 --- a/src/main/java/net/minecraftforge/client/model/obj/OBJLoader.java +++ b/src/main/java/net/minecraftforge/client/model/obj/OBJLoader.java @@ -30,6 +30,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.IModelLoader; import javax.annotation.Nullable; +import java.io.FileNotFoundException; import java.io.IOException; import java.util.*; @@ -71,20 +72,16 @@ public class OBJLoader implements IModelLoader public OBJModel loadModel(OBJModel.ModelSettings settings) { return modelCache.computeIfAbsent(settings, (data) -> { - IResource resource; - try - { - resource = manager.getResource(settings.modelLocation); - } - catch (IOException e) - { - throw new RuntimeException("Could not find OBJ model", e); - } - try(LineReader rdr = new LineReader(resource)) + try(IResource resource = manager.getResource(settings.modelLocation); + LineReader rdr = new LineReader(resource)) { return new OBJModel(rdr, settings); } + catch (FileNotFoundException e) + { + throw new RuntimeException("Could not find OBJ model", e); + } catch (Exception e) { throw new RuntimeException("Could not read OBJ model", e); @@ -95,20 +92,15 @@ public class OBJLoader implements IModelLoader public MaterialLibrary loadMaterialLibrary(ResourceLocation materialLocation) { return materialCache.computeIfAbsent(materialLocation, (location) -> { - IResource resource; - try - { - resource = manager.getResource(location); - } - catch (IOException e) - { - throw new RuntimeException("Could not find OBJ material library", e); - } - - try(LineReader rdr = new LineReader(resource)) + try(IResource resource = manager.getResource(location); + LineReader rdr = new LineReader(resource)) { return new MaterialLibrary(rdr); } + catch (FileNotFoundException e) + { + throw new RuntimeException("Could not find OBJ material library", e); + } catch (Exception e) { throw new RuntimeException("Could not read OBJ material library", e);