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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<ObjGeometry.Settings, ObjGeometry> static ObjLoaderprivate final ResourceManagerprivate final Map<ResourceLocation, ObjMaterialLibrary> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionloadGeometry(ObjGeometry.Settings settings) loadMaterialLibrary(ResourceLocation materialLocation) voidonResourceManagerReload(ResourceManager resourceManager) read(JsonObject jsonObject, JsonDeserializationContext jsonDeserializationContext) Reads an unbaked model from the passed JSON object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getNameMethods inherited from interface net.minecraft.server.packs.resources.ResourceManagerReloadListener
reload
-
Field Details
-
INSTANCE
-
geometryCache
-
materialCache
-
manager
-
-
Constructor Details
-
ObjLoader
public ObjLoader()
-
-
Method Details
-
onResourceManagerReload
- Specified by:
onResourceManagerReloadin interfaceResourceManagerReloadListener
-
read
public ObjModel read(JsonObject jsonObject, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException Description copied from interface:UnbakedModelLoaderReads an unbaked model from the passed JSON object.The
JsonDeserializationContextargument can be used to deserialize types that the system already understands. For example,deserializationContext.deserialize(<sub object>, Transformation.class)to parse a transformation, ordeserializationContext.deserialize(<sub object>, UnbakedModel.class)to parse a nested model. The set of supported types can be found in the declaration ofBlockModel.GSON.- Specified by:
readin interfaceUnbakedModelLoader<ObjModel>- Throws:
JsonParseException
-
loadGeometry
-
loadMaterialLibrary
-