frameimportant_variant¶
Module for FrameImportantVariant.
- FrameImportant¶
Terraria blocks can be FrameImportant or not.
FrameImportant blocks have different attributes depending on the specific animation frame they currently are in.
Information about their current animation frame is saved in the world file itself.
This mechanism is used for various purposes:
storing what kind of weed is growing on grass, and changing its name and color if it’s a Mushroom
storing the on-off state of
lihzahrd.terraria.data.classmembers.blocks.Torch, and using it to determine whether it emits lightstoring the kind of
lihzahrd.terraria.data.classmembers.blocks.Torch, and using it to determine its color…
- class lihzahrd.terraria.data.frameimportant_variant.FrameImportantVariant(*, eq_u: Real | None = None, eq_v: Real | None = None, min_u: Real | None = None, min_v: Real | None = None, max_u: Real | None = None, max_v: Real | None = None, name: str | None = None, color: ColorRGB | None = None, solid: bool | None = None, blend: bool | None = None, merge: bool | None = None, transparent: bool | None = None, is_stone: bool | None = None, is_grass: bool | None = None, emit_light_color: ColorRGB | None = None)¶
A variant of a FrameImportant block.
An instance of this class represents a specific variant of a block, that means, the properties a block acquires if it’s in a certain animation frame, and the conditions for them to apply.
eq_u,eq_v,min_u,min_v,max_u,max_vrepresent conditions which must be fulfilled; the not-Noneones are AND-ed together byevaluate().name,color,solid,blend,merge,transparent,is_stone,is_grass, andemit_light_colorare properties, and if they are notNone, they are applied to the block containing this variant.- eq_u: Real | None¶
The exact value
ucan have for this variant to apply, orNoneto skip this check.
- eq_v: Real | None¶
The exact value
ucan have for this variant to apply, orNoneto skip this check.
- min_u: Real | None¶
The minimum value
ucan have for this variant to apply, orNoneto skip this check.
- min_v: Real | None¶
The minimum value
vcan have for this variant to apply, orNoneto skip this check.
- max_u: Real | None¶
The maximum value
ucan have for this variant to apply, orNoneto skip this check.
- max_v: Real | None¶
The maximum value
vcan have for this variant to apply, orNoneto skip this check.
- name: str | None¶
The name that the tile should take if this variant applies, or
Noneto not alter it.
- color: ColorRGB | None¶
The color that the tile should take if this variant applies, or
Noneto not alter it.
- solid: bool | None¶
The solidity that the tile should take if this variant applies, or
Noneto not alter it.
- transparent: bool | None¶
The transparency (letting light through) that the tile should take if this variant applies, or
Noneto not alter it.
- is_stone: bool | None¶
Whether this tile should count as stone if this variant applies, or
Noneto not alter it.
- is_grass: bool | None¶
Whether this tile should count as grass if this variant applies, or
Noneto not alter it.