Search in sources :

Example 1 with OBJModel

use of net.minecraftforge.client.model.obj.OBJModel in project ImmersiveEngineering by BluSunrize.

the class IEOBJLoader method loadModel.

@Override
public IModel loadModel(ResourceLocation modelLocation) throws Exception {
    ResourceLocation file = new ResourceLocation(modelLocation.getResourceDomain(), modelLocation.getResourcePath());
    if (!cache.containsKey(file)) {
        IModel model = OBJLoader.INSTANCE.loadModel(modelLocation);
        if (model instanceof OBJModel) {
            IEOBJModel ieobj = new IEOBJModel(((OBJModel) model).getMatLib(), file);
            cache.put(modelLocation, ieobj);
        }
    }
    IEOBJModel model = cache.get(file);
    if (model == null)
        return ModelLoaderRegistry.getMissingModel();
    return model;
}
Also used : IModel(net.minecraftforge.client.model.IModel) ResourceLocation(net.minecraft.util.ResourceLocation) OBJModel(net.minecraftforge.client.model.obj.OBJModel)

Aggregations

ResourceLocation (net.minecraft.util.ResourceLocation)1 IModel (net.minecraftforge.client.model.IModel)1 OBJModel (net.minecraftforge.client.model.obj.OBJModel)1