Model

data class Model(val parent: ResourcePath? = null, val textures: Map<String, String> = emptyMap(), val elements: List<Model.Element>? = null, val ambientOcclusion: Boolean? = null, val guiLight: Model.GuiLight? = null, val display: Map<Model.Display.Position, Model.Display> = emptyMap(), val overrides: List<Model.Override> = emptyList())

A Minecraft model.

Parameters

parent

The path to the parent model or null if there is no parent.

textures

A map of texture names to texture paths.

elements

A list of voxels that make up the model.

ambientOcclusion

(Only relevant for block models) Whether ambient occlusion is enabled for the model.

guiLight

(Only relevant for item models) The direction of the light for the item model in the GUI.

display

(Only relevant for item models) A map of display positions to display settings.

overrides

(Only relevant for item models) A list of overrides for the item model. Every override has one or more predicates that determine whether the override model should be used.

Constructors

Link copied to clipboard
constructor(parent: ResourcePath? = null, textures: Map<String, String> = emptyMap(), elements: List<Model.Element>? = null, ambientOcclusion: Boolean? = null, guiLight: Model.GuiLight? = null, display: Map<Model.Display.Position, Model.Display> = emptyMap(), overrides: List<Model.Override> = emptyList())

Types

Link copied to clipboard

An axis in 3D space.

Link copied to clipboard

A direction in 3D space.

Link copied to clipboard
data class Display(val rotation: Vector3dc, val translation: Vector3dc, val scale: Vector3dc)

The display settings for an item model.

Link copied to clipboard
data class Element(val from: Vector3dc, val to: Vector3dc, val rotation: Model.Element.Rotation?, val faces: Map<Model.Direction, Model.Element.Face>, val shade: Boolean)

A voxel of a Model.

Link copied to clipboard

Specifies the direction of the light for the item model in the GUI.

Link copied to clipboard
data class Override(val predicate: Map<String, Number>, val model: ResourcePath)

Determines a case in which a different model should be used based on the given predicate.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val parent: ResourcePath? = null
Link copied to clipboard

Functions

Link copied to clipboard

Creates a flattened copy of this model using the given context to resolve parent models.

Link copied to clipboard
fun getBounds(context: ModelContent?): AABBd

Gets the bounds of this model's elements. Uses context to resolve parent models.