UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

38 lines (37 loc) 1.82 kB
import IFile from "../storage/IFile"; import { IEventHandler } from "ste-events"; import { IBlockResource, IBlocksCatalogResource } from "./IBlocksCatalog"; import Project from "../app/Project"; export interface BlocksCatalogDependendencies { unused: string[]; vanillaOverride: string[]; } export default class BlocksCatalogDefinition { blocksCatalog?: IBlocksCatalogResource; private _file?; private _isLoaded; private _loadedWithComments; private _onLoaded; get isLoaded(): boolean; get file(): IFile | undefined; get onLoaded(): import("ste-events").IEvent<BlocksCatalogDefinition, BlocksCatalogDefinition>; set file(newFile: IFile | undefined); static ensureOnFile(file: IFile, loadHandler?: IEventHandler<BlocksCatalogDefinition, BlocksCatalogDefinition>): Promise<BlocksCatalogDefinition>; getCatalogResource(id: string): IBlockResource; ensureCatalogResource(id: string): IBlockResource; setBlockDefinition(id: string, catalogResource: IBlockResource): IBlockResource; static getBlockCatalog(project: Project): Promise<BlocksCatalogDefinition>; static ensureBlockCatalog(project: Project): Promise<BlocksCatalogDefinition>; getDefaultTextureId(id: string): any; getTextureReferences(): string[]; getDependenciesList(project: Project): Promise<BlocksCatalogDependendencies>; removeId(id: string): void; 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>; }