@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
43 lines (42 loc) • 1.93 kB
TypeScript
import IFile from "../storage/IFile";
import { IEventHandler } from "ste-events";
import IDefinition from "./IDefinition";
import { MinecraftFeatureBase } from "./jsoncommon";
import Project from "../app/Project";
import ProjectItem from "../app/ProjectItem";
import RelationsIndex from "../app/RelationsIndex";
export default class FeatureRuleDefinition implements IDefinition {
private _file?;
private _id?;
private _isLoaded;
private _loadedWithComments;
private _data?;
private _onLoaded;
get data(): MinecraftFeatureBase;
get isLoaded(): boolean;
get file(): IFile | undefined;
get onLoaded(): import("ste-events").IEvent<FeatureRuleDefinition, FeatureRuleDefinition>;
set file(newFile: IFile | undefined);
get id(): string | undefined;
set id(newId: string | undefined);
get shortId(): string;
getFormatVersionIsCurrent(): Promise<boolean>;
getFormatVersion(): number[] | undefined;
setResourcePackFormatVersion(versionStr: string): void;
_ensureDataInitialized(): void;
static ensureOnFile(file: IFile, loadHandler?: IEventHandler<FeatureRuleDefinition, FeatureRuleDefinition>): Promise<FeatureRuleDefinition>;
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>;
/**
* Gets the feature identifier that this feature rule places.
* Feature rules reference their target feature via description.places_feature
*/
getPlacesFeatureId(): string | undefined;
addChildItems(project: Project, item: ProjectItem, index?: RelationsIndex): Promise<void>;
}