lihzahrd.tiles

class lihzahrd.tiles.Block(type_: BlockType, shape: Shape = Shape.NORMAL, frame: FrameImportantData | None = None, paint: int | None = None, is_active: bool = True, is_illuminant: bool = False, is_echo: bool = False)

A block that has been placed in the world.

frame: FrameImportantData | None

The framedata of the block, if present.

is_active: bool

If the block is solid or can be passed through because of an Actuator.

is_echo: bool

If the block had Echo Coating applied, and is invisible.

is_illuminant: bool

If the block had Illuminant Coating applied, and is unaffected by lighting.

paint: int | None

The paint color of a block.

shape: Shape

The shape of the block, is changed with an hammer.

type: BlockType

The type of the block (dirt, stone, …).

class lihzahrd.tiles.FrameImportantData(frame_x, frame_y)

Frame data of FrameImportant blocks.

Some blocks share the same type and texture of other blocks (ex: banners), so they store some texture data inside the save file.

frame_x: int
frame_y: int
class lihzahrd.tiles.Liquid(type_: LiquidType, volume: int = 255)

A liquid present in a tile.

type: LiquidType

The type of liquid present in the tile.

volume: int

The volume of liquid present in the tile.

0 means the tile has no liquid, while 255 means the tile is full of liquid.

Values over 255 aren’t supported.

class lihzahrd.tiles.Shape(*values)

The shape of a block, given to it with an hammer.

The directions refer to the missing slope corner.

BOTTOM_LEFT_SLOPE = 5
BOTTOM_RIGHT_SLOPE = 4
HALF_TILE = 1
NORMAL = 0
TOP_LEFT_SLOPE = 3
TOP_RIGHT_SLOPE = 2
classmethod from_flags(flags2)
class lihzahrd.tiles.Tile(block: Block | None = None, wall: Wall | None = None, liquid: Liquid | None = None, wiring: Wiring | None = None, extra: Chest | Sign | WeighedPressurePlate | TileEntity | None = None)

A tile, composed by a block, a wall, a liquid and wires.

block: Block | None
extra: Chest | Sign | WeighedPressurePlate | TileEntity | None

A reference to the extra data of this tile, such as Chest or Sign data.

liquid: Liquid | None
wall: Wall | None
wiring: Wiring | None
class lihzahrd.tiles.TileMatrix

A huge matrix containing the tiles of a whole world.

_tiles: List[List[Tile]]
add_column(column: List[Tile])

Add a new column to the matrix.

property size: Coordinates

Return the size of the matrix as a pair of coordinates.

class lihzahrd.tiles.Wall(type_: WallType, paint: int | None = None, is_illuminant: bool = False, is_echo: bool = False)

A wall that has been placed in the world.

is_echo: bool

If the wall had Echo Coating applied, and is invisible.

is_illuminant: bool

If the wall had Illuminant Coating applied, and is unaffected by lighting.

paint: int | None
type: WallType
class lihzahrd.tiles.Wiring(red: bool = False, green: bool = False, blue: bool = False, yellow: bool = False, actuator: bool = False)

Wiring data for a certain tile.

classmethod _from_flags(flags21, flags22, flags23, flags31, flags35)
actuator: bool

If there’s an Actuator in the tile.

blue: bool

If there’s a blue Wire in the tile.

classmethod from_flags(flags2=None, flags3=None)
green: bool

If there’s a green Wire in the tile.

red: bool

If there’s a red Wire in the tile.

yellow: bool

If there’s a yellow Wire in the tile.