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.
- package/dist/browser/index.d.mts +97 -24
- package/dist/browser/index.d.ts +97 -24
- package/dist/browser/index.js +1992 -11
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +1992 -11
- package/dist/browser/index.mjs.map +1 -1
- package/dist/bundle.js +2002 -14
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +97 -24
- package/dist/node/index.d.ts +97 -24
- package/dist/node/index.js +1993 -11
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +1992 -11
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.d.mts
CHANGED
|
@@ -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
|
|
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';
|
|
@@ -321,7 +321,7 @@ interface ImageInfo {
|
|
|
321
321
|
width: number;
|
|
322
322
|
height: number;
|
|
323
323
|
type?: string;
|
|
324
|
-
data: Buffer
|
|
324
|
+
data: Buffer;
|
|
325
325
|
}
|
|
326
326
|
declare class ImageLoader {
|
|
327
327
|
protected static _createImage(): CompatImage;
|
|
@@ -1143,20 +1143,27 @@ declare function isBlockObject(obj: any): obj is BlockObject;
|
|
|
1143
1143
|
interface MultiBlockStructure {
|
|
1144
1144
|
readonly size: TripleArray;
|
|
1145
1145
|
readonly blocks: MultiBlockBlock[];
|
|
1146
|
+
readonly dataVersion?: number;
|
|
1147
|
+
readonly entities?: MultiBlockEntity[];
|
|
1148
|
+
}
|
|
1149
|
+
interface MultiBlockEntity {
|
|
1150
|
+
position: TripleArray;
|
|
1151
|
+
blockPosition?: TripleArray;
|
|
1152
|
+
nbt: unknown;
|
|
1146
1153
|
}
|
|
1147
1154
|
interface MultiBlockBlock extends Block {
|
|
1148
1155
|
position: TripleArray;
|
|
1149
1156
|
}
|
|
1150
1157
|
|
|
1151
1158
|
declare class SchematicParser {
|
|
1152
|
-
static parse(): Promise<MultiBlockStructure>;
|
|
1159
|
+
static parse(nbt: NBT): Promise<MultiBlockStructure>;
|
|
1153
1160
|
}
|
|
1154
1161
|
|
|
1155
1162
|
declare class StructureParser {
|
|
1156
1163
|
static parse(_nbt: NBT, paletteIndex?: number): Promise<MultiBlockStructure>;
|
|
1157
1164
|
}
|
|
1158
1165
|
interface StructureNBT {
|
|
1159
|
-
DataVersion
|
|
1166
|
+
DataVersion?: {
|
|
1160
1167
|
type: "int";
|
|
1161
1168
|
value: number;
|
|
1162
1169
|
};
|
|
@@ -1168,7 +1175,13 @@ interface StructureNBT {
|
|
|
1168
1175
|
};
|
|
1169
1176
|
};
|
|
1170
1177
|
palette?: Palette;
|
|
1171
|
-
palettes?:
|
|
1178
|
+
palettes?: {
|
|
1179
|
+
type: "list";
|
|
1180
|
+
value: {
|
|
1181
|
+
type: "list";
|
|
1182
|
+
value: Palette["value"][];
|
|
1183
|
+
};
|
|
1184
|
+
};
|
|
1172
1185
|
blocks: {
|
|
1173
1186
|
type: "list";
|
|
1174
1187
|
value: {
|
|
@@ -1176,7 +1189,32 @@ interface StructureNBT {
|
|
|
1176
1189
|
value: BlockEntry[];
|
|
1177
1190
|
};
|
|
1178
1191
|
};
|
|
1179
|
-
entities
|
|
1192
|
+
entities?: {
|
|
1193
|
+
type: "list";
|
|
1194
|
+
value: {
|
|
1195
|
+
type: "compound";
|
|
1196
|
+
value: {
|
|
1197
|
+
pos: {
|
|
1198
|
+
type: "list";
|
|
1199
|
+
value: {
|
|
1200
|
+
type: "double";
|
|
1201
|
+
value: TripleArray;
|
|
1202
|
+
};
|
|
1203
|
+
};
|
|
1204
|
+
blockPos: {
|
|
1205
|
+
type: "list";
|
|
1206
|
+
value: {
|
|
1207
|
+
type: "int";
|
|
1208
|
+
value: TripleArray;
|
|
1209
|
+
};
|
|
1210
|
+
};
|
|
1211
|
+
nbt: {
|
|
1212
|
+
type: "compound";
|
|
1213
|
+
value: any;
|
|
1214
|
+
};
|
|
1215
|
+
}[];
|
|
1216
|
+
};
|
|
1217
|
+
};
|
|
1180
1218
|
}
|
|
1181
1219
|
interface Palette {
|
|
1182
1220
|
type: "list";
|
|
@@ -1220,9 +1258,12 @@ interface BlockEntry {
|
|
|
1220
1258
|
}
|
|
1221
1259
|
|
|
1222
1260
|
declare class NBTHelper {
|
|
1223
|
-
static fromBuffer(
|
|
1261
|
+
static fromBuffer(data: Uint8Array | ArrayBuffer, format?: NBTFormat): Promise<NBTAsset>;
|
|
1224
1262
|
}
|
|
1225
1263
|
interface NBTAsset extends MinecraftAsset, NBT {
|
|
1264
|
+
format?: NBTFormat;
|
|
1265
|
+
metadata?: Metadata;
|
|
1266
|
+
compression?: "gzip" | "none";
|
|
1226
1267
|
}
|
|
1227
1268
|
|
|
1228
1269
|
interface ResponseParser<T extends MinecraftAsset> {
|
|
@@ -1694,6 +1735,51 @@ declare function mergeVertices(geometry: BufferGeometry, tolerance?: number): Bu
|
|
|
1694
1735
|
declare function toTrianglesDrawMode(geometry: BufferGeometry, drawMode: TrianglesDrawModes): BufferGeometry;
|
|
1695
1736
|
declare function computeMorphedAttributes(object: Mesh | Line | Points): object;
|
|
1696
1737
|
|
|
1738
|
+
declare class ChunkData {
|
|
1739
|
+
private readonly indices;
|
|
1740
|
+
private readonly palette;
|
|
1741
|
+
private readonly paletteIds;
|
|
1742
|
+
private readonly freeIds;
|
|
1743
|
+
private readonly nbt;
|
|
1744
|
+
get(index: number): Maybe<Block>;
|
|
1745
|
+
snapshot(index: number): Maybe<() => Block>;
|
|
1746
|
+
set(index: number, block?: Block): void;
|
|
1747
|
+
clear(): void;
|
|
1748
|
+
static isAir(block: Maybe<Block>): boolean;
|
|
1749
|
+
private static copyBlock;
|
|
1750
|
+
private static validateIndex;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
type RegionInput = Uint8Array | ArrayBuffer;
|
|
1754
|
+
interface AnvilRegion {
|
|
1755
|
+
chunks: AnvilChunk[];
|
|
1756
|
+
}
|
|
1757
|
+
interface AnvilChunk {
|
|
1758
|
+
x: number;
|
|
1759
|
+
z: number;
|
|
1760
|
+
dataVersion?: number;
|
|
1761
|
+
sections: {
|
|
1762
|
+
y: number;
|
|
1763
|
+
data: ChunkData;
|
|
1764
|
+
}[];
|
|
1765
|
+
entities?: MultiBlockEntity[];
|
|
1766
|
+
}
|
|
1767
|
+
declare class AnvilParser {
|
|
1768
|
+
static getChunkList(data: RegionInput): {
|
|
1769
|
+
x: number;
|
|
1770
|
+
z: number;
|
|
1771
|
+
}[];
|
|
1772
|
+
static parse(data: RegionInput): Promise<AnvilRegion>;
|
|
1773
|
+
static parseChunk(data: RegionInput, localX: number, localZ: number): Promise<AnvilChunk | undefined>;
|
|
1774
|
+
private static bytes;
|
|
1775
|
+
private static locations;
|
|
1776
|
+
private static readChunk;
|
|
1777
|
+
private static compounds;
|
|
1778
|
+
private static integer;
|
|
1779
|
+
private static block;
|
|
1780
|
+
private static unpack;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1697
1783
|
interface BlockInfo {
|
|
1698
1784
|
/** Detached block data; use world or chunk setters to update stored blocks. */
|
|
1699
1785
|
readonly block: Block;
|
|
@@ -1730,21 +1816,6 @@ declare class Chunk {
|
|
|
1730
1816
|
chunkPosToWorldPos(pos: Vector3): Vector3;
|
|
1731
1817
|
}
|
|
1732
1818
|
|
|
1733
|
-
declare class ChunkData {
|
|
1734
|
-
private readonly indices;
|
|
1735
|
-
private readonly palette;
|
|
1736
|
-
private readonly paletteIds;
|
|
1737
|
-
private readonly freeIds;
|
|
1738
|
-
private readonly nbt;
|
|
1739
|
-
get(index: number): Maybe<Block>;
|
|
1740
|
-
snapshot(index: number): Maybe<() => Block>;
|
|
1741
|
-
set(index: number, block?: Block): void;
|
|
1742
|
-
clear(): void;
|
|
1743
|
-
static isAir(block: Maybe<Block>): boolean;
|
|
1744
|
-
private static copyBlock;
|
|
1745
|
-
private static validateIndex;
|
|
1746
|
-
}
|
|
1747
|
-
|
|
1748
1819
|
declare class MineRenderWorld {
|
|
1749
1820
|
readonly scene: MineRenderScene;
|
|
1750
1821
|
private readonly _chunks;
|
|
@@ -1758,6 +1829,8 @@ declare class MineRenderWorld {
|
|
|
1758
1829
|
setBlockAt(pos: Vector3, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
|
|
1759
1830
|
setBlockAt(pos: TripleArray, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
|
|
1760
1831
|
placeMultiBlock(multiblock: MultiBlockStructure, useBatches?: boolean, executor?: BatchedExecutor): Promise<void>;
|
|
1832
|
+
/** Replaces one chunk column's blocks. Entity NBT remains available on the parsed chunk. */
|
|
1833
|
+
placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
|
|
1761
1834
|
clear(): Promise<void>;
|
|
1762
1835
|
private updateCulling;
|
|
1763
1836
|
private getOrCreateChunkAt;
|
|
@@ -1806,4 +1879,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
|
|
|
1806
1879
|
forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
|
|
1807
1880
|
}
|
|
1808
1881
|
|
|
1809
|
-
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, 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, NodeCache, NodeEnv, 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, registerNodeEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|
|
1882
|
+
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, 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, NodeCache, NodeEnv, 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, registerNodeEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -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
|
|
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';
|
|
@@ -321,7 +321,7 @@ interface ImageInfo {
|
|
|
321
321
|
width: number;
|
|
322
322
|
height: number;
|
|
323
323
|
type?: string;
|
|
324
|
-
data: Buffer
|
|
324
|
+
data: Buffer;
|
|
325
325
|
}
|
|
326
326
|
declare class ImageLoader {
|
|
327
327
|
protected static _createImage(): CompatImage;
|
|
@@ -1143,20 +1143,27 @@ declare function isBlockObject(obj: any): obj is BlockObject;
|
|
|
1143
1143
|
interface MultiBlockStructure {
|
|
1144
1144
|
readonly size: TripleArray;
|
|
1145
1145
|
readonly blocks: MultiBlockBlock[];
|
|
1146
|
+
readonly dataVersion?: number;
|
|
1147
|
+
readonly entities?: MultiBlockEntity[];
|
|
1148
|
+
}
|
|
1149
|
+
interface MultiBlockEntity {
|
|
1150
|
+
position: TripleArray;
|
|
1151
|
+
blockPosition?: TripleArray;
|
|
1152
|
+
nbt: unknown;
|
|
1146
1153
|
}
|
|
1147
1154
|
interface MultiBlockBlock extends Block {
|
|
1148
1155
|
position: TripleArray;
|
|
1149
1156
|
}
|
|
1150
1157
|
|
|
1151
1158
|
declare class SchematicParser {
|
|
1152
|
-
static parse(): Promise<MultiBlockStructure>;
|
|
1159
|
+
static parse(nbt: NBT): Promise<MultiBlockStructure>;
|
|
1153
1160
|
}
|
|
1154
1161
|
|
|
1155
1162
|
declare class StructureParser {
|
|
1156
1163
|
static parse(_nbt: NBT, paletteIndex?: number): Promise<MultiBlockStructure>;
|
|
1157
1164
|
}
|
|
1158
1165
|
interface StructureNBT {
|
|
1159
|
-
DataVersion
|
|
1166
|
+
DataVersion?: {
|
|
1160
1167
|
type: "int";
|
|
1161
1168
|
value: number;
|
|
1162
1169
|
};
|
|
@@ -1168,7 +1175,13 @@ interface StructureNBT {
|
|
|
1168
1175
|
};
|
|
1169
1176
|
};
|
|
1170
1177
|
palette?: Palette;
|
|
1171
|
-
palettes?:
|
|
1178
|
+
palettes?: {
|
|
1179
|
+
type: "list";
|
|
1180
|
+
value: {
|
|
1181
|
+
type: "list";
|
|
1182
|
+
value: Palette["value"][];
|
|
1183
|
+
};
|
|
1184
|
+
};
|
|
1172
1185
|
blocks: {
|
|
1173
1186
|
type: "list";
|
|
1174
1187
|
value: {
|
|
@@ -1176,7 +1189,32 @@ interface StructureNBT {
|
|
|
1176
1189
|
value: BlockEntry[];
|
|
1177
1190
|
};
|
|
1178
1191
|
};
|
|
1179
|
-
entities
|
|
1192
|
+
entities?: {
|
|
1193
|
+
type: "list";
|
|
1194
|
+
value: {
|
|
1195
|
+
type: "compound";
|
|
1196
|
+
value: {
|
|
1197
|
+
pos: {
|
|
1198
|
+
type: "list";
|
|
1199
|
+
value: {
|
|
1200
|
+
type: "double";
|
|
1201
|
+
value: TripleArray;
|
|
1202
|
+
};
|
|
1203
|
+
};
|
|
1204
|
+
blockPos: {
|
|
1205
|
+
type: "list";
|
|
1206
|
+
value: {
|
|
1207
|
+
type: "int";
|
|
1208
|
+
value: TripleArray;
|
|
1209
|
+
};
|
|
1210
|
+
};
|
|
1211
|
+
nbt: {
|
|
1212
|
+
type: "compound";
|
|
1213
|
+
value: any;
|
|
1214
|
+
};
|
|
1215
|
+
}[];
|
|
1216
|
+
};
|
|
1217
|
+
};
|
|
1180
1218
|
}
|
|
1181
1219
|
interface Palette {
|
|
1182
1220
|
type: "list";
|
|
@@ -1220,9 +1258,12 @@ interface BlockEntry {
|
|
|
1220
1258
|
}
|
|
1221
1259
|
|
|
1222
1260
|
declare class NBTHelper {
|
|
1223
|
-
static fromBuffer(
|
|
1261
|
+
static fromBuffer(data: Uint8Array | ArrayBuffer, format?: NBTFormat): Promise<NBTAsset>;
|
|
1224
1262
|
}
|
|
1225
1263
|
interface NBTAsset extends MinecraftAsset, NBT {
|
|
1264
|
+
format?: NBTFormat;
|
|
1265
|
+
metadata?: Metadata;
|
|
1266
|
+
compression?: "gzip" | "none";
|
|
1226
1267
|
}
|
|
1227
1268
|
|
|
1228
1269
|
interface ResponseParser<T extends MinecraftAsset> {
|
|
@@ -1694,6 +1735,51 @@ declare function mergeVertices(geometry: BufferGeometry, tolerance?: number): Bu
|
|
|
1694
1735
|
declare function toTrianglesDrawMode(geometry: BufferGeometry, drawMode: TrianglesDrawModes): BufferGeometry;
|
|
1695
1736
|
declare function computeMorphedAttributes(object: Mesh | Line | Points): object;
|
|
1696
1737
|
|
|
1738
|
+
declare class ChunkData {
|
|
1739
|
+
private readonly indices;
|
|
1740
|
+
private readonly palette;
|
|
1741
|
+
private readonly paletteIds;
|
|
1742
|
+
private readonly freeIds;
|
|
1743
|
+
private readonly nbt;
|
|
1744
|
+
get(index: number): Maybe<Block>;
|
|
1745
|
+
snapshot(index: number): Maybe<() => Block>;
|
|
1746
|
+
set(index: number, block?: Block): void;
|
|
1747
|
+
clear(): void;
|
|
1748
|
+
static isAir(block: Maybe<Block>): boolean;
|
|
1749
|
+
private static copyBlock;
|
|
1750
|
+
private static validateIndex;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
type RegionInput = Uint8Array | ArrayBuffer;
|
|
1754
|
+
interface AnvilRegion {
|
|
1755
|
+
chunks: AnvilChunk[];
|
|
1756
|
+
}
|
|
1757
|
+
interface AnvilChunk {
|
|
1758
|
+
x: number;
|
|
1759
|
+
z: number;
|
|
1760
|
+
dataVersion?: number;
|
|
1761
|
+
sections: {
|
|
1762
|
+
y: number;
|
|
1763
|
+
data: ChunkData;
|
|
1764
|
+
}[];
|
|
1765
|
+
entities?: MultiBlockEntity[];
|
|
1766
|
+
}
|
|
1767
|
+
declare class AnvilParser {
|
|
1768
|
+
static getChunkList(data: RegionInput): {
|
|
1769
|
+
x: number;
|
|
1770
|
+
z: number;
|
|
1771
|
+
}[];
|
|
1772
|
+
static parse(data: RegionInput): Promise<AnvilRegion>;
|
|
1773
|
+
static parseChunk(data: RegionInput, localX: number, localZ: number): Promise<AnvilChunk | undefined>;
|
|
1774
|
+
private static bytes;
|
|
1775
|
+
private static locations;
|
|
1776
|
+
private static readChunk;
|
|
1777
|
+
private static compounds;
|
|
1778
|
+
private static integer;
|
|
1779
|
+
private static block;
|
|
1780
|
+
private static unpack;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1697
1783
|
interface BlockInfo {
|
|
1698
1784
|
/** Detached block data; use world or chunk setters to update stored blocks. */
|
|
1699
1785
|
readonly block: Block;
|
|
@@ -1730,21 +1816,6 @@ declare class Chunk {
|
|
|
1730
1816
|
chunkPosToWorldPos(pos: Vector3): Vector3;
|
|
1731
1817
|
}
|
|
1732
1818
|
|
|
1733
|
-
declare class ChunkData {
|
|
1734
|
-
private readonly indices;
|
|
1735
|
-
private readonly palette;
|
|
1736
|
-
private readonly paletteIds;
|
|
1737
|
-
private readonly freeIds;
|
|
1738
|
-
private readonly nbt;
|
|
1739
|
-
get(index: number): Maybe<Block>;
|
|
1740
|
-
snapshot(index: number): Maybe<() => Block>;
|
|
1741
|
-
set(index: number, block?: Block): void;
|
|
1742
|
-
clear(): void;
|
|
1743
|
-
static isAir(block: Maybe<Block>): boolean;
|
|
1744
|
-
private static copyBlock;
|
|
1745
|
-
private static validateIndex;
|
|
1746
|
-
}
|
|
1747
|
-
|
|
1748
1819
|
declare class MineRenderWorld {
|
|
1749
1820
|
readonly scene: MineRenderScene;
|
|
1750
1821
|
private readonly _chunks;
|
|
@@ -1758,6 +1829,8 @@ declare class MineRenderWorld {
|
|
|
1758
1829
|
setBlockAt(pos: Vector3, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
|
|
1759
1830
|
setBlockAt(pos: TripleArray, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
|
|
1760
1831
|
placeMultiBlock(multiblock: MultiBlockStructure, useBatches?: boolean, executor?: BatchedExecutor): Promise<void>;
|
|
1832
|
+
/** Replaces one chunk column's blocks. Entity NBT remains available on the parsed chunk. */
|
|
1833
|
+
placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
|
|
1761
1834
|
clear(): Promise<void>;
|
|
1762
1835
|
private updateCulling;
|
|
1763
1836
|
private getOrCreateChunkAt;
|
|
@@ -1806,4 +1879,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
|
|
|
1806
1879
|
forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
|
|
1807
1880
|
}
|
|
1808
1881
|
|
|
1809
|
-
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, 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, NodeCache, NodeEnv, 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, registerNodeEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|
|
1882
|
+
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, 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, NodeCache, NodeEnv, 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, registerNodeEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|