minerender 2.1.0-alpha.60 → 2.1.0-alpha.61

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.
@@ -448,7 +448,24 @@ interface ItemModel extends Model {
448
448
  textures?: ItemModelTextures;
449
449
  gui_light?: GuiLight;
450
450
  special?: SpecialItemRenderer;
451
+ tints?: ItemTintSource[];
451
452
  }
453
+ type ItemTintColor = number | TripleArray;
454
+ type ItemTintSource = {
455
+ type: "constant" | "minecraft:constant";
456
+ value: ItemTintColor;
457
+ } | {
458
+ type: "grass" | "minecraft:grass";
459
+ temperature: number;
460
+ downfall: number;
461
+ } | {
462
+ type: "dye" | "minecraft:dye" | "potion" | "minecraft:potion" | "map_color" | "minecraft:map_color" | "firework" | "minecraft:firework" | "team" | "minecraft:team";
463
+ default: ItemTintColor;
464
+ } | {
465
+ type: "custom_model_data" | "minecraft:custom_model_data";
466
+ index?: number;
467
+ default: ItemTintColor;
468
+ };
452
469
  type SpecialItemRenderer = {
453
470
  type: "chest" | "minecraft:chest";
454
471
  texture: string;
@@ -973,6 +990,12 @@ declare class DisplayTransforms {
973
990
  static apply(geometry: BufferGeometry, matrix: Matrix4): void;
974
991
  }
975
992
 
993
+ declare class ItemTints {
994
+ /** Resolves preview colors from item definitions; explicit per-index colors take precedence. */
995
+ static get(model: Model, tints?: Record<number, number>): Promise<Record<number, number> | undefined>;
996
+ private static rgb;
997
+ }
998
+
976
999
  declare class ModelCulling {
977
1000
  static toLocalMask(worldMask: number, rotation: Euler): number;
978
1001
  static isOpaqueFullCube(atlas: Maybe<TextureAtlas>): boolean;
@@ -1021,7 +1044,6 @@ declare class BlockStateResolver {
1021
1044
  declare class BlockTints {
1022
1045
  /** Resolves block preview colors without biome context; explicit tints take precedence. */
1023
1046
  static get(key: AssetKey | undefined, state: BlockStateProperties, model: Model, tints?: Record<number, number>): Promise<Record<number, number> | undefined>;
1024
- private static grassColor;
1025
1047
  }
1026
1048
 
1027
1049
  interface Instanceable {
@@ -2160,6 +2182,11 @@ declare class Skins {
2160
2182
  private static getMcProxyCapeUrl;
2161
2183
  }
2162
2184
 
2185
+ declare class Colormaps {
2186
+ /** Samples the selected resource pack's grass colormap using Minecraft's climate coordinates. */
2187
+ static grassColor(origin?: AssetKey, temperature?: number, downfall?: number): Promise<number>;
2188
+ }
2189
+
2163
2190
  declare class TextureLoader {
2164
2191
  private static readonly failedTextures;
2165
2192
  /** Reports whether image loading failed, so cached textures can be retried. */
@@ -2371,4 +2398,4 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
2371
2398
  */
2372
2399
  declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
2373
2400
 
2374
- 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, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, 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, 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, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, 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 GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, 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, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, 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 SpecialItemPart, type SpecialItemRenderer, SpecialItems, 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, entityAnimationTime, 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, probeImageSize, registerBrowserEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
2401
+ 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, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, 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, BrowserCache, BrowserEnv, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, 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, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, 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 GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiTextureLayer, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, 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, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, 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 SpecialItemPart, type SpecialItemRenderer, SpecialItems, 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, entityAnimationTime, 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, probeImageSize, registerBrowserEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
@@ -448,7 +448,24 @@ interface ItemModel extends Model {
448
448
  textures?: ItemModelTextures;
449
449
  gui_light?: GuiLight;
450
450
  special?: SpecialItemRenderer;
451
+ tints?: ItemTintSource[];
451
452
  }
453
+ type ItemTintColor = number | TripleArray;
454
+ type ItemTintSource = {
455
+ type: "constant" | "minecraft:constant";
456
+ value: ItemTintColor;
457
+ } | {
458
+ type: "grass" | "minecraft:grass";
459
+ temperature: number;
460
+ downfall: number;
461
+ } | {
462
+ type: "dye" | "minecraft:dye" | "potion" | "minecraft:potion" | "map_color" | "minecraft:map_color" | "firework" | "minecraft:firework" | "team" | "minecraft:team";
463
+ default: ItemTintColor;
464
+ } | {
465
+ type: "custom_model_data" | "minecraft:custom_model_data";
466
+ index?: number;
467
+ default: ItemTintColor;
468
+ };
452
469
  type SpecialItemRenderer = {
453
470
  type: "chest" | "minecraft:chest";
454
471
  texture: string;
@@ -973,6 +990,12 @@ declare class DisplayTransforms {
973
990
  static apply(geometry: BufferGeometry, matrix: Matrix4): void;
974
991
  }
975
992
 
993
+ declare class ItemTints {
994
+ /** Resolves preview colors from item definitions; explicit per-index colors take precedence. */
995
+ static get(model: Model, tints?: Record<number, number>): Promise<Record<number, number> | undefined>;
996
+ private static rgb;
997
+ }
998
+
976
999
  declare class ModelCulling {
977
1000
  static toLocalMask(worldMask: number, rotation: Euler): number;
978
1001
  static isOpaqueFullCube(atlas: Maybe<TextureAtlas>): boolean;
@@ -1021,7 +1044,6 @@ declare class BlockStateResolver {
1021
1044
  declare class BlockTints {
1022
1045
  /** Resolves block preview colors without biome context; explicit tints take precedence. */
1023
1046
  static get(key: AssetKey | undefined, state: BlockStateProperties, model: Model, tints?: Record<number, number>): Promise<Record<number, number> | undefined>;
1024
- private static grassColor;
1025
1047
  }
1026
1048
 
1027
1049
  interface Instanceable {
@@ -2160,6 +2182,11 @@ declare class Skins {
2160
2182
  private static getMcProxyCapeUrl;
2161
2183
  }
2162
2184
 
2185
+ declare class Colormaps {
2186
+ /** Samples the selected resource pack's grass colormap using Minecraft's climate coordinates. */
2187
+ static grassColor(origin?: AssetKey, temperature?: number, downfall?: number): Promise<number>;
2188
+ }
2189
+
2163
2190
  declare class TextureLoader {
2164
2191
  private static readonly failedTextures;
2165
2192
  /** Reports whether image loading failed, so cached textures can be retried. */
@@ -2371,4 +2398,4 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
2371
2398
  */
2372
2399
  declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
2373
2400
 
2374
- 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, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, 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, 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, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, 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 GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, 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, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, 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 SpecialItemPart, type SpecialItemRenderer, SpecialItems, 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, entityAnimationTime, 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, probeImageSize, registerBrowserEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
2401
+ 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, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, 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, BrowserCache, BrowserEnv, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, 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, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, 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 GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiTextureLayer, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, 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, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, 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 SpecialItemPart, type SpecialItemRenderer, SpecialItems, 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, entityAnimationTime, 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, probeImageSize, registerBrowserEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
@@ -1452,7 +1452,7 @@ var init_Models = __esm({
1452
1452
  }
1453
1453
  static async getItemModel(key) {
1454
1454
  const itemKey = new AssetKey(key.namespace, key.path, "items", void 0, key.rootType, ".json", key.root);
1455
- const model = await this.PERSISTENT_CACHE.getOrLoad(AssetLoader.persistentKey(itemKey.serialize()), async () => {
1455
+ const model = await this.PERSISTENT_CACHE.getOrLoad(`item-v2:${AssetLoader.persistentKey(itemKey.serialize())}`, async () => {
1456
1456
  const result = await AssetLoader.getFirst([itemKey, key], "json" /* JSON */);
1457
1457
  if (!result) return void 0;
1458
1458
  if (result.key.assetType !== "items") return { ...result.asset, key };
@@ -1461,7 +1461,7 @@ var init_Models = __esm({
1461
1461
  modelKey.root = key.root;
1462
1462
  const model2 = await this.getRaw(modelKey);
1463
1463
  if (!model2) throw new Error(`Item ${key.toNamespacedString()} references missing model ${selected.model}`);
1464
- return selected.special ? { ...model2, special: selected.special } : model2;
1464
+ return { ...model2, ...selected.special && { special: selected.special }, ...selected.tints && { tints: selected.tints } };
1465
1465
  });
1466
1466
  return model ? { ...model, key: Object.assign(new AssetKey("", ""), model.key) } : void 0;
1467
1467
  }
@@ -1472,7 +1472,7 @@ var init_Models = __esm({
1472
1472
  }
1473
1473
  switch (node.type.replace(/^minecraft:/, "")) {
1474
1474
  case "model":
1475
- if (typeof node.model === "string" && node.model) return { model: node.model };
1475
+ if (typeof node.model === "string" && node.model) return { model: node.model, tints: node.tints };
1476
1476
  break;
1477
1477
  case "special": {
1478
1478
  if (!node.base || !node.model || typeof node.model !== "object") break;
@@ -4830,6 +4830,87 @@ var init_GuiLight = __esm({
4830
4830
  }
4831
4831
  });
4832
4832
 
4833
+ // src/texture/Colormaps.ts
4834
+ var Colormaps;
4835
+ var init_Colormaps = __esm({
4836
+ "src/texture/Colormaps.ts"() {
4837
+ init_AssetKey();
4838
+ init_ModelTextures();
4839
+ init_Caching();
4840
+ init_MineRenderError();
4841
+ Colormaps = class {
4842
+ /** Samples the selected resource pack's grass colormap using Minecraft's climate coordinates. */
4843
+ static async grassColor(origin, temperature = 0.5, downfall = 1) {
4844
+ const key = AssetKey.parse("textures", "minecraft:colormap/grass", origin);
4845
+ const temp = Math.fround(temperature);
4846
+ const rain = Math.fround(downfall) * temp;
4847
+ const x = Math.floor((1 - temp) * 255), y = Math.floor((1 - rain) * 255);
4848
+ return await Caching.blockTintCache.get(`${key.serialize()}|${x},${y}`, async () => {
4849
+ const image = await ModelTextures.get(key);
4850
+ if (!image) throw new MineRenderError(`Missing grass colormap: ${key.toNamespacedString()}`);
4851
+ if (image.width !== 256 || image.height !== 256) {
4852
+ throw new MineRenderError("Grass colormaps must be 256 \xD7 256 pixels");
4853
+ }
4854
+ const [red, green, blue] = image.data.getImageData(x, y, 1, 1).data;
4855
+ return red << 16 | green << 8 | blue;
4856
+ });
4857
+ }
4858
+ };
4859
+ }
4860
+ });
4861
+
4862
+ // src/model/ItemTints.ts
4863
+ var ItemTints;
4864
+ var init_ItemTints = __esm({
4865
+ "src/model/ItemTints.ts"() {
4866
+ init_MineRenderError();
4867
+ init_Colormaps();
4868
+ ItemTints = class {
4869
+ /** Resolves preview colors from item definitions; explicit per-index colors take precedence. */
4870
+ static async get(model, tints) {
4871
+ const sources = model.tints;
4872
+ if (!sources?.length) return tints;
4873
+ const colors = { ...tints };
4874
+ await Promise.all(sources.map(async (source, index) => {
4875
+ if (colors[index] !== void 0) return;
4876
+ switch (source.type) {
4877
+ case "constant":
4878
+ case "minecraft:constant":
4879
+ colors[index] = this.rgb(source.value);
4880
+ break;
4881
+ case "grass":
4882
+ case "minecraft:grass":
4883
+ colors[index] = await Colormaps.grassColor(model.key, source.temperature, source.downfall);
4884
+ break;
4885
+ case "dye":
4886
+ case "minecraft:dye":
4887
+ case "potion":
4888
+ case "minecraft:potion":
4889
+ case "map_color":
4890
+ case "minecraft:map_color":
4891
+ case "firework":
4892
+ case "minecraft:firework":
4893
+ case "team":
4894
+ case "minecraft:team":
4895
+ case "custom_model_data":
4896
+ case "minecraft:custom_model_data":
4897
+ colors[index] = this.rgb(source.default);
4898
+ break;
4899
+ default:
4900
+ throw new MineRenderError(`Unsupported item tint source ${source.type}`);
4901
+ }
4902
+ }));
4903
+ return colors;
4904
+ }
4905
+ static rgb(color) {
4906
+ if (!Array.isArray(color)) return color & 16777215;
4907
+ const [red, green, blue] = color.map((channel) => Math.floor(Math.fround(Math.fround(channel) * 255)));
4908
+ return red << 16 | green << 8 | blue;
4909
+ }
4910
+ };
4911
+ }
4912
+ });
4913
+
4833
4914
  // src/model/scene/ModelObject.ts
4834
4915
  function isModelObject(obj) {
4835
4916
  return obj.isModelObject;
@@ -4852,6 +4933,7 @@ var init_ModelObject = __esm({
4852
4933
  init_SpecialItems();
4853
4934
  init_EntityObject();
4854
4935
  init_GuiLight();
4936
+ init_ItemTints();
4855
4937
  p7 = prefix("ModelObject");
4856
4938
  _ModelObject = class _ModelObject extends SceneObject {
4857
4939
  constructor(originalModel, options) {
@@ -4867,6 +4949,7 @@ var init_ModelObject = __esm({
4867
4949
  this.addEventListener("removed", () => this.updateAnimationSubscription());
4868
4950
  }
4869
4951
  async init() {
4952
+ this.options.tints = await ItemTints.get(this.originalModel, this.options.tints);
4870
4953
  const special = this.originalModel.special;
4871
4954
  if (special) {
4872
4955
  const parts = await SpecialItems.getParts(special, this.originalModel.key?.root);
@@ -5323,6 +5406,7 @@ __export(index_browser_exports, {
5323
5406
  CanvasImage: () => CanvasImage,
5324
5407
  Chunk: () => Chunk,
5325
5408
  ChunkData: () => ChunkData,
5409
+ Colormaps: () => Colormaps,
5326
5410
  CubeFace: () => CubeFace,
5327
5411
  CubeFaceIndex: () => CubeFaceIndex,
5328
5412
  DEFAULT_ELEMENTS: () => DEFAULT_ELEMENTS,
@@ -5348,6 +5432,7 @@ __export(index_browser_exports, {
5348
5432
  ImageLoader: () => ImageLoader,
5349
5433
  InstanceManager: () => InstanceManager,
5350
5434
  InstanceReference: () => InstanceReference,
5435
+ ItemTints: () => ItemTints,
5351
5436
  MapControls: () => MapControls,
5352
5437
  Materials: () => Materials,
5353
5438
  Meshes: () => Meshes,
@@ -8885,6 +8970,7 @@ function isInstanceable(obj) {
8885
8970
  init_DisplayPosition();
8886
8971
  init_DisplayTransforms();
8887
8972
  init_GuiLight();
8973
+ init_ItemTints();
8888
8974
  init_Model();
8889
8975
  init_ModelCulling();
8890
8976
  init_ModelGenerator();
@@ -8982,10 +9068,7 @@ var BlockStateResolver = class {
8982
9068
  };
8983
9069
 
8984
9070
  // src/model/block/BlockTints.ts
8985
- init_AssetKey();
8986
- init_ModelTextures();
8987
- init_Caching();
8988
- init_MineRenderError();
9071
+ init_Colormaps();
8989
9072
 
8990
9073
  // src/model/block/blockTints.json
8991
9074
  var blockTints_default = {
@@ -9040,7 +9123,7 @@ var BlockTints = class {
9040
9123
  color = rule.color;
9041
9124
  break;
9042
9125
  case "grass":
9043
- color = await this.grassColor(key);
9126
+ color = await Colormaps.grassColor(key);
9044
9127
  break;
9045
9128
  case "redstone": {
9046
9129
  const power = Number(state.power ?? 0) / 15;
@@ -9058,18 +9141,6 @@ var BlockTints = class {
9058
9141
  }
9059
9142
  return { ...Object.fromEntries([...indices].map((index) => [index, color])), ...tints };
9060
9143
  }
9061
- static async grassColor(origin) {
9062
- const key = AssetKey.parse("textures", "minecraft:colormap/grass", origin);
9063
- return await Caching.blockTintCache.get(key.serialize(), async () => {
9064
- const image = await ModelTextures.get(key);
9065
- if (!image) throw new MineRenderError(`Missing grass colormap: ${key.toNamespacedString()}`);
9066
- if (image.width !== 256 || image.height !== 256) {
9067
- throw new MineRenderError("Grass colormaps must be 256 \xD7 256 pixels");
9068
- }
9069
- const [red, green, blue] = image.data.getImageData(127, 127, 1, 1).data;
9070
- return red << 16 | green << 8 | blue;
9071
- });
9072
- }
9073
9144
  };
9074
9145
 
9075
9146
  // src/model/block/scene/BlockObject.ts
@@ -12324,6 +12395,7 @@ var SkinObject = class extends SceneObject {
12324
12395
 
12325
12396
  // src/renderer/MineRenderScene.ts
12326
12397
  init_EntityObject();
12398
+ init_ItemTints();
12327
12399
  var _MineRenderScene = class _MineRenderScene extends import_three32.Scene {
12328
12400
  constructor(options) {
12329
12401
  super();
@@ -12416,6 +12488,7 @@ var _MineRenderScene = class _MineRenderScene extends import_three32.Scene {
12416
12488
  }
12417
12489
  }
12418
12490
  async addModel(model, options, parent = this) {
12491
+ options = { ...options, tints: await ItemTints.get(model, options?.tints) };
12419
12492
  return this.addSceneObject(model, () => new ModelObject(model, options), options, parent);
12420
12493
  }
12421
12494
  async addBlock(blockState, options, parent = this) {
@@ -13679,6 +13752,7 @@ var Skins = class {
13679
13752
  };
13680
13753
 
13681
13754
  // src/texture/index.ts
13755
+ init_Colormaps();
13682
13756
  init_TextureAtlas();
13683
13757
  init_TextureLoader();
13684
13758
  init_Textures();