Expand description
draw2d_blocks in the designer: blocks in 3D, as the game draws them in
a GUI (an orthographic view, turned and tilted), each block a cube with
its model’s boxes (elements: a cable’s core, a slab’s half) with
their textures — the faces you’d see, back to front, the top lit, the
sides shaded like Minecraft’s. A model without elements is a cube.
A block state picks its blockstate’s variant (turned by its x/y)
or every multipart part whose when it meets; elements keep their own
rotations.
Structs§
- Cuboid
- One box of a model, in sixteenths of a block: per face (up, down,
north, south, west, east) its texture, already cut to the face’s uv
(
None: the box has no such face), and the turns it’s drawn with, in order (its element’s, then its variant’s). - Turn
- A turn of a box about
axis(0 x, 1 y, 2 z) throughorigin(sixteenths of a block),degreescounter-clockwise looking down the axis;rescalestretches the turned box’s other axes back to the block (an element’srescale).
Constants§
- FACE_
TEXTURES - The texture variables the game’s block models draw each face with (in
[
FACE_NAMES] order), most particular first: a cube’sup, a column’send, acube_all’sall, a one-texture model’stexture.
Functions§
- cube
- A whole-block cube with
faces(a missing one: the missing texture). - draw
- draw_
cube - One cube with its own
faces(a mob’s head, say), asdrawdraws a block. - is_
block - Whether
idis a block (the game’s, or the mod’s.yblock). - shape_
of - A model’s
elementsas boxes;texture("#var" or "var")gives a face’s texture.