Class ObjLoader

java.lang.Object
net.neoforged.neoforge.client.model.obj.ObjLoader
All Implemented Interfaces:
PreparableReloadListener, ResourceManagerReloadListener, UnbakedModelLoader<ObjModel>

public class ObjLoader extends Object implements UnbakedModelLoader<ObjModel>, ResourceManagerReloadListener
A loader for OBJ models.

Allows the user to enable automatic face culling, toggle quad shading, flip UVs, render emissively and specify a material library override.

  • Field Details

  • Constructor Details

    • ObjLoader

      public ObjLoader()
  • Method Details

    • onResourceManagerReload

      public void onResourceManagerReload(ResourceManager resourceManager)
      Specified by:
      onResourceManagerReload in interface ResourceManagerReloadListener
    • read

      public ObjModel read(com.google.gson.JsonObject jsonObject, com.google.gson.JsonDeserializationContext jsonDeserializationContext) throws com.google.gson.JsonParseException
      Description copied from interface: UnbakedModelLoader
      Reads an unbaked model from the passed JSON object.

      The JsonDeserializationContext argument can be used to deserialize types that the system already understands. For example, deserializationContext.deserialize(<sub object>, Transformation.class) to parse a transformation, or deserializationContext.deserialize(<sub object>, UnbakedModel.class) to parse a nested model. The set of supported types can be found in the declaration of BlockModel.GSON.

      Specified by:
      read in interface UnbakedModelLoader<ObjModel>
      Throws:
      com.google.gson.JsonParseException
    • loadGeometry

      public ObjGeometry loadGeometry(ObjGeometry.Settings settings)
    • loadMaterialLibrary

      public ObjMaterialLibrary loadMaterialLibrary(ResourceLocation materialLocation)