Updated Texture Definition Files (markdown)

mikeprimm 2013-11-25 20:13:27 -08:00
parent 6e231a98b2
commit 3db0340205

@ -7,18 +7,18 @@ Texture definition files (the *-texture.txt files) provide three key sets of dat
Over its history, Minecraft has used a number of conventions for defining textures, and has changed these conventions on several occasions (particularly as of 1.5, and again as of 1.6). In order to deal with these differences, a number of definition tokens have been needed.
### Defining Textures For 1.6.x and later
As of Minecraft v1.6.0, most built-in textures consist of a single file found under the assets/minecraft/textures/blocks directory (within the Minecraft client JAR file, or within resource pack ZIP files). For v1.6.x or later Minecraft Forge mods, texture resources are generally found within the given mod file (ZIP or JAR) under assets/<modname>/textures/blocks (where the <modname> is the lower-case representation of the mod name).
As of Minecraft v1.6.0, most built-in textures consist of a single file found under the assets/minecraft/textures/blocks directory (within the Minecraft client JAR file, or within resource pack ZIP files). For v1.6.x or later Minecraft Forge mods, texture resources are generally found within the given mod file (ZIP or JAR) under assets/\<modname\>/textures/blocks (where the \<modname\> is the lower-case representation of the mod name).
To specify the relative path to use for loading textures, the 'texturepath:' line should be included in the texture file. Once set, the given path will be used for loading any textures specified (or, at least, until the next texturepath: line is processed - at which point, its path will be used for additional textures). For example, the texture path for the mod BiomesOPlenty for Minecraft v1.6.x or later would be:
texturepath:assets/biomesoplenty/textures/blocks/
Once the path is specified, texture files needed to render the blocks need to be individually specified, using the 'texture:' line. Each such line is formatted as follows:
texture:id=<texture-id>
texture:id=\<texture-id\>
Where the <texture-id> is both the identifier that will be used to refer to the texture within the definition file, and is the base part of the file name to be used to load the texture file (by appending the <texture-id> to the texturepath, and then appending the '.png' extension - for example, an ID of 'test123' would load the texture resource assets/biomesoplenty/textures/blocks/tes123.png, given the previous texturepath example). If the ID needs to be different from the filename, the full filename can be specified:
texture:id=<texture-id>,filename=<full-filename>
texture:id=\<texture-id\>,filename=\<full-filename\>
For example,
@ -26,22 +26,22 @@ For example,
For cases where a texture file contains more than one texture, the number of textures horizontally (the xcount) and vertically (the ycount) can be specified:
texture:id=<texture-id>,xcount=<xcount>,ycount=<ycount>
texture:id=\<texture-id\>,xcount=\<xcount\>,ycount=\<ycount\>
In this case, the file will be loaded and divided into the grid specified. The individual textures are indexed by a row-ordered index: <column-base-zero> + <xcount>*<row-base-zero> : so, the first texture in the top-left corner of the grid is index 0, the next to the right is 1, etc. until the first one on the next row (which is index *xcount*)). For single texture files (the default), only the index 0 is used.
In this case, the file will be loaded and divided into the grid specified. The individual textures are indexed by a row-ordered index: \<column-base-zero\> + \<xcount\>*\<row-base-zero\> : so, the first texture in the top-left corner of the grid is index 0, the next to the right is 1, etc. until the first one on the next row (which is index *xcount*)). For single texture files (the default), only the index 0 is used.
Some texture files are specially formatted: with textures defined at locations within the file other than a simple grid (for example, the texture files for chests or for players or mobs). In these cases, see [[Special Texture File Types]] for details on the supported types. In these cases, the 'format' attribute is used to define the layout of the file:
texture:id=<texture-id>,format=<file-format>
texture:id=\<texture-id\>,format=\<file-format\>
### Defining Textures For 1.5.x
The textures for Minecraft v1.5.x were handled in a similar way as those of v1.6.x, but with some key differences:
* The vanilla textures were found in the textures/blocks directory within the client JAR (or a texture pack)
* The textures for Minecraft Forge mods were typically found within the mod's ZIP or JAR file in the mods/<modname>/textures/blocks directory
* The textures for Minecraft Forge mods were typically found within the mod's ZIP or JAR file in the mods/\<modname\>/textures/blocks directory
In the case of v1.5.x mods, the 'texturemod:' line can be used to specify the specific name to be used for the texture path (the value of <modname> in 'mods/<modname>/textures/blocks'). If not specified, the <modname> defaults to the name provided in the file's 'modname:' line. So, for v1.5.x style mods, using the line:
In the case of v1.5.x mods, the 'texturemod:' line can be used to specify the specific name to be used for the texture path (the value of \<modname\> in 'mods/<modname>/textures/blocks'). If not specified, the \<modname\> defaults to the name provided in the file's 'modname:' line. So, for v1.5.x style mods, using the line:
texturemod:<modname>
texturemod:\<modname\>
is the equivalent of using the line
@ -57,11 +57,11 @@ Before v1.5.x, there were no consistent conventions used by Minecraft Forge mods
## Texture References
Once needed textures have been loaded, a number of different directives can be used to specify the mapping of textures on to the various surfaces of the blocks defined for the mod. In all cases, the references to a specific texture is done through a combination of the index of the texture within the texture file (always 0 for single texture texture-files) and the value of the 'id' attribute specified in the 'texture:' or 'texturefile:' directive. In general, the format is as follows:
<index>:<texture-id>
\<index\>:\<texture-id\>
On all block definition directives, there is an option to specify a default texture ID to be used for any references that lack the ":<texture-id>" suffix: the 'txtid=' attribute. By specifying the 'txtid=<texture-id>' attribute, a reference to '<index>' becomes equivalent to '<index>:<texture-id>'. Texture index values are limited to values between 0 and 999, inclusively.
On all block definition directives, there is an option to specify a default texture ID to be used for any references that lack the ":\<texture-id\>" suffix: the 'txtid=' attribute. By specifying the 'txtid=\<texture-id\>' attribute, a reference to '\<index\>' becomes equivalent to '\<index\>:\<texture-id\>'. Texture index values are limited to values between 0 and 999, inclusively.
Besides selecting the texture to be used, a texture reference can also specify one of a set of modification functions, which will affect how the texture is processed when being rendered. These modification functions are specified by adding one of a set of special values (all multiples of 1000) to the <index> for the texture. The defined values for these modifiers are:
Besides selecting the texture to be used, a texture reference can also specify one of a set of modification functions, which will affect how the texture is processed when being rendered. These modification functions are specified by adding one of a set of special values (all multiples of 1000) to the \<index\> for the texture. The defined values for these modifiers are:
* 1000 : the texture should be tinted using the biome-based coloring for grass (assets/minecraft/textures/colormap/grass.png in v1.6.x and later)