Skip to content

Class WorldReader

🏭 Constructors

constructor

ts
new WorldReader(fs: FileSystem): WorldReader

Parameters

  • fs: FileSystem

Return Type

  • WorldReader

Defined in: packages/game-data/level.ts:126

🏷️ Properties

fs private

ts
fs: FileSystem

Defined in: packages/game-data/level.ts:126

🔧 Methods

getAdvancementsData public

ts
getAdvancementsData(): Promise<AdvancementDataFrame[]>

Return Type

  • Promise<AdvancementDataFrame[]>

Defined in: packages/game-data/level.ts:187

getEntityData public

ts
getEntityData(chunkX: number, chunkZ: number): Promise<RegionDataFrame>

Get entity data frame

Parameters

  • chunkX: number The x value of chunk coord
  • chunkZ: number The z value of chunk coord

Return Type

  • Promise<RegionDataFrame>

Defined in: packages/game-data/level.ts:142

getLevelData public

ts
getLevelData(): Promise<LevelDataFrame>

Read the level data

Return Type

  • Promise<LevelDataFrame>

Defined in: packages/game-data/level.ts:175

getMCAData public

ts
getMCAData(prefix: string, chunkX: number, chunkZ: number): Promise<RegionDataFrame>

Get mca data frame

Parameters

  • prefix: string The folder to load the .mca file from
  • chunkX: number The x value of chunk coord
  • chunkZ: number The z value of chunk coord

Return Type

  • Promise<RegionDataFrame>

Defined in: packages/game-data/level.ts:154

getPlayerData public

ts
getPlayerData(): Promise<PlayerDataFrame[]>

Return Type

  • Promise<PlayerDataFrame[]>

Defined in: packages/game-data/level.ts:181

getRegionData public

ts
getRegionData(chunkX: number, chunkZ: number): Promise<RegionDataFrame>

Get region data frame

Parameters

  • chunkX: number The x value of chunk coord
  • chunkZ: number The z value of chunk coord

Return Type

  • Promise<RegionDataFrame>

Defined in: packages/game-data/level.ts:132

create static

ts
create(path: string | Uint8Array): Promise<WorldReader>

Parameters

  • path: string | Uint8Array

Return Type

  • Promise<WorldReader>

Defined in: packages/game-data/level.ts:122