8
8
* }
9
9
* ```
10
10
*/
11
- import { Color , Player , Vector3 } from "@minecraft/server" ;
12
- export class BlockVolume {
13
- constructor ( a : Vector3 , b : Vector3 ) ;
14
- contains ( other : Vector3 ) : boolean ;
15
- offset ( other : Vector3 ) : BlockVolume ;
16
- intersects ( other : BlockVolume ) : number ;
17
- getBlockPositionIterator ( ) : BlockVolumeIterator ;
18
- equals ( other : BlockVolume ) : boolean ;
19
- boundingBox : BoundingBox ;
20
- min : Vector3 ;
21
- max : Vector3 ;
22
- volume : number ;
23
- }
24
- export enum BlockVolumeIntersection {
25
- disjoint = 0 ,
26
- contains = 1 ,
27
- intersects = 2 ,
28
- }
29
- export class BlockVolumeIterator implements Iterable < BlockVolume > {
30
- protected constructor ( ) ;
31
- [ Symbol . iterator ] ( ) : Iterator < BlockVolume > ;
32
- }
33
- export class BoundingBox {
34
- constructor (
35
- minX : number ,
36
- minY : number ,
37
- minZ : number ,
38
- maxX : number ,
39
- maxY : number ,
40
- maxZ : number
41
- ) ;
42
- equals ( other : BoundingBox ) : boolean ;
43
- fromBlockLocation ( a : Vector3 , b : Vector3 ) : BoundingBox ;
44
- intersects ( other : BoundingBox ) : number ;
45
- expand ( other : BoundingBox ) : BoundingBox ;
46
- dilate ( x : number , y : number , z : number ) : BoundingBox ;
47
- offset ( other : Vector3 ) : BoundingBox ;
48
- contains ( other : Vector3 ) : boolean ;
49
- min : Vector3 ;
50
- max : Vector3 ;
51
- center : Vector3 ;
52
- spanX : number ;
53
- spanY : number ;
54
- spanZ : number ;
55
- }
11
+ import { BlockLocationIterator , Color , CompoundBlockVolumeAction , Player , Vector3 } from "@minecraft/server" ;
56
12
export class ClipboardItem {
57
13
protected constructor ( ) ;
58
14
readFromSelection ( selection : Selection ) : void ;
@@ -87,13 +43,13 @@ export class ClipboardWriteOptions {
87
43
rotation : ClipboardRotation ;
88
44
}
89
45
export class Cursor {
90
- getState ( ) : CursorState ;
91
- setState ( state : CursorState ) : void ;
46
+ getProperties ( ) : Record < string , any > ;
47
+ setProperties ( properties : Record < string , any > ) : void ;
48
+ getPosition ( ) : Vector3 ;
92
49
moveBy ( vector : Vector3 ) : void ;
93
50
resetToDefaultState ( ) : void ;
94
51
show ( ) : void ;
95
52
hide ( ) : void ;
96
- position : Vector3 ;
97
53
faceDirection : number ;
98
54
isVisible : boolean ;
99
55
}
@@ -103,24 +59,16 @@ export enum CursorControlMode {
103
59
KeyboardAndMouse = 2 ,
104
60
Fixed = 3 ,
105
61
}
106
- export class CursorState {
107
- color : Color ;
108
- controlMode : CursorControlMode ;
109
- targetMode : CursorTargetMode ;
110
- visible : boolean ;
111
- fixedModeDistance : number ;
112
- }
113
62
export enum CursorTargetMode {
114
63
Block = 0 ,
115
64
Face = 1 ,
116
65
}
117
66
export class Extension {
118
67
protected constructor ( ) ;
119
- description : string ;
120
- notes : string ;
121
68
}
122
69
export class ExtensionContext {
123
70
protected constructor ( ) ;
71
+ extensionName : string ;
124
72
player : Player ;
125
73
selectionManager : SelectionManager ;
126
74
transactionManager : TransactionManager ;
@@ -135,29 +83,32 @@ export class MinecraftEditor {
135
83
shutdownFunction : ( context : ExtensionContext ) => void
136
84
) : Extension ;
137
85
}
86
+ export interface PushVolumeOptions {
87
+ action : CompoundBlockVolumeAction ,
88
+ volume : {
89
+ from : Vector3 ,
90
+ to : Vector3
91
+ }
92
+ }
138
93
export class Selection {
139
94
protected constructor ( ) ;
140
95
clear ( ) : void ;
141
- pushVolume ( action : SelectionBlockVolumeAction , volume : BlockVolume ) : any ;
96
+ pushVolume ( options : PushVolumeOptions ) : void ;
142
97
popVolume ( ) : void ;
143
98
copyFrom ( selection : Selection ) : void ;
144
- getBlockPositionIterator ( ) : BlockVolumeIterator ;
99
+ getBlockLocationIterator ( ) : BlockLocationIterator ;
145
100
moveBy ( vector : Vector3 ) : void ;
146
101
moveTo ( vector : Vector3 ) : void ;
147
- peekLastVolume : BlockVolume ;
148
- boundingBox : BoundingBox ;
102
+ getFillColor ( ) : Color ;
103
+ getOutlineColor ( ) : Color ;
104
+ setFillColor ( ) : Color ;
105
+ setOutlineColor ( ) : Color ;
149
106
isEmpty : boolean ;
150
107
visible : boolean ;
151
- fillColor : Color ;
152
- borderColor : Color ;
153
- }
154
- export enum SelectionBlockVolumeAction {
155
- add = 0 ,
156
- subtract = 1 ,
157
108
}
158
109
export class SelectionManager {
159
110
protected constructor ( ) ;
160
- createSelection ( ) : Selection ;
111
+ create ( ) : Selection ;
161
112
selection : Selection ;
162
113
}
163
114
export class TransactionManager {
@@ -175,5 +126,4 @@ export class TransactionManager {
175
126
commitOpenTransaction ( ) : void ;
176
127
discardOpenTransaction ( ) : void ;
177
128
}
178
- export const editor : MinecraftEditor ;
179
- export const ExtensionOptionalParameters : undefined
129
+ export const editor : MinecraftEditor ;
0 commit comments