-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.d.ts
More file actions
141 lines (127 loc) · 3.1 KB
/
main.d.ts
File metadata and controls
141 lines (127 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
declare class MCStructure {
/**
* Deserialize mcstructure from given blob.
*
* @param buf - Input buffer
* @returns s
*/
static deserialize(buf: ArrayBuffer): MCStructure;
/**
* Remove unused blocks in structure.
*
* Changes original object.
*
* @param a - INput object.
* @returns
*/
static makePruned(a: MCStructure): MCStructure;
/**
* Create a mcstructure with given size.
*
* @param xL - X side length.
* @param yL - Y side length.
* @param zL - Z side length.
*/
constructor(xL: number, yL: number, zL: number);
/**
* Get volume of of the structure.
*
* @returns
*/
getVolume(): number;
/**
* Get the size of of the structure.
*
* @returns
*/
getSize(): { x: number, y: number, z: number };
/**
* Get a block in the structure.
*
* @param pos - Position in the structure.
* @param pos.x - Pos X.
* @param pos.y - Pos Y.
* @param pos.z - Pos Z.
* @returns
*/
getBlock(pos: { x: number, y: number, z: number }): object;
/**
* Get block entity at given position.
*
* @param pos - Position in the structure.
* @param pos.x - Pos X.
* @param pos.y - Pos Y.
* @param pos.z - Pos Z.
* @returns
*/
getBlockData(pos: { x: number, y: number, z: number }): object;
/**
* Get specified entity.
*
* @param uniqueID - Entity ID.
* @returns The specified entity or null.
*/
getEntity(uniqueID: number | bigint): object;
/**
* Place a block, and put given NBT data into block indices.
*
* @param pos - Position in the structure.
* @param pos.x - Pos X.
* @param pos.y - Pos Y.
* @param pos.z - Pos Z.
* @param block - Data of the block.
* @returns
*/
setBlock(pos: { x: number, y: number, z: number }, block: object): boolean;
/**
* Set the block entity of a block.
*
* @param pos - Position in the structure.
* @param pos.x - Pos X.
* @param pos.y - Pos Y.
* @param pos.z - Pos Z.
* @param nbt - Block entity data.
* @returns
*/
setBlockData(pos: { x: number, y: number, z: number }, nbt: object): boolean;
/**
* Fill specified area with given block.
*
* @param from - Position in the structure.
* @param from.x
* @param from.y
* @param from.z
* @param to - Position in the structure.
* @param to.x
* @param to.y
* @param to.z
* @param block - Data of the block.
* @returns
*/
fill(from: { x: number, y: number, z: number }, to: { x: number, y: number, z: number }, block: object): boolean;
/**
* Place an entity.
*
* @param entity - Entity data.
* @param pos - Position in the structure.
* @param pos.x - Pos X.
* @param pos.y - Pos Y.
* @param pos.z - Pos Z.
* @returns Entity ID.
*/
summon(entity: object, pos: { x: number, y: number, z: number }): bigint;
/**
* Remove specified entity.
*
* @param uniqueID - Entity ID.
* @returns The entity removed or null.
*/
kill(uniqueID: number | bigint): object;
/**
* Serialize MCStructure object to NBT.
*
* @returns
*/
serialize(): object;
}
export = MCStructure;