Skip to content
Back to top
View this page

# `enums`

Module for regular `Enum` of Terraria data.

## `block_shape`

class lihzahrd.terraria.data.enums.block_shape.BlockShapeEnum(*values)

  The shape of a block, changed by hammering it.

  The directions refer to the missing slope corner.

  NORMAL = 0

    Block isn’t sloped.

  TOP_HALF = 1

    The top half of the block is missing.

  TOP_RIGHT = 2

    The top right corner of the block is missing.

  TOP_LEFT = 3

    The top left corner of the block is missing.

  BOTTOM_RIGHT = 4

    The bottom right corner of the block is missing.

  BOTTOM_LEFT = 5

    The bottom left corner of the block is missing.

  classmethod from_bits(bit2: bool, bit1: bool, bit0: bool) → Self

    Create a new `BlockShape` from tile bits.

    Example

        >>> BlockShapeEnum.from_bits(True, False, False)
        <BlockShape.BOTTOM_RIGHT: 4>

        >>> BlockShapeEnum.from_bits(False, False, False)
        <BlockShape.NORMAL: 0>

    Parameters:

      - bit2 – The `flags2[6]` bit.

      - bit1 – The `flags2[5]` bit.

      - bit0 – The `flags2[4]` bit.

    Returns:

      The corresponding `BlockShape`.

  to_bits() → tuple[bool, bool, bool]

    Convert the `BlockShape` to the corresponding bits `tuple`.

    Example

        >>> BlockShapeEnum.BOTTOM_RIGHT.to_bits()
        (True, False, False)

        >>> BlockShapeEnum.NORMAL.to_bits()
        (False, False, False)

    Returns:

      The resulting `tuple` of bits, with, in order, `flags2[6]`, `flags2[5]`, and `flags2[4]`.

## `paint`

class lihzahrd.terraria.data.enums.paint.PaintEnum(*values)

  The color with which a block is painted.

  See also

  Paint and coating IDs on the Official Terraria Wiki

  NONE = 0

    No paint.

  RED = 1

    Red Paint.

  ORANGE = 2

    Orange Paint.

  YELLOW = 3

    Yellow Paint.

  LIME = 4

    Lime Paint.

  GREEN = 5

    Green Paint.

  TEAL = 6

    Teal Paint.

  CYAN = 7

    Cyan Paint.

  SKY_BLUE = 8

    Sky blue Paint.

  BLUE = 9

    Blue Paint.

  PURPLE = 10

    Purple Paint.

  VIOLET = 11

    Violet Paint.

  PINK = 12

    Pink Paint.

  DEEP_RED = 13

    Deep Red Paint.

  DEEP_ORANGE = 14

    Deep Orange Paint.

  DEEP_YELLOW = 15

    Deep Yellow Paint.

  DEEP_LIME = 16

    Deep Lime Paint.

  DEEP_GREEN = 17

    Deep Green Paint.

  DEEP_TEAL = 18

    Deep Teal Paint.

  DEEP_CYAN = 19

    Deep Cyan Paint.

  DEEP_SKY_BLUE = 20

    Deep Sky Blue Paint.

  DEEP_BLUE = 21

    Deep Blue Paint.

  DEEP_PURPLE = 22

    Deep Purple Paint.

  DEEP_VIOLET = 23

    Deep Violet Paint.

  DEEP_PINK = 24

    Deep Pink Paint.

  BLACK = 25

    Black Paint.

  WHITE = 26

    White Paint.

  GRAY = 27

    Gray Paint.

  BROWN = 28

    Brown Paint.

  SHADOW = 29

    Shadow Paint.

  NEGATIVE = 30

    Negative Paint.

  _ILLUMINANT = 31

    Old paint ID for Illuminant Coating.

    Illuminant coating is not part of paints anymore, as it can be applied separately from paint.

  is_deep_paint() → bool
    Returns:

      Whether the paint is deep or not.