minerender 2.1.0-alpha.38 → 2.1.0-alpha.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,8 @@ import * as three from 'three';
2
2
  import { Vector3, PixelFormat, BoxGeometry, Material, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, BufferGeometry, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Scene, Object3DEventMap, Texture, Camera, MOUSE, TOUCH, WebGLRenderer, EventDispatcher, Raycaster, Intersection, MeshBasicMaterial, CanvasTexture, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points } from 'three';
3
3
  import * as nodeCanvas from 'canvas';
4
4
  import { ImageData as ImageData$1, CanvasRenderingContext2D } from 'canvas';
5
- import { Buffer as Buffer$1 } from 'buffer';
6
- import { NBT } from 'prismarine-nbt';
5
+ import { Buffer } from 'buffer';
6
+ import { NBT, NBTFormat, Metadata } from 'prismarine-nbt';
7
7
  import { ZipReader } from '@zip.js/zip.js';
8
8
  import { AsyncLoadingCache, SimpleCache } from '@inventivetalent/loading-cache';
9
9
  import Stats from 'stats.js';
@@ -320,7 +320,7 @@ interface ImageInfo {
320
320
  width: number;
321
321
  height: number;
322
322
  type?: string;
323
- data: Buffer$1;
323
+ data: Buffer;
324
324
  }
