Defining a Block using a Volumetric Model - webbukkit/dynmap GitHub Wiki

Blocks based on volumetric models can have relatively complex shapes, while still using the same texture definition scheme as used for simple, solid blocks or cuboid blocks. The application of textures to the volumetric models follow the same pattern as is done for simple cubes and for cubiod models - the texture for each of the 6 faces is applied to the corresponding side of any of the subblocks within the model, with the texture scaled to the full size of the cube face. Consequently, the texture definitions in the Texture Definition Files are defined in the same way as for simple solid blocks and for cubiod models.

A volumetric model is defined by first cutting the full cube into a number of subblocks, based on a provided scale attribute - resulting in the block being represented by scale x scale x scale subblocks. Then, each of the subblocks that are occupied, or filled, by the shape of the model is marked, allowing any arrangement of the subblocks to be created. For details, see Defining Volumetric Models. An example of a block representable by a volumetric model is the Hopper block;

 block:id=154,data=*,scale=16
 layer:0,1,2,3
 ----------------
 ----------------
 ----------------
 ----------------
 ----------------
 ----------------
 ------****------
 ------****------
 ------****------
 ------****------
 ----------------
 ----------------
 ----------------
 ----------------
 ----------------
 ----------------
 layer:4,5,6,7,8,9
 ----------------
 ----------------
 ----------------
 ----------------
 ----********----
 ----********----
 ----********----
 ----********----
 ----********----
 ----********----
 ----********----
 ----********----
 ----------------
 ----------------
 ----------------
 ----------------
 layer:10
 ****************
 ****************
 ****************
 ****************
 ****************
 ****************
 ****************
 ****************
 ****************
 ****************
 ****************
 ****************
 ****************
 ****************
 ****************
 ****************
 layer:11,12,13,14,15
 ****************
 ****************
 **------------**
 **------------**
 **------------**
 **------------**
 **------------**
 **------------**
 **------------**
 **------------**
 **------------**
 **------------**
 **------------**
 **------------**
 ****************
 ****************

One the model is defined, the texture references are supplied in the same way as a simple, solid block - see Defining a Simple Block for details. For the Hopper block, the definition is:

 block:id=154,data=*,allsides=0:hopper_outside,top=0:hopper_inside,bottom=0:hopper_outside,stdrot=true