UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

82 lines (81 loc) 3.54 kB
import IFile from "../storage/IFile"; import { IEventHandler } from "ste-events"; import { IEntityTypeResourceDescription } from "./IEntityTypeResource"; import Project from "../app/Project"; import ProjectItem from "../app/ProjectItem"; import RelationsIndex from "../app/RelationsIndex"; import IProjectItemRelationship from "../app/IProjectItemRelationship"; export default class EntityTypeResourceDefinition { private _dataWrapper?; private _file?; private _isLoaded; private _loadedWithComments; private _data?; private _onLoaded; get isLoaded(): boolean; get dataWrapper(): IEntityTypeResourceDescription; get data(): IEntityTypeResourceDescription; get file(): IFile | undefined; get onLoaded(): import("ste-events").IEvent<EntityTypeResourceDefinition, EntityTypeResourceDefinition>; set file(newFile: IFile | undefined); get id(): string | undefined; set id(newId: string | undefined); get textures(): { [identifier: string]: string; }; getCanonicalizedTexturesList(): any[]; get texturesIdList(): any[]; get renderControllerIdList(): string[] | undefined; get animationControllerIdList(): string[] | undefined; get animationControllerList(): string[] | undefined; get animationIdList(): string[] | undefined; get animationList(): string[] | undefined; get geometry(): { [identifier: string]: string; }; get geometryList(): any[]; /** * Get a list of all geometry/texture variant keys (e.g., "default", "warm", "cold") */ get variantKeys(): string[]; /** * Get the geometry ID for a specific variant key (e.g., "default") * Falls back to first available geometry if key not found */ getGeometryByKey(key: string): string | undefined; /** * Get the texture path for a specific variant key (e.g., "default") * Falls back to first available texture if key not found */ getTextureByKey(key: string): string | undefined; /** * Get matched geometry and texture for a specific variant key * This ensures the geometry and texture are paired correctly */ getMatchedGeometryAndTexture(key?: string): { geometryId?: string; texturePath?: string; }; ensureAnimationAndGetShortName(animationFullName: string): string | undefined; ensureAnimationAndScript(animationFullName: string): void; getTextureItems(entityTypeResourceProjectItem: ProjectItem): { [name: string]: ProjectItem; } | undefined; getIsVersion1_8_0OrLower(): boolean; getIsVersion1_10_0OrHigher(): boolean; getFormatVersion(): number[]; get formatVersion(): string; static ensureOnFile(file: IFile, loadHandler?: IEventHandler<EntityTypeResourceDefinition, EntityTypeResourceDefinition>): Promise<EntityTypeResourceDefinition>; ensureData(): IEntityTypeResourceDescription; persist(): boolean; /** * Loads the definition from the file. * @param preserveComments If true, uses comment-preserving JSON parsing for edit/save cycles. * If false (default), uses efficient standard JSON parsing. * Can be called again with true to "upgrade" a read-only load to read/write. */ load(preserveComments?: boolean): Promise<void>; deleteLinkToChild(rel: IProjectItemRelationship): Promise<void>; getPackRootFolder(): any; addChildItems(project: Project, item: ProjectItem, index?: RelationsIndex): Promise<void>; }