4 Model Definition Files
mikeprimm edited this page 2013-11-26 15:31:54 -08:00

The model definition file for a mod provides the physical shape of custom blocks, when those physical shapes are something other than a simple solid cube. Consequently, if the custom blocks for a mod only consist of simple solid cubes, a model definition file may not be needed for the mod.

In all cases, the models defined in the model definition file provide a set of surfaces, or patches, that textures defined in the Texture Definition Files are rendered upon. Since the textures are defined separately from the models, models for blocks with common shapes can easily be reused (e.g. the model for a stair block can be the same for any type of stair block, as the differences in how these stairs are rendered are only which textures are applied to the model for each different block).

There are a variety of methods for defining models, ranging from very simple to quite complex (up to and including custom rendering code provided by add-on Java classes). As always, the simpler methods also tend to be the more efficient.

Common lines with Texture Definition Files

In general, the 'modname:', 'version:', 'cfgfile:', 'var:' and other module configuration related lines should be consistent between the Model Definition File and its corresponding Texture Definition File. See Common Features for Texture and Model Definition Files for details on these commonly defined lines. Inconsistencies here can lead to problems with rendering (due to textures being applied without a corresponding model) or loading errors (due to models being used without required textures being supplied).

Defining Models