Class ModelBuilder<T extends ModelBuilder<T>>
java.lang.Object
io.github.vampirestudios.vampirelib.api.datagen.builder.ModelBuilder<T>
- Direct Known Subclasses:
BlockModelBuilder,ItemModelBuilder
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedModelBuilder(net.minecraft.resources.ResourceLocation parent) -
Method Summary
Modifier and TypeMethodDescriptionaddDisplay(DisplayBuilder.Position position, DisplayBuilder display) Adds an entry to thedisplayproperty of the model.addElement(ElementBuilder element) Adds an entry to theelementsproperty of the model.addTexture(String key, net.minecraft.resources.ResourceLocation texture) Adds a texture key for this model and associates a texture file with it.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.net.minecraft.data.models.model.ModelTemplateClears all currentDisplayBuilders for this model builder.Clears all currentElementBuilders for this model builder.Clears all current textures and texture keys for this model builder.net.minecraft.data.models.model.TextureMappingremoveDisplay(DisplayBuilder.Position position) Removes a display entry from this model builder.removeTexture(net.minecraft.data.models.model.TextureSlot key) Removes a texture and its key from this model builder.
-
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 aTextureSlotinstance, an optional parent for the key itself can be specified.- Parameters:
key- An instancedTextureSlotto hold the texture for.texture- The namespaced ID of the texture for this key.
-
addTexture
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
Removes a texture and its key from this model builder.- Parameters:
key- The texture key to remove.
-
clearTextures
Clears all current textures and texture keys for this model builder. -
addDisplay
Adds an entry to thedisplayproperty 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- ADisplayBuilder.Positionto 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- ADisplayBuilderto build the required display property from.
-
removeDisplay
Removes a display entry from this model builder.- Parameters:
position- The display position whose entry to remove.
-
clearDisplays
Clears all currentDisplayBuilders for this model builder. -
addElement
Adds an entry to theelementsproperty 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- AnElementBuilderto build an individual entry from.
-
clearElements
Clears all currentElementBuilders for this model builder. -
buildModel
public net.minecraft.data.models.model.ModelTemplate buildModel()- Returns:
- A completed
ModelTemplateto 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
TextureMappingto accompany any models built by this builder or otherwise.
-