Skip to content

Texture Definition Files

mikeprimm edited this page Nov 26, 2013 · 11 revisions

Texture definition files (the *-texture.txt files) provide three key sets of data:

  • What texture files are needed, and how they need to be loaded
  • Which textures are applied to each surface of each custom block, along with any modifiers to how those textures are used (e.g. tinting due to biome-specific shading, rotations, layering, etc).
  • In the event that the mod provides custom biomes, additional attributes needed to determine how biome-sensitive textures are rendered can be provided

When texture packs are being used to color the blocks found in the map, it is necessary to describe the mapping of graphical data from the resources within the texture pack to the corresponding surfaces or faces of the blocks. This mapping is done by the texture mappings found in the texture.txt internal resource file (this file can be found in the source code at https://github.com/webbukkit/DynmapCore/blob/master/src/main/resources/texture.txt). Additional or custom texture mappings can be defined in the custom-texture.txt file, which can be found in the renderdata directory. By default the renderdata directory does not exist, and must be created under the plugins/dynmap directory. The format of both files is the same.

As with the models.txt file, the texture files can include comments, marked by a '#' character. Each mapping is defined by a single line, formatted as follows:

block:id=V,data=D,_faceid_=_textureval_,_faceid_=_textureval_,....

Where:

  • id is the block ID associated with the texture mapping. There must be at least one id=V value provided.

  • data is the block data value associated with the texture mapping. If no data=D value is provided, data=* is assumed (all data values). More than one data value can be provided.

  • faceid defines the mapping of one or more faces of the block to a specific resource in the texture map, sometimes with a modifier. The valid values for the faceid include:

    • top - the top face of the block

    • bottom - the bottom face of the block

    • north - the north face of the block

    • south - the south face of the block

    • east - the east face of the block

    • west - the west face of the block

    • allsides - all sides of the block (north, south, east, west)

    • allfaces - all faces of the block (all sides, plus top and bottom)

  • textureval defines the resource used for the face. Defined values include:

    • 0 to 255 : The index of the patch within terrain.png, with 0 being the first texture on the first row, 16 being the first on the second row, etc.

    • -1 : clear or transparent (no texture)

    • 257 : the texture for stationary water (either from custom_water_still.png, or misc/water.png)

    • 258 : the texture for flowing water (either from custom_water_flowing.png, or misc/water.png)

    • 259 : the texture for stationary lava (either from custom_lava_still.png, or from terrain.png)

    • 260 : the texture for flowing lava (either from custom_lava_flowing.png, or from terrain.png)

    • 261 : the texture for the side of a piston extension (built from the piston block side texture)

    • 262 : the texture for the side of a piston that is extended (build from piston block side)

  • textureval can also have a modifier function applied by adding one of the following values to the value encoded:

    • 1000 : the texture should be tinted using the biome-based coloring from misc/grasscolor.png

    • 2000 : the texture should be tinted using the biome-based coloring from misc/foliagecolor.png

    • 4000 : the texture should be rotate 90 degrees clockwise

    • 5000 : the texture should be rotated 180 degrees clockwise

    • 6000 : the texture should be rotated 270 degrees clockwise (90 degrees counter-clockwise)

    • 7000 : the texture should be flipped horizontally (mirror image around vertical axis)

    • 8000 : the texture should be shifted downward by 50% of its height

    • 9000 : the texture should be shifted downward by 50% of its height, and flipped horizontally

    • 10000 : the texture should be transformed to be used on an inclined torch (special case)

    • 11000 : the texture is a grass block side (special case for biome tinting and coloring due to snow)

    • 12000 : the texture is transparent when it represents an interior surface next to another block of the same type (interior of glass or water, for example)

For the special case blocks that have render data generated, an additional attribute can be defined:

  • userenderdata : if defined and set to true, the generated render data value for the block is used for selecting the matching textures, instead of the block data value. At present, this is only applicable to the redstone wire, chest, and fence blocks (and is only used by the first two).

Contents

Setup

Advanced Configuration

Mod Support

Developers

Clone this wiki locally