UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

26 lines (25 loc) 1.07 kB
import IFile from "../storage/IFile"; import { IEventHandler } from "ste-events"; import { IMaterialWrapper } from "./IMaterial"; export default class Material { private _file?; private _isLoaded; private _loadedWithComments; definition?: IMaterialWrapper; private _onLoaded; get isLoaded(): boolean; get file(): IFile | undefined; set file(newFile: IFile | undefined); get onLoaded(): import("ste-events").IEvent<Material, Material>; get version(): string | undefined; static ensureOnFile(file: IFile, loadHandler?: IEventHandler<Material, Material>): Promise<Material>; persist(): boolean; save(): Promise<void>; /** * 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>; }