325
325
  declare class ImageLoader {
326
326
  protected static _createImage(): CompatImage;
@@ -1142,20 +1142,27 @@ declare function isBlockObject(obj: any): obj is BlockObject;
1142
1142
  interface MultiBlockStructure {
1143
1143
  readonly size: TripleArray;
1144
1144
  readonly blocks: MultiBlockBlock[];
1145
+ readonly dataVersion?: number;
1146
+ readonly entities?: MultiBlockEntity[];
1147
+ }
1148
+ interface MultiBlockEntity {
1149
+ position: TripleArray;
1150
+ blockPosition?: TripleArray;
1151
+ nbt: unknown;
1145
1152
  }
1146
1153
  interface MultiBlockBlock extends Block {
1147
1154
  position: TripleArray;
1148
1155
  }
1149
1156
 
1150
1157
  declare class SchematicParser {
1151
- static parse(): Promise<MultiBlockStructure>;
1158
+ static parse(nbt: NBT): Promise<MultiBlockStructure>;
1152
1159
  }
1153
1160
 
1154
1161
  declare class StructureParser {
1155
1162
  static parse(_nbt: NBT, paletteIndex?: number): Promise<MultiBlockStructure>;
1156
1163
  }
1157
1164
  interface StructureNBT {
1158
- DataVersion: {
1165
+ DataVersion?: {
1159
1166
  type: "int";
1160
1167
  value: number;
1161
1168
  };
@@ -1167,7 +1174,13 @@ interface StructureNBT {
1167
1174
  };
1168
1175
  };
1169
1176
  palette?: Palette;
1170
- palettes?: Palette[];
1177
+ palettes?: {
1178
+ type: "list";
1179
+ value: {
1180
+ type: "list";
1181
+ value: Palette["value"][];
1182
+ };
1183
+ };
1171
1184
  blocks: {
1172
1185
  type: "list";
1173
1186
  value: {
@@ -1175,7 +1188,32 @@ interface StructureNBT {
1175
1188
  value: BlockEntry[];
1176
1189
  };
1177
1190
  };
1178
- entities: {};
1191
+ entities?: {
1192
+ type: "list";
1193
+ value: {
1194
+ type: "compound";
1195
+ value: {
1196
+ pos: {
1197
+ type: "list";
1198
+ value: {
1199
+ type: "double";
1200
+ value: TripleArray;
1201
+ };
1202
+ };
1203
+ blockPos: {
1204
+ type: "list";
1205
+ value: {
1206
+ type: "int";
1207
+ value: TripleArray;
1208
+ };
1209
+ };
1210
+ nbt: {
1211
+ type: "compound";
1212
+ value: any;
1213
+ };
1214
+ }[];
1215
+ };
1216
+ };
1179
1217
  }
1180
1218
  interface Palette {
1181
1219
  type: "list";
@@ -1219,9 +1257,12 @@ interface BlockEntry {
1219
1257
  }
1220
1258
 
1221
1259
  declare class NBTHelper {
1222
- static fromBuffer(buffer: Buffer): Promise<NBTAsset>;
1260
+ static fromBuffer(data: Uint8Array | ArrayBuffer, format?: NBTFormat): Promise<NBTAsset>;
1223
1261
  }
1224
1262
  interface NBTAsset extends MinecraftAsset, NBT {
1263
+ format?: NBTFormat;
1264
+ metadata?: Metadata;
1265
+ compression?: "gzip" | "none";
1225
1266
  }
1226
1267
 
1227
1268
  interface ResponseParser<T extends MinecraftAsset> {
@@ -1693,6 +1734,51 @@ declare function mergeVertices(geometry: BufferGeometry, tolerance?: number): Bu
1693
1734
  declare function toTrianglesDrawMode(geometry: BufferGeometry, drawMode: TrianglesDrawModes): BufferGeometry;
1694
1735
  declare function computeMorphedAttributes(object: Mesh | Line | Points): object;
1695
1736
 
1737
+ declare class ChunkData {
1738
+ private readonly indices;
1739
+ private readonly palette;
1740
+ private readonly paletteIds;
1741
+ private readonly freeIds;
1742
+ private readonly nbt;
1743
+ get(index: number): Maybe<Block>;
1744
+ snapshot(index: number): Maybe<() => Block>;
1745
+ set(index: number, block?: Block): void;
1746
+ clear(): void;
1747
+ static isAir(block: Maybe<Block>): boolean;
1748
+ private static copyBlock;
1749
+ private static validateIndex;
1750
+ }
1751
+
1752
+ type RegionInput = Uint8Array | ArrayBuffer;
1753
+ interface AnvilRegion {
1754
+ chunks: AnvilChunk[];
1755
+ }
1756
+ interface AnvilChunk {
1757
+ x: number;
1758
+ z: number;
1759
+ dataVersion?: number;
1760
+ sections: {
1761
+ y: number;
1762
+ data: ChunkData;
1763
+ }[];
1764
+ entities?: MultiBlockEntity[];
1765
+ }
1766
+ declare class AnvilParser {
1767
+ static getChunkList(data: RegionInput): {
1768
+ x: number;
1769
+ z: number;
1770
+ }[];
1771
+ static parse(data: RegionInput): Promise<AnvilRegion>;
1772
+ static parseChunk(data: RegionInput, localX: number, localZ: number): Promise<AnvilChunk | undefined>;
1773
+ private static bytes;
1774
+ private static locations;
1775
+ private static readChunk;
1776
+ private static compounds;
1777
+ private static integer;
1778
+ private static block;
1779
+ private static unpack;
1780
+ }
1781
+
1696
1782
  interface BlockInfo {
1697
1783
  /** Detached block data; use world or chunk setters to update stored blocks. */
1698
1784
  readonly block: Block;
@@ -1729,21 +1815,6 @@ declare class Chunk {
1729
1815
  chunkPosToWorldPos(pos: Vector3): Vector3;
1730
1816
  }
1731
1817
 
1732
- declare class ChunkData {
1733
- private readonly indices;
1734
- private readonly palette;
1735
- private readonly paletteIds;
1736
- private readonly freeIds;
1737
- private readonly nbt;
1738
- get(index: number): Maybe<Block>;
1739
- snapshot(index: number): Maybe<() => Block>;
1740
- set(index: number, block?: Block): void;
1741
- clear(): void;
1742
- static isAir(block: Maybe<Block>): boolean;
1743
- private static copyBlock;
1744
- private static validateIndex;
1745
- }
1746
-
1747
1818
  declare class MineRenderWorld {
1748
1819
  readonly scene: MineRenderScene;
1749
1820
  private readonly _chunks;
@@ -1757,6 +1828,8 @@ declare class MineRenderWorld {
1757
1828
  setBlockAt(pos: Vector3, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
1758
1829
  setBlockAt(pos: TripleArray, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
1759
1830
  placeMultiBlock(multiblock: MultiBlockStructure, useBatches?: boolean, executor?: BatchedExecutor): Promise<void>;
1831
+ /** Replaces one chunk column's blocks. Entity NBT remains available on the parsed chunk. */
1832
+ placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
1760
1833
  clear(): Promise<void>;
1761
1834
  private updateCulling;
1762
1835
  private getOrCreateChunkAt;
@@ -1803,4 +1876,4 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
1803
1876
  */
1804
1877
  declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
1805
1878
 
1806
- export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
1879
+ export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
@@ -2,8 +2,8 @@ import * as three from 'three';
2
2
  import { Vector3, PixelFormat, BoxGeometry, Material, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, BufferGeometry, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Scene, Object3DEventMap, Texture, Camera, MOUSE, TOUCH, WebGLRenderer, EventDispatcher, Raycaster, Intersection, MeshBasicMaterial, CanvasTexture, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points } from 'three';
3
3
  import * as nodeCanvas from 'canvas';
4
4
  import { ImageData as ImageData$1, CanvasRenderingContext2D } from 'canvas';
5
- import { Buffer as Buffer$1 } from 'buffer';
6
- import { NBT } from 'prismarine-nbt';
5
+ import { Buffer } from 'buffer';
6
+ import { NBT, NBTFormat, Metadata } from 'prismarine-nbt';
7
7
  import { ZipReader } from '@zip.js/zip.js';
8
8
  import { AsyncLoadingCache, SimpleCache } from '@inventivetalent/loading-cache';
9
9
  import Stats from 'stats.js';
@@ -320,7 +320,7 @@ interface ImageInfo {
320
320
  width: number;
321
321
  height: number;
322
322
  type?: string;
323
- data: Buffer$1;
323
+ data: Buffer;
324
324
  }
325
325
  declare class ImageLoader {
326
326
  protected static _createImage(): CompatImage;
@@ -1142,20 +1142,27 @@ declare function isBlockObject(obj: any): obj is BlockObject;
1142
1142
  interface MultiBlockStructure {
1143
1143
  readonly size: TripleArray;
1144
1144
  readonly blocks: MultiBlockBlock[];
1145
+ readonly dataVersion?: number;
1146
+ readonly entities?: MultiBlockEntity[];
1147
+ }
1148
+ interface MultiBlockEntity {
1149
+ position: TripleArray;
1150
+ blockPosition?: TripleArray;
1151
+ nbt: unknown;
1145
1152
  }
1146
1153
  interface MultiBlockBlock extends Block {
1147
1154
  position: TripleArray;
1148
1155
  }
1149
1156
 
1150
1157
  declare class SchematicParser {
1151
- static parse(): Promise<MultiBlockStructure>;
1158
+ static parse(nbt: NBT): Promise<MultiBlockStructure>;
1152
1159
  }
1153
1160
 
1154
1161
  declare class StructureParser {
1155
1162
  static parse(_nbt: NBT, paletteIndex?: number): Promise<MultiBlockStructure>;
1156
1163
  }
1157
1164
  interface StructureNBT {
1158
- DataVersion: {
1165
+ DataVersion?: {
1159
1166
  type: "int";
1160
1167
  value: number;
1161
1168
  };
@@ -1167,7 +1174,13 @@ interface StructureNBT {
1167
1174
  };
1168
1175
  };
1169
1176
  palette?: Palette;
1170
- palettes?: Palette[];
1177
+ palettes?: {
1178
+ type: "list";
1179
+ value: {
1180
+ type: "list";
1181
+ value: Palette["value"][];
1182
+ };
1183
+ };
1171
1184
  blocks: {
1172
1185
  type: "list";
1173
1186
  value: {
@@ -1175,7 +1188,32 @@ interface StructureNBT {
1175
1188
  value: BlockEntry[];
1176
1189
  };
1177
1190
  };
1178
- entities: {};
1191
+ entities?: {
1192
+ type: "list";
1193
+ value: {
1194
+ type: "compound";
1195
+ value: {
1196
+ pos: {
1197
+ type: "list";
1198
+ value: {
1199
+ type: "double";
1200
+ value: TripleArray;
1201
+ };
1202
+ };
1203
+ blockPos: {
1204
+ type: "list";
1205
+ value: {
1206
+ type: "int";
1207
+ value: TripleArray;
1208
+ };
1209
+ };
1210
+ nbt: {
1211
+ type: "compound";
1212
+ value: any;
1213
+ };
1214
+ }[];
1215
+ };
1216
+ };
1179
1217
  }
1180
1218
  interface Palette {
1181
1219
  type: "list";
@@ -1219,9 +1257,12 @@ interface BlockEntry {
1219
1257
  }
1220
1258
 
1221
1259
  declare class NBTHelper {
1222
- static fromBuffer(buffer: Buffer): Promise<NBTAsset>;
1260
+ static fromBuffer(data: Uint8Array | ArrayBuffer, format?: NBTFormat): Promise<NBTAsset>;
1223
1261
  }
1224
1262
  interface NBTAsset extends MinecraftAsset, NBT {
1263
+ format?: NBTFormat;
1264
+ metadata?: Metadata;
1265
+ compression?: "gzip" | "none";
1225
1266
  }
1226
1267
 
1227
1268
  interface ResponseParser<T extends MinecraftAsset> {
@@ -1693,6 +1734,51 @@ declare function mergeVertices(geometry: BufferGeometry, tolerance?: number): Bu
1693
1734
  declare function toTrianglesDrawMode(geometry: BufferGeometry, drawMode: TrianglesDrawModes): BufferGeometry;
1694
1735
  declare function computeMorphedAttributes(object: Mesh | Line | Points): object;
1695
1736
 
1737
+ declare class ChunkData {
1738
+ private readonly indices;
1739
+ private readonly palette;
1740
+ private readonly paletteIds;
1741
+ private readonly freeIds;
1742
+ private readonly nbt;
1743
+ get(index: number): Maybe<Block>;
1744
+ snapshot(index: number): Maybe<() => Block>;
1745
+ set(index: number, block?: Block): void;
1746
+ clear(): void;
1747
+ static isAir(block: Maybe<Block>): boolean;
1748
+ private static copyBlock;
1749
+ private static validateIndex;
1750
+ }
1751
+
1752
+ type RegionInput = Uint8Array | ArrayBuffer;
1753
+ interface AnvilRegion {
1754
+ chunks: AnvilChunk[];
1755
+ }
1756
+ interface AnvilChunk {
1757
+ x: number;
1758
+ z: number;
1759
+ dataVersion?: number;
1760
+ sections: {
1761
+ y: number;
1762
+ data: ChunkData;
1763
+ }[];
1764
+ entities?: MultiBlockEntity[];
1765
+ }
1766
+ declare class AnvilParser {
1767
+ static getChunkList(data: RegionInput): {
1768
+ x: number;
1769
+ z: number;
1770
+ }[];
1771
+ static parse(data: RegionInput): Promise<AnvilRegion>;
1772
+ static parseChunk(data: RegionInput, localX: number, localZ: number): Promise<AnvilChunk | undefined>;
1773
+ private static bytes;
1774
+ private static locations;
1775
+ private static readChunk;
1776
+ private static compounds;
1777
+ private static integer;
1778
+ private static block;
1779
+ private static unpack;
1780
+ }
1781
+
1696
1782
  interface BlockInfo {
1697
1783
  /** Detached block data; use world or chunk setters to update stored blocks. */
1698
1784
  readonly block: Block;
@@ -1729,21 +1815,6 @@ declare class Chunk {
1729
1815
  chunkPosToWorldPos(pos: Vector3): Vector3;
1730
1816
  }
1731
1817
 
1732
- declare class ChunkData {
1733
- private readonly indices;
1734
- private readonly palette;
1735
- private readonly paletteIds;
1736
- private readonly freeIds;
1737
- private readonly nbt;
1738
- get(index: number): Maybe<Block>;
1739
- snapshot(index: number): Maybe<() => Block>;
1740
- set(index: number, block?: Block): void;
1741
- clear(): void;
1742
- static isAir(block: Maybe<Block>): boolean;
1743
- private static copyBlock;
1744
- private static validateIndex;
1745
- }
1746
-
1747
1818
  declare class MineRenderWorld {
1748
1819
  readonly scene: MineRenderScene;
1749
1820
  private readonly _chunks;
@@ -1757,6 +1828,8 @@ declare class MineRenderWorld {
1757
1828
  setBlockAt(pos: Vector3, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
1758
1829
  setBlockAt(pos: TripleArray, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
1759
1830
  placeMultiBlock(multiblock: MultiBlockStructure, useBatches?: boolean, executor?: BatchedExecutor): Promise<void>;
1831
+ /** Replaces one chunk column's blocks. Entity NBT remains available on the parsed chunk. */
1832
+ placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
1760
1833
  clear(): Promise<void>;
1761
1834
  private updateCulling;
1762
1835
  private getOrCreateChunkAt;
@@ -1803,4 +1876,4 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
1803
1876
  */
1804
1877
  declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
1805
1878
 
1806
- export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
1879
+ export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };