minerender 2.1.0-alpha.52 → 2.1.0-alpha.53

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.
@@ -1015,17 +1015,26 @@ interface EntityObjectOptions extends SceneObjectOptions {
1015
1015
  }
1016
1016
  declare function isEntityObject(obj: any): obj is EntityObject;
1017
1017
 
1018
- /** A texture layer in GUI pixels. Later layers draw above earlier layers. */
1019
- interface GuiLayer {
1018
+ /** GUI layers use pixel coordinates. Later layers draw above earlier layers. */
1019
+ type GuiLayer = GuiTextureLayer | GuiItemLayer;
1020
+ interface GuiLayerLayout {
1020
1021
  name?: string;
1021
- texture: AssetKey | string;
1022
- /** Source-image pixels: [x, y, width, height], measured from the top left. */
1023
- crop?: [number, number, number, number];
1024
1022
  /** Top-left position; x grows right and y grows down. Defaults to [0, 0]. */
1025
1023
  position?: [number, number];
1026
- /** Output width and height. Defaults to the crop or full image size. */
1024
+ /** Output width and height; defaults to the texture crop size or [16, 16] for items. */
1027
1025
  size?: [number, number];
1028
1026
  }
1027
+ interface GuiTextureLayer extends GuiLayerLayout {
1028
+ texture: AssetKey | string;
1029
+ /** Source-image pixels: [x, y, width, height], measured from the top left. */
1030
+ crop?: [number, number, number, number];
1031
+ }
1032
+ interface GuiItemLayer extends GuiLayerLayout {
1033
+ /** Model key, such as minecraft:item/stone; uses the model's GUI display pose. */
1034
+ item: AssetKey | string;
1035
+ /** sRGB 0xRRGGBB colors by face tint index; omitted indices stay white. */
1036
+ tints?: Record<number, number>;
1037
+ }
1029
1038
 
1030
1039
  declare class GuiObject extends SceneObject {
1031
1040
  readonly textureLayers: readonly GuiLayer[];
@@ -1037,6 +1046,7 @@ declare class GuiObject extends SceneObject {
1037
1046
  private initialized;
1038
1047
  constructor(textureLayers: readonly GuiLayer[], options?: Partial<GuiObjectOptions>);
1039
1048
  init(): Promise<void>;
1049
+ private createItem;
1040
1050
  private loadMaterial;
1041
1051
  disposeAndRemoveAllChildren(): void;
1042
1052
  }
@@ -2076,4 +2086,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
2076
2086
  forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
2077
2087
  }
2078
2088
 
2079
- 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 BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, 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 FluidKind, FluidModelObject, type FluidSample, type FluidSampler, type FrameCallback, type FromTo, Geometries, GuiHelper, type GuiLayer, 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 MineRenderWorldOptions, 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 RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneExporter, type SceneGLTFExportOptions, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, 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, createFluidGeometry, createImage, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
2089
+ 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 BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, 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 FluidKind, FluidModelObject, type FluidSample, type FluidSampler, type FrameCallback, type FromTo, Geometries, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiTextureLayer, 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 MineRenderWorldOptions, 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 RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneExporter, type SceneGLTFExportOptions, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, 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, createFluidGeometry, createImage, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
@@ -1015,17 +1015,26 @@ interface EntityObjectOptions extends SceneObjectOptions {
1015
1015
  }
1016
1016
  declare function isEntityObject(obj: any): obj is EntityObject;
1017
1017
 
1018
- /** A texture layer in GUI pixels. Later layers draw above earlier layers. */
1019
- interface GuiLayer {
1018
+ /** GUI layers use pixel coordinates. Later layers draw above earlier layers. */
1019
+ type GuiLayer = GuiTextureLayer | GuiItemLayer;
1020
+ interface GuiLayerLayout {
1020
1021
  name?: string;
1021
- texture: AssetKey | string;
1022
- /** Source-image pixels: [x, y, width, height], measured from the top left. */
1023
- crop?: [number, number, number, number];
1024
1022
  /** Top-left position; x grows right and y grows down. Defaults to [0, 0]. */
1025
1023
  position?: [number, number];
1026
- /** Output width and height. Defaults to the crop or full image size. */
1024
+ /** Output width and height; defaults to the texture crop size or [16, 16] for items. */
1027
1025
  size?: [number, number];
1028
1026
  }
1027
+ interface GuiTextureLayer extends GuiLayerLayout {
1028
+ texture: AssetKey | string;
1029
+ /** Source-image pixels: [x, y, width, height], measured from the top left. */
1030
+ crop?: [number, number, number, number];
1031
+ }
1032
+ interface GuiItemLayer extends GuiLayerLayout {
1033
+ /** Model key, such as minecraft:item/stone; uses the model's GUI display pose. */
1034
+ item: AssetKey | string;
1035
+ /** sRGB 0xRRGGBB colors by face tint index; omitted indices stay white. */
1036
+ tints?: Record<number, number>;
1037
+ }
1029
1038
 
1030
1039
  declare class GuiObject extends SceneObject {
1031
1040
  readonly textureLayers: readonly GuiLayer[];
@@ -1037,6 +1046,7 @@ declare class GuiObject extends SceneObject {
1037
1046
  private initialized;
1038
1047
  constructor(textureLayers: readonly GuiLayer[], options?: Partial<GuiObjectOptions>);
1039
1048
  init(): Promise<void>;
1049
+ private createItem;
1040
1050
  private loadMaterial;
1041
1051
  disposeAndRemoveAllChildren(): void;
1042
1052
  }
@@ -2076,4 +2086,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
2076
2086
  forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
2077
2087
  }
2078
2088
 
2079
- 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 BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, 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 FluidKind, FluidModelObject, type FluidSample, type FluidSampler, type FrameCallback, type FromTo, Geometries, GuiHelper, type GuiLayer, 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 MineRenderWorldOptions, 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 RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneExporter, type SceneGLTFExportOptions, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, 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, createFluidGeometry, createImage, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
2089
+ 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 BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, 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 FluidKind, FluidModelObject, type FluidSample, type FluidSampler, type FrameCallback, type FromTo, Geometries, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiTextureLayer, 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 MineRenderWorldOptions, 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 RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneExporter, type SceneGLTFExportOptions, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, 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, createFluidGeometry, createImage, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
@@ -3535,48 +3535,6 @@ var init_SceneObject = __esm({
3535
3535
  }
3536
3536
  });
3537
3537
 
3538
- // src/model/ModelCulling.ts
3539
- var import_three22, ModelCulling;
3540
- var init_ModelCulling = __esm({
3541
- "src/model/ModelCulling.ts"() {
3542
- import_three22 = require("three");
3543
- init_CubeFace();
3544
- ModelCulling = class {
3545
- static toLocalMask(worldMask, rotation) {
3546
- let localMask = 0;
3547
- for (const [localFace, offset] of CUBE_FACE_OFFSETS.entries()) {
3548
- const normal = new import_three22.Vector3(...offset).applyEuler(rotation);
3549
- const worldFace = CUBE_FACE_OFFSETS.findIndex(([x, y, z]) => Math.abs(normal.x - x) < 1e-6 && Math.abs(normal.y - y) < 1e-6 && Math.abs(normal.z - z) < 1e-6);
3550
- if (worldFace < 0) return 0;
3551
- if (worldMask & 1 << worldFace) localMask |= 1 << localFace;
3552
- }
3553
- return localMask;
3554
- }
3555
- static isOpaqueFullCube(atlas) {
3556
- if (!atlas || atlas.hasTransparency !== false || atlas.model.elements?.length !== 1) return false;
3557
- const element = atlas.model.elements[0];
3558
- if (element.from.length !== 3 || !element.from.every((value) => value === 0) || element.to.length !== 3 || !element.to.every((value) => value === 16) || element.rotation && element.rotation.angle !== 0 || element.mappedUv?.length !== 48 || !element.mappedUv.every(Number.isFinite)) return false;
3559
- if (!(atlas.image.width > 0 && atlas.image.height > 0)) return false;
3560
- return CUBE_FACES.every((face, faceIndex) => {
3561
- const texture = element.faces[face]?.texture;
3562
- if (!texture?.startsWith("#")) return false;
3563
- const key = texture.slice(1);
3564
- const position = atlas.positions[key];
3565
- const size = atlas.sizes[key];
3566
- if (position?.length !== 2 || !position.every(Number.isFinite) || size?.length !== 2 || !size.every((value) => value > 0 && Number.isFinite(value))) return false;
3567
- for (let vertex = 0; vertex < 4; vertex++) {
3568
- const uvIndex = (faceIndex * 4 + vertex) * 2;
3569
- const x = element.mappedUv[uvIndex] * atlas.image.width;
3570
- const y = (1 - element.mappedUv[uvIndex + 1]) * atlas.image.height;
3571
- if (x < position[0] - 1e-6 || x > position[0] + size[0] + 1e-6 || y < position[1] - 1e-6 || y > position[1] + size[1] + 1e-6) return false;
3572
- }
3573
- return true;
3574
- });
3575
- }
3576
- };
3577
- }
3578
- });
3579
-
3580
3538
  // src/three/BufferGeometryUtils.js
3581
3539
  function computeTangents(geometry) {
3582
3540
  geometry.computeTangents();
@@ -3589,7 +3547,7 @@ function mergeBufferGeometries(geometries, useGroups = false) {
3589
3547
  const attributes = {};
3590
3548
  const morphAttributes = {};
3591
3549
  const morphTargetsRelative = geometries[0].morphTargetsRelative;
3592
- const mergedGeometry = new import_three24.BufferGeometry();
3550
+ const mergedGeometry = new import_three19.BufferGeometry();
3593
3551
  let offset = 0;
3594
3552
  for (let i = 0; i < geometries.length; ++i) {
3595
3553
  const geometry = geometries[i];
@@ -3713,7 +3671,7 @@ function mergeBufferAttributes(attributes) {
3713
3671
  array.set(attributes[i].array, offset);
3714
3672
  offset += attributes[i].array.length;
3715
3673
  }
3716
- return new import_three24.BufferAttribute(array, itemSize, normalized);
3674
+ return new import_three19.BufferAttribute(array, itemSize, normalized);
3717
3675
  }
3718
3676
  function interleaveAttributes(attributes) {
3719
3677
  let TypedArray;
@@ -3729,7 +3687,7 @@ function interleaveAttributes(attributes) {
3729
3687
  arrayLength += attribute.array.length;
3730
3688
  stride += attribute.itemSize;
3731
3689
  }
3732
- const interleavedBuffer = new import_three24.InterleavedBuffer(new TypedArray(arrayLength), stride);
3690
+ const interleavedBuffer = new import_three19.InterleavedBuffer(new TypedArray(arrayLength), stride);
3733
3691
  let offset = 0;
3734
3692
  const res = [];
3735
3693
  const getters = ["getX", "getY", "getZ", "getW"];
@@ -3738,7 +3696,7 @@ function interleaveAttributes(attributes) {
3738
3696
  const attribute = attributes[j];
3739
3697
  const itemSize = attribute.itemSize;
3740
3698
  const count = attribute.count;
3741
- const iba = new import_three24.InterleavedBufferAttribute(interleavedBuffer, itemSize, offset, attribute.normalized);
3699
+ const iba = new import_three19.InterleavedBufferAttribute(interleavedBuffer, itemSize, offset, attribute.normalized);
3742
3700
  res.push(iba);
3743
3701
  offset += itemSize;
3744
3702
  for (let c = 0; c < count; c++) {
@@ -3822,13 +3780,13 @@ function mergeVertices(geometry, tolerance = 1e-4) {
3822
3780
  const name = attributeNames[i];
3823
3781
  const oldAttribute = geometry.getAttribute(name);
3824
3782
  const buffer = new oldAttribute.array.constructor(attrArrays[name]);
3825
- const attribute = new import_three24.BufferAttribute(buffer, oldAttribute.itemSize, oldAttribute.normalized);
3783
+ const attribute = new import_three19.BufferAttribute(buffer, oldAttribute.itemSize, oldAttribute.normalized);
3826
3784
  result.setAttribute(name, attribute);
3827
3785
  if (name in morphAttrsArrays) {
3828
3786
  for (let j = 0; j < morphAttrsArrays[name].length; j++) {
3829
3787
  const oldMorphAttribute = geometry.morphAttributes[name][j];
3830
3788
  const buffer2 = new oldMorphAttribute.array.constructor(morphAttrsArrays[name][j]);
3831
- const morphAttribute = new import_three24.BufferAttribute(buffer2, oldMorphAttribute.itemSize, oldMorphAttribute.normalized);
3789
+ const morphAttribute = new import_three19.BufferAttribute(buffer2, oldMorphAttribute.itemSize, oldMorphAttribute.normalized);
3832
3790
  result.morphAttributes[name][j] = morphAttribute;
3833
3791
  }
3834
3792
  }
@@ -3837,11 +3795,11 @@ function mergeVertices(geometry, tolerance = 1e-4) {
3837
3795
  return result;
3838
3796
  }
3839
3797
  function toTrianglesDrawMode(geometry, drawMode) {
3840
- if (drawMode === import_three24.TrianglesDrawMode) {
3798
+ if (drawMode === import_three19.TrianglesDrawMode) {
3841
3799
  console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.");
3842
3800
  return geometry;
3843
3801
  }
3844
- if (drawMode === import_three24.TriangleFanDrawMode || drawMode === import_three24.TriangleStripDrawMode) {
3802
+ if (drawMode === import_three19.TriangleFanDrawMode || drawMode === import_three19.TriangleStripDrawMode) {
3845
3803
  let index = geometry.getIndex();
3846
3804
  if (index === null) {
3847
3805
  const indices = [];
@@ -3859,7 +3817,7 @@ function toTrianglesDrawMode(geometry, drawMode) {
3859
3817
  }
3860
3818
  const numberOfTriangles = index.count - 2;
3861
3819
  const newIndices = [];
3862
- if (drawMode === import_three24.TriangleFanDrawMode) {
3820
+ if (drawMode === import_three19.TriangleFanDrawMode) {
3863
3821
  for (let i = 1; i <= numberOfTriangles; i++) {
3864
3822
  newIndices.push(index.getX(0));
3865
3823
  newIndices.push(index.getX(i));
@@ -3895,15 +3853,15 @@ function computeMorphedAttributes(object) {
3895
3853
  console.error("THREE.BufferGeometryUtils: Geometry is not of type BufferGeometry.");
3896
3854
  return null;
3897
3855
  }
3898
- const _vA = new import_three24.Vector3();
3899
- const _vB = new import_three24.Vector3();
3900
- const _vC = new import_three24.Vector3();
3901
- const _tempA = new import_three24.Vector3();
3902
- const _tempB = new import_three24.Vector3();
3903
- const _tempC = new import_three24.Vector3();
3904
- const _morphA = new import_three24.Vector3();
3905
- const _morphB = new import_three24.Vector3();
3906
- const _morphC = new import_three24.Vector3();
3856
+ const _vA = new import_three19.Vector3();
3857
+ const _vB = new import_three19.Vector3();
3858
+ const _vC = new import_three19.Vector3();
3859
+ const _tempA = new import_three19.Vector3();
3860
+ const _tempB = new import_three19.Vector3();
3861
+ const _tempC = new import_three19.Vector3();
3862
+ const _morphA = new import_three19.Vector3();
3863
+ const _morphB = new import_three19.Vector3();
3864
+ const _morphC = new import_three19.Vector3();
3907
3865
  function _calculateMorphedAttributeData(object2, material2, attribute, morphAttribute, morphTargetsRelative2, a2, b2, c2, modifiedAttributeArray) {
3908
3866
  _vA.fromBufferAttribute(attribute, a2);
3909
3867
  _vB.fromBufferAttribute(attribute, b2);
@@ -4098,8 +4056,8 @@ function computeMorphedAttributes(object) {
4098
4056
  }
4099
4057
  }
4100
4058
  }
4101
- const morphedPositionAttribute = new import_three24.Float32BufferAttribute(modifiedPosition, 3);
4102
- const morphedNormalAttribute = new import_three24.Float32BufferAttribute(modifiedNormal, 3);
4059
+ const morphedPositionAttribute = new import_three19.Float32BufferAttribute(modifiedPosition, 3);
4060
+ const morphedNormalAttribute = new import_three19.Float32BufferAttribute(modifiedNormal, 3);
4103
4061
  return {
4104
4062
  positionAttribute,
4105
4063
  normalAttribute,
@@ -4107,10 +4065,52 @@ function computeMorphedAttributes(object) {
4107
4065
  morphedNormalAttribute
4108
4066
  };
4109
4067
  }
4110
- var import_three24;
4068
+ var import_three19;
4111
4069
  var init_BufferGeometryUtils = __esm({
4112
4070
  "src/three/BufferGeometryUtils.js"() {
4113
- import_three24 = require("three");
4071
+ import_three19 = require("three");
4072
+ }
4073
+ });
4074
+
4075
+ // src/model/ModelCulling.ts
4076
+ var import_three20, ModelCulling;
4077
+ var init_ModelCulling = __esm({
4078
+ "src/model/ModelCulling.ts"() {
4079
+ import_three20 = require("three");
4080
+ init_CubeFace();
4081
+ ModelCulling = class {
4082
+ static toLocalMask(worldMask, rotation) {
4083
+ let localMask = 0;
4084
+ for (const [localFace, offset] of CUBE_FACE_OFFSETS.entries()) {
4085
+ const normal = new import_three20.Vector3(...offset).applyEuler(rotation);
4086
+ const worldFace = CUBE_FACE_OFFSETS.findIndex(([x, y, z]) => Math.abs(normal.x - x) < 1e-6 && Math.abs(normal.y - y) < 1e-6 && Math.abs(normal.z - z) < 1e-6);
4087
+ if (worldFace < 0) return 0;
4088
+ if (worldMask & 1 << worldFace) localMask |= 1 << localFace;
4089
+ }
4090
+ return localMask;
4091
+ }
4092
+ static isOpaqueFullCube(atlas) {
4093
+ if (!atlas || atlas.hasTransparency !== false || atlas.model.elements?.length !== 1) return false;
4094
+ const element = atlas.model.elements[0];
4095
+ if (element.from.length !== 3 || !element.from.every((value) => value === 0) || element.to.length !== 3 || !element.to.every((value) => value === 16) || element.rotation && element.rotation.angle !== 0 || element.mappedUv?.length !== 48 || !element.mappedUv.every(Number.isFinite)) return false;
4096
+ if (!(atlas.image.width > 0 && atlas.image.height > 0)) return false;
4097
+ return CUBE_FACES.every((face, faceIndex) => {
4098
+ const texture = element.faces[face]?.texture;
4099
+ if (!texture?.startsWith("#")) return false;
4100
+ const key = texture.slice(1);
4101
+ const position = atlas.positions[key];
4102
+ const size = atlas.sizes[key];
4103
+ if (position?.length !== 2 || !position.every(Number.isFinite) || size?.length !== 2 || !size.every((value) => value > 0 && Number.isFinite(value))) return false;
4104
+ for (let vertex = 0; vertex < 4; vertex++) {
4105
+ const uvIndex = (faceIndex * 4 + vertex) * 2;
4106
+ const x = element.mappedUv[uvIndex] * atlas.image.width;
4107
+ const y = (1 - element.mappedUv[uvIndex + 1]) * atlas.image.height;
4108
+ if (x < position[0] - 1e-6 || x > position[0] + size[0] + 1e-6 || y < position[1] - 1e-6 || y > position[1] + size[1] + 1e-6) return false;
4109
+ }
4110
+ return true;
4111
+ });
4112
+ }
4113
+ };
4114
4114
  }
4115
4115
  });
4116
4116
 
@@ -4118,13 +4118,13 @@ var init_BufferGeometryUtils = __esm({
4118
4118
  function isModelObject(obj) {
4119
4119
  return obj.isModelObject;
4120
4120
  }
4121
- var import_three25, import_ts_deepmerge5, p9, ModelObject;
4121
+ var import_three21, import_ts_deepmerge5, p7, ModelObject;
4122
4122
  var init_ModelObject = __esm({
4123
4123
  "src/model/scene/ModelObject.ts"() {
4124
4124
  init_SceneObject();
4125
4125
  init_Materials();
4126
4126
  init_UVMapper();
4127
- import_three25 = require("three");
4127
+ import_three21 = require("three");
4128
4128
  init_BufferGeometryUtils();
4129
4129
  init_model();
4130
4130
  import_ts_deepmerge5 = __toESM(require_dist());
@@ -4132,7 +4132,7 @@ var init_ModelObject = __esm({
4132
4132
  init_CubeFace();
4133
4133
  init_DisplayTransforms();
4134
4134
  init_ModelCulling();
4135
- p9 = prefix("ModelObject");
4135
+ p7 = prefix("ModelObject");
4136
4136
  ModelObject = class _ModelObject extends SceneObject {
4137
4137
  constructor(originalModel, options) {
4138
4138
  super(options);
@@ -4181,7 +4181,7 @@ var init_ModelObject = __esm({
4181
4181
  elGeo.clearGroups();
4182
4182
  }
4183
4183
  if (this.options.uvLockRotation) {
4184
- UVMapper.lockUvs(elGeo, el.faces, this.atlas, new import_three25.Euler(...this.options.uvLockRotation));
4184
+ UVMapper.lockUvs(elGeo, el.faces, this.atlas, new import_three21.Euler(...this.options.uvLockRotation));
4185
4185
  }
4186
4186
  if (this.options.tints) {
4187
4187
  const colors = new Float32Array(elGeo.getAttribute("position").count * 3).fill(1);
@@ -4190,19 +4190,19 @@ var init_ModelObject = __esm({
4190
4190
  if (tintIndex === void 0 || tintIndex < 0) continue;
4191
4191
  const tint = this.options.tints[tintIndex];
4192
4192
  if (tint === void 0) continue;
4193
- const color = new import_three25.Color(tint);
4193
+ const color = new import_three21.Color(tint);
4194
4194
  for (let vertex = 0; vertex < 4; vertex++) {
4195
4195
  color.toArray(colors, (faceIndex * 4 + vertex) * 3);
4196
4196
  }
4197
4197
  }
4198
- elGeo.setAttribute("color", new import_three25.BufferAttribute(colors, 3));
4198
+ elGeo.setAttribute("color", new import_three21.BufferAttribute(colors, 3));
4199
4199
  }
4200
- elGeo.applyMatrix4(new import_three25.Matrix4().makeTranslation((el.to[0] - el.from[0]) / 2, (el.to[1] - el.from[1]) / 2, (el.to[2] - el.from[2]) / 2));
4201
- elGeo.applyMatrix4(new import_three25.Matrix4().makeTranslation(el.from[0], el.from[1], el.from[2]));
4200
+ elGeo.applyMatrix4(new import_three21.Matrix4().makeTranslation((el.to[0] - el.from[0]) / 2, (el.to[1] - el.from[1]) / 2, (el.to[2] - el.from[2]) / 2));
4201
+ elGeo.applyMatrix4(new import_three21.Matrix4().makeTranslation(el.from[0], el.from[1], el.from[2]));
4202
4202
  if (el.rotation) {
4203
4203
  applyElementRotation(el.rotation, elGeo);
4204
4204
  }
4205
- elGeo.applyMatrix4(new import_three25.Matrix4().makeTranslation(-8, -8, -8));
4205
+ elGeo.applyMatrix4(new import_three21.Matrix4().makeTranslation(-8, -8, -8));
4206
4206
  if (displayTransform) DisplayTransforms.apply(elGeo, displayTransform);
4207
4207
  if (this.options.mergeMeshes) {
4208
4208
  allGeos.push(elGeo);
@@ -4214,17 +4214,17 @@ var init_ModelObject = __esm({
4214
4214
  }
4215
4215
  });
4216
4216
  } else {
4217
- console.debug(p9, this.atlas.model, "has no elements");
4217
+ console.debug(p7, this.atlas.model, "has no elements");
4218
4218
  }
4219
4219
  } else {
4220
- console.debug(p9, "Missing atlas for", this);
4220
+ console.debug(p7, "Missing atlas for", this);
4221
4221
  }
4222
4222
  if (this.options.mergeMeshes) {
4223
4223
  let combinedGeo;
4224
4224
  if (allGeos.length > 0) {
4225
4225
  combinedGeo = mergeBufferGeometries(allGeos);
4226
4226
  } else {
4227
- combinedGeo = new import_three25.BoxGeometry(16, 16, 16);
4227
+ combinedGeo = new import_three21.BoxGeometry(16, 16, 16);
4228
4228
  if (displayTransform) DisplayTransforms.apply(combinedGeo, displayTransform);
4229
4229
  }
4230
4230
  combinedGeo.computeBoundingBox();
@@ -7712,19 +7712,31 @@ var GuiHelper = class {
7712
7712
  };
7713
7713
 
7714
7714
  // src/gui/scene/GuiObject.ts
7715
- var import_three19 = require("three");
7715
+ var import_three22 = require("three");
7716
7716
  init_AssetKey();
7717
7717
  init_ModelTextures();
7718
+ init_Models();
7718
7719
  init_Caching();
7719
7720
  init_SceneObject();
7720
7721
  init_Materials();
7722
+ init_ModelObject();
7723
+ init_DisplayPosition();
7724
+
7725
+ // src/model/GuiLight.ts
7726
+ var GuiLight = /* @__PURE__ */ ((GuiLight2) => {
7727
+ GuiLight2["FRONT"] = "front";
7728
+ GuiLight2["SIDE"] = "side";
7729
+ return GuiLight2;
7730
+ })(GuiLight || {});
7731
+
7732
+ // src/gui/scene/GuiObject.ts
7721
7733
  var GuiObject = class extends SceneObject {
7722
7734
  constructor(textureLayers, options) {
7723
7735
  super({ ...options, instanceMeshes: false, mergeMeshes: false });
7724
7736
  this.textureLayers = textureLayers;
7725
7737
  this.isGuiObject = true;
7726
7738
  /** Local bounds in GUI pixels, with y growing down from the origin. */
7727
- this.bounds = new import_three19.Box2();
7739
+ this.bounds = new import_three22.Box2();
7728
7740
  this.geometries = /* @__PURE__ */ new Set();
7729
7741
  this.ownedMaterials = /* @__PURE__ */ new Set();
7730
7742
  this.initialized = false;
@@ -7732,14 +7744,35 @@ var GuiObject = class extends SceneObject {
7732
7744
  async init() {
7733
7745
  if (this.initialized) return;
7734
7746
  try {
7747
+ let depth = 0;
7735
7748
  for (const [index, layer] of this.textureLayers.entries()) {
7749
+ const [x, y] = layer.position ?? [0, 0];
7750
+ if ("item" in layer) {
7751
+ const [width2, height2] = layer.size ?? [16, 16];
7752
+ const item = await this.createItem(layer, index);
7753
+ item.position.set(x + width2 / 2, -y - height2 / 2, 0);
7754
+ item.scale.set(width2 / 16, height2 / 16, width2 / 16);
7755
+ item.updateMatrix();
7756
+ const bounds = new import_three22.Box3();
7757
+ item.iterateAllMeshes((mesh2) => {
7758
+ mesh2.geometry.computeBoundingBox();
7759
+ bounds.union(mesh2.geometry.boundingBox);
7760
+ });
7761
+ bounds.applyMatrix4(item.matrix);
7762
+ item.position.z = depth - bounds.min.z;
7763
+ depth += bounds.max.z - bounds.min.z + 0.01;
7764
+ this.bounds.expandByPoint(new import_three22.Vector2(x, y));
7765
+ this.bounds.expandByPoint(new import_three22.Vector2(x + width2, y + height2));
7766
+ this.bounds.expandByPoint(new import_three22.Vector2(bounds.min.x, -bounds.max.y));
7767
+ this.bounds.expandByPoint(new import_three22.Vector2(bounds.max.x, -bounds.min.y));
7768
+ continue;
7769
+ }
7736
7770
  const key = typeof layer.texture === "string" ? AssetKey.parse("textures", layer.texture) : layer.texture;
7737
7771
  const material = await this.loadMaterial(key);
7738
7772
  const image = material.map.image;
7739
7773
  const [cropX, cropY, cropWidth, cropHeight] = layer.crop ?? [0, 0, image.width, image.height];
7740
7774
  const [width, height] = layer.size ?? [cropWidth, cropHeight];
7741
- const [x, y] = layer.position ?? [0, 0];
7742
- const geometry = new import_three19.PlaneGeometry(width, height);
7775
+ const geometry = new import_three22.PlaneGeometry(width, height);
7743
7776
  this.geometries.add(geometry);
7744
7777
  const uv = geometry.getAttribute("uv");
7745
7778
  for (let i = 0; i < uv.count; i++) {
@@ -7749,14 +7782,16 @@ var GuiObject = class extends SceneObject {
7749
7782
  1 - (cropY + (1 - uv.getY(i)) * cropHeight) / image.height
7750
7783
  );
7751
7784
  }
7752
- const mesh = new import_three19.Mesh(geometry, material);
7785
+ const mesh = new import_three22.Mesh(geometry, material);
7753
7786
  mesh.name = `mesh:${layer.name ?? index}`;
7754
- mesh.position.set(x + width / 2, -y - height / 2, 0);
7787
+ mesh.position.set(x + width / 2, -y - height / 2, depth);
7755
7788
  mesh.renderOrder = index;
7756
7789
  this.add(mesh);
7757
- this.bounds.expandByPoint(new import_three19.Vector2(x, y));
7758
- this.bounds.expandByPoint(new import_three19.Vector2(x + width, y + height));
7790
+ this.bounds.expandByPoint(new import_three22.Vector2(x, y));
7791
+ this.bounds.expandByPoint(new import_three22.Vector2(x + width, y + height));
7792
+ depth += 0.01;
7759
7793
  }
7794
+ for (const child of this.children) child.position.z -= depth - 0.01;
7760
7795
  this.initialized = true;
7761
7796
  this.notifyDirty();
7762
7797
  } catch (error) {
@@ -7764,6 +7799,32 @@ var GuiObject = class extends SceneObject {
7764
7799
  throw error;
7765
7800
  }
7766
7801
  }
7802
+ async createItem(layer, index) {
7803
+ const key = typeof layer.item === "string" ? AssetKey.parse("models", layer.item) : layer.item;
7804
+ const model = await Models.getMerged(key);
7805
+ if (!model) throw new Error(`Could not load GUI item ${key.toNamespacedString()}`);
7806
+ const item = new ModelObject(model, {
7807
+ displayPosition: "gui" /* GUI */,
7808
+ tints: layer.tints,
7809
+ instanceMeshes: false,
7810
+ mergeMeshes: true
7811
+ });
7812
+ item.name = `group:${layer.name ?? index}`;
7813
+ this.add(item);
7814
+ await item.init();
7815
+ item.iterateAllMeshes((mesh) => {
7816
+ this.geometries.add(mesh.geometry);
7817
+ mesh.name = `mesh:${layer.name ?? index}`;
7818
+ mesh.renderOrder = index;
7819
+ for (const material of Array.isArray(mesh.material) ? mesh.material : [mesh.material]) {
7820
+ material.transparent = true;
7821
+ if (model.gui_light === "front" /* FRONT */ && material.uniforms?.SHADE) {
7822
+ material.uniforms.SHADE.value = false;
7823
+ }
7824
+ }
7825
+ });
7826
+ return item;
7827
+ }
7767
7828
  async loadMaterial(key) {
7768
7829
  const assetKey = key.serialize();
7769
7830
  const materialKey = `gui:${assetKey}`;
@@ -7802,21 +7863,21 @@ function isGuiObject(obj) {
7802
7863
  init_image();
7803
7864
 
7804
7865
  // src/inspector/SceneInspector.ts
7805
- var import_three20 = require("three");
7866
+ var import_three23 = require("three");
7806
7867
  init_SceneObject();
7807
7868
  init_util();
7808
7869
  init_log();
7809
7870
  init_three();
7810
- var p7 = prefix("SceneInspector");
7871
+ var p8 = prefix("SceneInspector");
7811
7872
  var help = "<span>Ctrl/Cmd+Click to Select<br/></span><br/>";
7812
7873
  var SceneInspector = class {
7813
7874
  constructor(renderer) {
7814
7875
  this.renderer = renderer;
7815
- this.mouse = new import_three20.Vector2();
7876
+ this.mouse = new import_three23.Vector2();
7816
7877
  this.listeners = new AbortController();
7817
7878
  this.objectInfoContainer = document.createElement("div");
7818
7879
  this.objectControlsContainer = document.createElement("div");
7819
- this.raycaster = new import_three20.Raycaster();
7880
+ this.raycaster = new import_three23.Raycaster();
7820
7881
  this.init();
7821
7882
  }
7822
7883
  init() {
@@ -7901,7 +7962,7 @@ var SceneInspector = class {
7901
7962
  }
7902
7963
  selectObject(targetObject, targetIntersection, instance = this.getIntersectionInstance(targetIntersection)) {
7903
7964
  this.selectedObject = targetObject;
7904
- console.log(p7, "selected", targetObject);
7965
+ console.log(p8, "selected", targetObject);
7905
7966
  this.redraw(targetObject, targetIntersection, instance);
7906
7967
  }
7907
7968
  redraw(targetObject, targetIntersection, instance) {
@@ -8160,7 +8221,7 @@ var SceneStatsDisplay = class {
8160
8221
 
8161
8222
  // src/instance/InstanceManager.ts
8162
8223
  init_log();
8163
- var p8 = prefix("InstanceManager");
8224
+ var p9 = prefix("InstanceManager");
8164
8225
  var InstanceManager = class {
8165
8226
  constructor() {
8166
8227
  this.isInstanceManager = true;
@@ -8168,7 +8229,7 @@ var InstanceManager = class {
8168
8229
  }
8169
8230
  async get(key) {
8170
8231
  if (key in this.instanceCache) {
8171
- console.debug(p8, "key in cache", key);
8232
+ console.debug(p9, "key in cache", key);
8172
8233
  return (await this.instanceCache[key]).nextInstance();
8173
8234
  }
8174
8235
  return void 0;
@@ -8177,7 +8238,7 @@ var InstanceManager = class {
8177
8238
  if (key in this.instanceCache) {
8178
8239
  return await this.get(key);
8179
8240
  }
8180
- console.debug(p8, "key not in cache", key);
8241
+ console.debug(p9, "key not in cache", key);
8181
8242
  const pending = Promise.resolve().then(supplier).then((obj) => obj.nextInstance());
8182
8243
  this.instanceCache[key] = pending;
8183
8244
  try {
@@ -8211,13 +8272,6 @@ function isInstanceable(obj) {
8211
8272
  init_DisplayPosition();
8212
8273
  init_DisplayTransforms();
8213
8274
 
8214
- // src/model/GuiLight.ts
8215
- var GuiLight = /* @__PURE__ */ ((GuiLight2) => {
8216
- GuiLight2["FRONT"] = "front";
8217
- GuiLight2["SIDE"] = "side";
8218
- return GuiLight2;
8219
- })(GuiLight || {});
8220
-
8221
8275
  // src/model/Model.ts
8222
8276
  var ITEM_GENERATED = "item/generated";
8223
8277
  var BUILTIN_GENERATED = "builtin/generated";
@@ -8239,7 +8293,7 @@ init_ModelGenerator();
8239
8293
  init_ModelMerger();
8240
8294
 
8241
8295
  // src/model/block/BlockStateResolver.ts
8242
- var import_three23 = require("three");
8296
+ var import_three25 = require("three");
8243
8297
  init_BlockStates();
8244
8298
  init_MineRenderError();
8245
8299
  init_util();
@@ -8317,7 +8371,7 @@ var BlockStateResolver = class {
8317
8371
  return variants[variants.length - 1];
8318
8372
  }
8319
8373
  static rotation(variant) {
8320
- const rotation = new import_three23.Euler();
8374
+ const rotation = new import_three25.Euler();
8321
8375
  if (typeof variant.x !== "undefined") {
8322
8376
  rotation.x = toRadians(clampRotationDegrees(variant.x));
8323
8377
  }