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 Details

    • DUMMY

      private static final ResourceLocation DUMMY
    • loaderId

      protected final ResourceLocation loaderId
    • visibility

      protected final Map<String,Boolean> visibility
    • allowInlineElements

      protected final boolean allowInlineElements
    • optional

      private boolean optional
  • Constructor Details

    • CustomLoaderBuilder

      protected CustomLoaderBuilder(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(ModelTemplate template, TextureMapping textures, Consumer<com.google.gson.JsonElement> consumer)
      Serializes the given ModelTemplate/TextureMapping pair inline using the provided consumer