@minecraft/debug-utilities 1.0.0-beta.1.21.80-preview.28 → 1.0.0-beta.1.21.90-preview.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +193 -0
  2. package/package.json +3 -2
package/index.d.ts CHANGED
@@ -21,6 +21,192 @@
21
21
  *
22
22
  */
23
23
  import * as minecraftcommon from '@minecraft/common';
24
+ import * as minecraftserver from '@minecraft/server';
25
+ /**
26
+ * The length of the arrow's head/tip.
27
+ */
28
+ // @ts-ignore Class inheritance allowed for native defined classes
29
+ export class DebugArrow extends DebugLine {
30
+ /**
31
+ * @remarks
32
+ * Adds a new debug shape to the world.
33
+ *
34
+ */
35
+ headLength: number;
36
+ /**
37
+ * @remarks
38
+ * The radius of the arrow's head/tip.
39
+ *
40
+ */
41
+ headRadius: number;
42
+ /**
43
+ * @remarks
44
+ * The number of segments for the base circle of the arrow's
45
+ * head/tip (default: 4).
46
+ *
47
+ */
48
+ headSegments: number;
49
+ constructor(location: minecraftserver.Vector3, endLocation: minecraftserver.Vector3);
50
+ }
51
+
52
+ /**
53
+ * A debug shape class that represents a box or cuboid.
54
+ */
55
+ // @ts-ignore Class inheritance allowed for native defined classes
56
+ export class DebugBox extends DebugShape {
57
+ /**
58
+ * @remarks
59
+ * The bounding box of the shape. The final box will be this
60
+ * bound multiplied by the shape's scale.
61
+ *
62
+ */
63
+ bound: minecraftserver.Vector3;
64
+ constructor(location: minecraftserver.Vector3);
65
+ }
66
+
67
+ /**
68
+ * A debug shape class that represents a circle (2D).
69
+ */
70
+ // @ts-ignore Class inheritance allowed for native defined classes
71
+ export class DebugCircle extends DebugShape {
72
+ constructor(location: minecraftserver.Vector3);
73
+ }
74
+
75
+ /**
76
+ * Debug Drawing class used to allow adding and removing
77
+ * wireframe shapes in world space.
78
+ */
79
+ export class DebugDrawer {
80
+ private constructor();
81
+ /**
82
+ * @remarks
83
+ * Adds a new debug shape to the world.
84
+ *
85
+ * @param shape
86
+ * The debug shape to be added. Should be of type DebugBox,
87
+ * DebugLine, DebugCircle, DebugSphere, DebugArrow or
88
+ * DebugText.
89
+ */
90
+ addShape(shape: DebugShape): void;
91
+ /**
92
+ * @remarks
93
+ * Removes all debug shapes from the world.
94
+ *
95
+ */
96
+ removeAll(): void;
97
+ /**
98
+ * @remarks
99
+ * Removes an instance of a debug shape from the world. This is
100
+ * equivalent to calling remove on the shape itself.
101
+ *
102
+ */
103
+ removeShape(shape: DebugShape): void;
104
+ }
105
+
106
+ /**
107
+ * A debug shape class that represents a line segment.
108
+ */
109
+ // @ts-ignore Class inheritance allowed for native defined classes
110
+ export class DebugLine extends DebugShape {
111
+ /**
112
+ * @remarks
113
+ * The end location of the line segment. The final line will
114
+ * spawn between location and endLocation.
115
+ *
116
+ */
117
+ endLocation: minecraftserver.Vector3;
118
+ constructor(location: minecraftserver.Vector3, endLocation: minecraftserver.Vector3);
119
+ }
120
+
121
+ /**
122
+ * The base class for all debug shapes. Represents an object in
123
+ * the world and its base properties.
124
+ */
125
+ export class DebugShape {
126
+ private constructor();
127
+ /**
128
+ * @remarks
129
+ * The color of the shape.
130
+ *
131
+ */
132
+ color: minecraftserver.RGB;
133
+ /**
134
+ * @remarks
135
+ * Returns true if the shape has a limited time span before
136
+ * being removed.
137
+ *
138
+ */
139
+ readonly hasDuration: boolean;
140
+ /**
141
+ * @remarks
142
+ * The location of the shape. For most shapes this is the
143
+ * centre of the shape, except DebugLine and DebugArrow where
144
+ * this represents the start point of the line.
145
+ *
146
+ */
147
+ location: minecraftserver.Vector3;
148
+ /**
149
+ * @remarks
150
+ * The rotation of the shape (Euler angles - [Pitch, Yaw,
151
+ * Roll]).
152
+ *
153
+ */
154
+ rotation: minecraftserver.Vector3;
155
+ /**
156
+ * @remarks
157
+ * The scale of the shape. This does not apply to DebugLine or
158
+ * DebugArrow.
159
+ *
160
+ */
161
+ scale: number;
162
+ /**
163
+ * @remarks
164
+ * The time left (in seconds) until this shape is automatically
165
+ * removed. Returns 0 if the shape does not have a limited
166
+ * life-span.
167
+ *
168
+ */
169
+ timeLeft?: number;
170
+ /**
171
+ * @remarks
172
+ * The total initial time-span (in seconds) until this shape is
173
+ * automatically removed. Returns 0 if the shape does not have
174
+ * a limited life-span.
175
+ *
176
+ */
177
+ readonly totalTimeLeft?: number;
178
+ /**
179
+ * @remarks
180
+ * Removes this shape from the world. The shape can be re-added
181
+ * via the DebugDrawer's addShape method.
182
+ *
183
+ */
184
+ remove(): void;
185
+ }
186
+
187
+ /**
188
+ * A debug shape class that represents a sphere.
189
+ */
190
+ // @ts-ignore Class inheritance allowed for native defined classes
191
+ export class DebugSphere extends DebugShape {
192
+ constructor(location: minecraftserver.Vector3);
193
+ }
194
+
195
+ /**
196
+ * A debug shape class that a text label. The text label
197
+ * automatically faces the screen.
198
+ */
199
+ // @ts-ignore Class inheritance allowed for native defined classes
200
+ export class DebugText extends DebugShape {
201
+ /**
202
+ * @remarks
203
+ * The text of the shape to display.
204
+ *
205
+ */
206
+ text: string;
207
+ constructor(location: minecraftserver.Vector3, text: string);
208
+ }
209
+
24
210
  export interface HandleCounts {
25
211
  handleCounts: Record<string, number>;
26
212
  name: string;
@@ -80,3 +266,10 @@ export function collectRuntimeStats(): RuntimeStats;
80
266
  * @throws This function can throw errors.
81
267
  */
82
268
  export function disableWatchdogTimingWarnings(disable: boolean): void;
269
+ /**
270
+ * @remarks
271
+ * Debug Drawing class used to allow adding and removing
272
+ * wireframe shapes in world space.
273
+ *
274
+ */
275
+ export const debugDrawer: DebugDrawer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/debug-utilities",
3
- "version": "1.0.0-beta.1.21.80-preview.28",
3
+ "version": "1.0.0-beta.1.21.90-preview.20",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -13,7 +13,8 @@
13
13
  }
14
14
  ],
15
15
  "dependencies": {
16
- "@minecraft/common": "^1.0.0"
16
+ "@minecraft/common": "^1.0.0",
17
+ "@minecraft/server": "^1.17.0 || ^2.0.0-rc.1.21.90-preview.20"
17
18
  },
18
19
  "license": "MIT"
19
20
  }