lihzahrd.fileutils

class lihzahrd.fileutils.Coordinates(x, y)

A pair of coordinates.

x
y
class lihzahrd.fileutils.FileReader(file: IO)

Helper class for deserializing a Terraria world file.

_bool(buffer, /)

Return a tuple containing unpacked values.

Unpack according to the format string Struct.format. The buffer’s size in bytes must be Struct.size.

See help(struct) for more on format strings.

_double(buffer, /)

Return a tuple containing unpacked values.

Unpack according to the format string Struct.format. The buffer’s size in bytes must be Struct.size.

See help(struct) for more on format strings.

_int1(buffer, /)

Return a tuple containing unpacked values.

Unpack according to the format string Struct.format. The buffer’s size in bytes must be Struct.size.

See help(struct) for more on format strings.

_int2(buffer, /)

Return a tuple containing unpacked values.

Unpack according to the format string Struct.format. The buffer’s size in bytes must be Struct.size.

See help(struct) for more on format strings.

_int4(buffer, /)

Return a tuple containing unpacked values.

Unpack according to the format string Struct.format. The buffer’s size in bytes must be Struct.size.

See help(struct) for more on format strings.

_int8(buffer, /)

Return a tuple containing unpacked values.

Unpack according to the format string Struct.format. The buffer’s size in bytes must be Struct.size.

See help(struct) for more on format strings.

_rect(buffer, /)

Return a tuple containing unpacked values.

Unpack according to the format string Struct.format. The buffer’s size in bytes must be Struct.size.

See help(struct) for more on format strings.

_single(buffer, /)

Return a tuple containing unpacked values.

Unpack according to the format string Struct.format. The buffer’s size in bytes must be Struct.size.

See help(struct) for more on format strings.

_uint2(buffer, /)

Return a tuple containing unpacked values.

Unpack according to the format string Struct.format. The buffer’s size in bytes must be Struct.size.

See help(struct) for more on format strings.

_uint4(buffer, /)

Return a tuple containing unpacked values.

Unpack according to the format string Struct.format. The buffer’s size in bytes must be Struct.size.

See help(struct) for more on format strings.

_uint8(buffer, /)

Return a tuple containing unpacked values.

Unpack according to the format string Struct.format. The buffer’s size in bytes must be Struct.size.

See help(struct) for more on format strings.

bits() Tuple[bool, bool, bool, bool, bool, bool, bool, bool]
bool() bool
datetime() datetime
double() float
file: IO
int1() int
int2() int
int4() int
int8() int
read_until(address: int) bytearray
rect() Rect
single() float
skip_until(address: int) None
string(size=None) str
uint1() int
uint2() int
uint4() int
uint8() int
uleb128() int
uuid() UUID
class lihzahrd.fileutils.Pointers(world_header: int, world_tiles: int, chests: int, signs: int, npcs: int, tile_entities: int, pressure_plates: int, town_manager: int, bestiary: int, journey_powers: int, footer: int, *unknown)

Pointers to the various sections of the Terraria save file.

All values are in number of bytes from the start.

bestiary: int
chests: int
file_format: int
footer: int
journey_powers: int
npcs: int
pressure_plates: int
signs: int
tile_entities: int
town_manager: int
unknown: List[int]
world_header: int
world_tiles: int
class lihzahrd.fileutils.Rect(left, right, top, bottom)

Class delimining the bounds of a rectangle.

bottom
left
right
top