Class CustomLoaderBuilder
java.lang.Object
net.neoforged.neoforge.client.model.generators.template.CustomLoaderBuilder
- Direct Known Subclasses:
CompositeModelBuilder
,ObjModelBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final boolean
private static final net.minecraft.resources.ResourceLocation
protected final net.minecraft.resources.ResourceLocation
private boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CustomLoaderBuilder
(net.minecraft.resources.ResourceLocation loaderId, boolean allowInlineElements) -
Method Summary
Modifier and TypeMethodDescription(package private) final CustomLoaderBuilder
copy()
protected abstract CustomLoaderBuilder
Returns a deep-copy of this builder in order to maintain the immutability nature ofModelTemplate
.optional()
Mark the custom loader as optional for this model to allow it to be loaded through vanilla paths if the loader is not presentprotected static void
serializeNestedTemplate
(net.minecraft.client.data.models.model.ModelTemplate template, net.minecraft.client.data.models.model.TextureMapping textures, Consumer<com.google.gson.JsonElement> consumer) Serializes the givenModelTemplate
/TextureMapping
pair inline using the providedconsumer
com.google.gson.JsonObject
toJson
(com.google.gson.JsonObject json) visibility
(String partName, boolean show)
-
Field Details
-
DUMMY
private static final net.minecraft.resources.ResourceLocation DUMMY -
loaderId
protected final net.minecraft.resources.ResourceLocation loaderId -
visibility
-
allowInlineElements
protected final boolean allowInlineElements -
optional
private boolean optional
-
-
Constructor Details
-
CustomLoaderBuilder
protected CustomLoaderBuilder(net.minecraft.resources.ResourceLocation loaderId, boolean allowInlineElements) - Parameters:
loaderId
- The ID of the associatedUnbakedModelLoader
allowInlineElements
- Whether the loader supports inline vanilla elements and as such can fall back to vanilla loading with some degradation if the loader does not exist and is marked as optional in the model
-
-
Method Details
-
visibility
-
optional
Mark the custom loader as optional for this model to allow it to be loaded through vanilla paths if the loader is not present -
copy
-
copyInternal
Returns a deep-copy of this builder in order to maintain the immutability nature ofModelTemplate
. -
toJson
public com.google.gson.JsonObject toJson(com.google.gson.JsonObject json) -
serializeNestedTemplate
protected static void serializeNestedTemplate(net.minecraft.client.data.models.model.ModelTemplate template, net.minecraft.client.data.models.model.TextureMapping textures, Consumer<com.google.gson.JsonElement> consumer) Serializes the givenModelTemplate
/TextureMapping
pair inline using the providedconsumer
-