Class CustomLoaderBuilder

java.lang.Object
net.neoforged.neoforge.client.model.generators.template.CustomLoaderBuilder
Direct Known Subclasses:
CompositeModelBuilder, ObjModelBuilder

public abstract class CustomLoaderBuilder extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final boolean
     
    private static final net.minecraft.resources.ResourceLocation
     
    protected final net.minecraft.resources.ResourceLocation
     
    private boolean
     
    protected final Map<String,Boolean>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    CustomLoaderBuilder(net.minecraft.resources.ResourceLocation loaderId, boolean allowInlineElements)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) final CustomLoaderBuilder
     
    protected abstract CustomLoaderBuilder
    Returns a deep-copy of this builder in order to maintain the immutability nature of ModelTemplate.
    Mark the custom loader as optional for this model to allow it to be loaded through vanilla paths if the loader is not present
    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 given ModelTemplate/TextureMapping pair inline using the provided consumer
    com.google.gson.JsonObject
    toJson(com.google.gson.JsonObject json)
     
    visibility(String partName, boolean show)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DUMMY

      private static final net.minecraft.resources.ResourceLocation DUMMY
    • loaderId

      protected final net.minecraft.resources.ResourceLocation loaderId
    • visibility

      protected final Map<String,Boolean> 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 associated UnbakedModelLoader
      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

      public CustomLoaderBuilder visibility(String partName, boolean show)
    • optional

      public CustomLoaderBuilder 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

      final CustomLoaderBuilder copy()
    • copyInternal

      protected abstract CustomLoaderBuilder copyInternal()
      Returns a deep-copy of this builder in order to maintain the immutability nature of ModelTemplate.
    • 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 given ModelTemplate/TextureMapping pair inline using the provided consumer