Placing schematics
This commit is contained in:
@@ -18,8 +18,10 @@ import type {
|
||||
} from "./shared.ts";
|
||||
import type { ArgumentType, CommandNode } from "../commands.ts";
|
||||
import type { LootTableJson } from "../loot.ts";
|
||||
import type { Schematic } from "../schematic.ts";
|
||||
|
||||
export type { ArgumentType, CommandContext, CommandNode, Suggestion } from "../commands.ts";
|
||||
export type { Schematic, SchematicBlock, SchematicEntity, SchematicPaletteEntry } from "../schematic.ts";
|
||||
|
||||
export type {
|
||||
EventSignal,
|
||||
@@ -577,6 +579,25 @@ export interface SchematicApi {
|
||||
// the entities whose feet are in that box, written to a .cbsm file the host keeps in a temporary directory, like
|
||||
// create's schematic and quill. resolves to where the file is. throws for a box of more than 1048576 blocks (2^20)
|
||||
export(from: Position, to: Position): Promise<string>;
|
||||
// adds a schematic for place, by an id in this mod's namespace, while the server phase runs. it's checked here:
|
||||
// every block, state and entity in it has to be registered
|
||||
register(id: Id, schematic: Schematic): void;
|
||||
// puts a registered schematic in the world, all of it at once, replacing what was there, air too. replaced blocks
|
||||
// get their on_break. blocks it has data for get that data as it is, the rest their on_create, then everything
|
||||
// placed tells the blocks beside it. its entities come with new uuids. throws for an id nothing registered, or a
|
||||
// placement that isn't one, before changing anything
|
||||
place(id: Id, placement: SchematicPlacement): void;
|
||||
}
|
||||
|
||||
export interface SchematicPlacement {
|
||||
// where the schematic's lowest corner goes, before it's turned
|
||||
position: Position;
|
||||
// the block it turns and mirrors around, from its lowest corner. 0 0 0 by default
|
||||
position_pivot?: Position;
|
||||
// clockwise seen from above. turns positions, a state named facing and entities' yaw, see STRUCTURES.md
|
||||
rotation?: 0 | 90 | 180 | 270;
|
||||
// the axis that gets flipped, before it's turned
|
||||
mirror?: "x" | "z";
|
||||
}
|
||||
|
||||
export interface ItemApi {
|
||||
|
||||
Reference in New Issue
Block a user