Class ModelBuilder<T extends ModelBuilder<T>>

java.lang.Object
io.github.vampirestudios.vampirelib.api.datagen.builder.ModelBuilder<T>
Direct Known Subclasses:
BlockModelBuilder, ItemModelBuilder

public abstract class ModelBuilder<T extends ModelBuilder<T>> extends Object
  • Constructor Details

    • ModelBuilder

      @Internal protected ModelBuilder(net.minecraft.resources.ResourceLocation parent)
  • Method Details

    • addTexture

      public T addTexture(net.minecraft.data.models.model.TextureSlot key, net.minecraft.resources.ResourceLocation texture)
      Adds a texture key for this model and associates a texture file with it. If the key already exists for this builder, its texture will simply be replaced. If using a TextureSlot instance, an optional parent for the key itself can be specified.
      Parameters:
      key - An instanced TextureSlot to hold the texture for.
      texture - The namespaced ID of the texture for this key.
    • addTexture

      public T addTexture(String key, net.minecraft.resources.ResourceLocation texture)
      Adds a texture key for this model and associates a texture file with it. If the key already exists for this builder, its texture will simply be replaced.
      Parameters:
      key - A key to hold the texture for.
      texture - The namespaced ID of the texture for this key.
    • removeTexture

      public T removeTexture(net.minecraft.data.models.model.TextureSlot key)
      Removes a texture and its key from this model builder.
      Parameters:
      key - The texture key to remove.
    • clearTextures

      public T clearTextures()
      Clears all current textures and texture keys for this model builder.
    • addDisplay

      public T addDisplay(DisplayBuilder.Position position, DisplayBuilder display)
      Adds an entry to the display property of the model. Display entries consist of a linear transformation (translation, rotation and scaling) applied to a given "position" that the item (or BlockItem) with the given model may be in, e.g. whether it's being displayed in a player's hand or in a GUI.
      Parameters:
      position - A DisplayBuilder.Position to set the property for. Can be either hand of either first or third person, the head, the ground (as a dropped item), within GUIs or within item frames (FIXED).
      display - A DisplayBuilder to build the required display property from.
    • removeDisplay

      public T removeDisplay(DisplayBuilder.Position position)
      Removes a display entry from this model builder.
      Parameters:
      position - The display position whose entry to remove.
    • clearDisplays

      public T clearDisplays()
      Clears all current DisplayBuilders for this model builder.
    • addElement

      public T addElement(ElementBuilder element)
      Adds an entry to the elements property of the model. Element entries consist of a pair of opposite vertices of a cuboid to draw the element out as, with an optional rotation, shading and set of rendered faces.
      Parameters:
      element - An ElementBuilder to build an individual entry from.
    • clearElements

      public T clearElements()
      Clears all current ElementBuilders for this model builder.
    • buildModel

      public net.minecraft.data.models.model.ModelTemplate buildModel()
      Returns:
      A completed ModelTemplate to generate alongside some texture map, which may or may not also be provided via this builder.
    • mapTextures

      public net.minecraft.data.models.model.TextureMapping mapTextures()
      Returns:
      A completed TextureMapping to accompany any models built by this builder or otherwise.