lihzahrd.World

class lihzahrd.World(version: lihzahrd.header.version.Version, savefile_type: int, revision: int, is_favorite: bool, name: str, generator: lihzahrd.header.generatorinfo.GeneratorInfo, uuid_: uuid.UUID, id_: int, bounds: lihzahrd.fileutils.rect.Rect, size: lihzahrd.fileutils.coordinates.Coordinates, is_expert: bool, created_on, styles: lihzahrd.header.styles.Styles, backgrounds: lihzahrd.header.backgrounds.Backgrounds, spawn_point: lihzahrd.fileutils.coordinates.Coordinates, underground_level: float, cavern_level: float, time: lihzahrd.header.time.Time, events: lihzahrd.header.events.Events, dungeon_point: lihzahrd.fileutils.coordinates.Coordinates, world_evil: lihzahrd.header.worldeviltype.WorldEvilType, saved_npcs: lihzahrd.header.savednpcs.SavedNPCs, altars_smashed: lihzahrd.header.altarssmashed.AltarsSmashed, is_hardmode: bool, shadow_orbs: lihzahrd.header.shadoworbs.ShadowOrbs, bosses_defeated: lihzahrd.header.bossesdefeated.BossesDefeated, anglers_quest: lihzahrd.header.anglerquest.AnglerQuest, clouds: lihzahrd.header.clouds.Clouds, cultist_delay: int, tiles: lihzahrd.tiles.tilematrix.TileMatrix, chests: List[lihzahrd.chests.chest.Chest], signs: List[lihzahrd.signs.sign.Sign], npcs: List[lihzahrd.npcs.npc.NPC], mobs: List[lihzahrd.npcs.mob.Mob], tile_entities: List[lihzahrd.tileentities.tileentity.TileEntity], weighed_pressure_plates: List[lihzahrd.pressureplates.weighedpressureplate.WeighedPressurePlate], rooms: List[lihzahrd.townmanager.room.Room], unknown_file_format_data: bytes = b'', unknown_world_header_data: bytes = b'', unknown_world_tiles_data: bytes = b'', unknown_chests_data: bytes = b'', unknown_signs_data: bytes = b'', unknown_npcs_data: bytes = b'', unknown_tile_entities_data: bytes = b'', unknown_pressure_plates_data: bytes = b'', unknown_town_manager_data: bytes = b'')

The Python representation of a Terraria world.

altars_smashed: AltarsSmashed = None

Information related to the destruction of Demon Altars with a Pwnhammer.

anglers_quest: AnglerQuest = None

Information about today’s Angler’s Quest.

backgrounds: Backgrounds = None

The backgrounds of the various biomes.

bosses_defeated: BossesDefeated = None

Which bosses have been defeated in the world.

bounds: Rect = None

The world size in pixels.

cavern_level: float = None

The depth at which the cavern biome starts.

chests: typing.List[Chest] = None

A list of all the containers (chests, barrels) in the world.

classmethod create_from_file(filename: str)

Create a World object from a .wld file.

Warning

Parsing an entire world may take up to a few minutes and quite a bit of memory!

Parameters

filename – The name of the file that should be parsed.

created_on = None

The date and time this world was created in.

property crimson_hearts

Information related to the Shadow Orbs or Crimson Hearts in the world.

dungeon_point: Coordinates = None

The Old Man spawn point.

events: Events = None

Currently ongoing world events.

generator: GeneratorInfo = None

Information about the generation of this world.

id: int = None

The world id. Used to name the minimap file.

is_expert: bool = None

If the world is in expert mode or not.

is_favorite: bool = None

If the world is marked as favorite or not.

is_hardmode: bool = None

Whether or not the world is in hardmode.

mobs: typing.List[Mob] = None

A list of mobs in the world…?

name: str = None

The name the world was given at creation. Doesn’t always match the filename.

npcs: typing.List[NPC] = None

A list of all the NPCs currently living in the world, including the Old Man.

revision: int = None

The number of times this world was saved.

saved_npcs: SavedNPCs = None

The NPCs that were rescued by the player.

savefile_type = None

The format of the save file. Should be 2 for all versions following 1.2.

shadow_orbs: ShadowOrbs = None

Information related to the Shadow Orbs or Crimson Hearts in the world.

signs: typing.List[Sign] = None

A list of all non-empty signs in the world.

size: Coordinates = None

The world size in tiles.

spawn_point: Coordinates = None

The coordinates of the spawn point.

styles: Styles = None

The styles of various world elements.

tile_entities: typing.List[TileEntity] = None

A list of tile entities in the world, such as Training Dummies, Item Frames and Logic Sensors.

tiles: TileMatrix = None

A matrix of all the tiles present in the world.

time: Time = None

Game time related information.

underground_level: float = None

The depth at which the underground biome starts.

uuid: uuid.UUID = None

The Universally Unique ID of this world.

version: Version = None

The game version when this savefile was last saved.

weighed_pressure_plates: typing.List[WeighedPressurePlate] = None

A list of all Weighed Pressure Plates in the world.

world_evil: WorldEvilType = None

Whether the world has Corruption or Crimson.