Skip to content
Back to top
View this page

# `chests`

Module with structures to process Terraria worlds’ chests and their contents, out of which the main one is `WorldChestsCollection`.

## `world_chests_collection`

class lihzahrd.terraria.world.chests.world_chests_collection.WorldChestsCollection(items: list[Item])

  Bases: `PackCountArray`[`WorldChest`]

  `PackCountArray` of all the item containers (chests) in a Terraria world.

  ITEM

    alias of `WorldChest`

## `world_chest_data`

Submodule containing `WorldChestData`.

class lihzahrd.terraria.world.chests.world_chest_data.WorldChestData(position: Coordinates, name: str, contents: list[ItemBase | None])

  Data about an item container (a chest).

  position: Coordinates

    The position of the chest, in world coordinates.

  name: str

    The name of the chest.

  contents: list[ItemBase | None]

    The stacks of items stored inside the chest, or `None` for empty slots.

## `world_chest`

Submodule containing `WorldChest`.

class lihzahrd.terraria.world.chests.world_chest.WorldChest(value: Value)

  Bases: `PackPrimitive`[`WorldChestData`]

  `PackPrimitive` to process a storage container (a chest) in a Terraria world.

  EXPECTED_CONTAINER_SIZE = 40

    The number of stacks that can be stored in a single container.

  exception UnknownContainerSizeError

    Bases: `ValidationError`

    At least one container has a different amount of items than the number normally allowed in a Terraria version.