StairBlockRenderer Class - webbukkit/dynmap GitHub Wiki

The StairBlockRender class defines a renderer for rendering standard stair blocks. When used, it should be set to handle all metadata values for the given stair blocks. The renderer handles all stair connection behaviors for corners, and all orientations (inverted and otherwise).

The render can select the textures to use for each surface of the stairs in one of two ways:

  • For normal (non-TileEntity blocks), by the patch textures provided by the (one for the sides, on for the top, and one for the bottom faces)
  • For TileEntity based blocks, by reading a specified field in the TileEntity and doing a map lookup to see which of the provided patch textures to use for all faces of the given block.

###Attributes

  • textureindex - This optional parameter is used to specify the name of a TileEntity attribute defined for the block that contains a value (number or string) that can be used to select which patch textures to use for rendering the block.
  • texturecnt - This optional parameter is only relevant in conjunction with the textureindex parameter. It specifies the number of mapped patch textures that are defined for the textureindex: values will be defined for 'textmap0' through 'textmap*(texturecnt-1)*'.
  • textmap<N> - Each of these values, from N=0 to N=(texturecnt-1), contains the value for the TileEntity field identified by textureindex that indicates that the stairs should be textured by the texures for 'patch<N>'.

###Patches Requiring Textures

If textureindex is not defined:

  • patch0 - the texture to be used for any of the sides (vertical faces) of the block
  • patch1 - the texture to be used for the tops of the block
  • patch2 - the texture to be used for the bottom of the block

If textureindex is defined:

  • patch0 - the texture to be used for all sides when the textureindex field in the TileEntity for the block is equal to the value of the textmap0 attribute. This is also used if the textureindex TileEntity field matches none of the textmap<N> attributes.
  • patch1 - the texture to be used for all sides when the textureindex attribute in the TileEntity for the block is equal to the value of the textmap1 attribute.
  • patch<N> - the texture to be used for all sides when the textureindex attribute in the TileEntity for the block is equal to the value of the textmap<N> attribute.