@minecraft/server-ui 1.0.0-beta.1.19.60-preview.25 → 1.0.0-beta.1.19.60-stable

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 (3) hide show
  1. package/index.d.ts +1 -1
  2. package/package.json +2 -2
  3. package/tests.ts +10 -10
package/index.d.ts CHANGED
@@ -44,7 +44,7 @@
44
44
  * ```json
45
45
  * {
46
46
  * "module_name": "@minecraft/server-ui",
47
- * "version": "1.0.0-internal.1.19.60-preview.25"
47
+ * "version": "0.1.0"
48
48
  * }
49
49
  * ```
50
50
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-ui",
3
- "version": "1.0.0-beta.1.19.60-preview.25",
3
+ "version": "1.0.0-beta.1.19.60-stable",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "dependencies": {
16
- "@minecraft/server": "1.1.0-beta.1.19.60-preview.25"
16
+ "@minecraft/server": "1.1.0-beta.1.19.60-stable"
17
17
  },
18
18
  "license": "MIT"
19
19
  }
package/tests.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
2
  import * as mc from '@minecraft/server';
3
3
 
4
- export async function showActionForm(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
4
+ export async function showActionForm(log: (message: string, status?: number) => void, targetLocation: mc.Vector3) {
5
5
  const players = mc.world.getPlayers();
6
6
 
7
7
  const playerList = Array.from(players);
@@ -26,7 +26,7 @@ export async function showActionForm(log: (message: string, status?: number) =>
26
26
  }
27
27
  }
28
28
 
29
- export function showFavoriteMonth(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
29
+ export function showFavoriteMonth(log: (message: string, status?: number) => void, targetLocation: mc.Vector3) {
30
30
  const players = mc.world.getPlayers();
31
31
 
32
32
  const playerList = Array.from(players);
@@ -53,13 +53,13 @@ export default class SampleManager {
53
53
  tickCount = 0;
54
54
 
55
55
  _availableFuncs: {
56
- [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
56
+ [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>;
57
57
  };
58
58
 
59
59
  pendingFuncs: Array<{
60
60
  name: string;
61
- func: (log: (message: string, status?: number) => void, location: mc.Location) => void;
62
- location: mc.Location;
61
+ func: (log: (message: string, status?: number) => void, location: mc.Vector3) => void;
62
+ location: mc.Vector3;
63
63
  }> = [];
64
64
 
65
65
  gameplayLogger(message: string, status?: number) {
@@ -86,7 +86,7 @@ export default class SampleManager {
86
86
  }
87
87
 
88
88
  const nearbyBlockLoc = nearbyBlock.location;
89
- const nearbyLoc = new mc.Location(nearbyBlockLoc.x, nearbyBlockLoc.y + 1, nearbyBlockLoc.z);
89
+ const nearbyLoc = { x: nearbyBlockLoc.x, y: nearbyBlockLoc.y + 1, z: nearbyBlockLoc.z };
90
90
 
91
91
  const sampleId = message.substring(5).trim();
92
92
 
@@ -116,8 +116,8 @@ export default class SampleManager {
116
116
 
117
117
  runSample(
118
118
  sampleId: string,
119
- snippetFunctions: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>,
120
- targetLocation: mc.Location,
119
+ snippetFunctions: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>,
120
+ targetLocation: mc.Vector3,
121
121
  ) {
122
122
  for (let i = snippetFunctions.length - 1; i >= 0; i--) {
123
123
  this.pendingFuncs.push({ name: sampleId, func: snippetFunctions[i], location: targetLocation });
@@ -148,7 +148,7 @@ export default class SampleManager {
148
148
  }
149
149
 
150
150
  registerSamples(sampleSet: {
151
- [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
151
+ [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>;
152
152
  }) {
153
153
  for (const sampleKey in sampleSet) {
154
154
  if (sampleKey.length > 1 && sampleSet[sampleKey]) {
@@ -161,7 +161,7 @@ export default class SampleManager {
161
161
  import * as mcui from '@minecraft/server-ui'; // keep in for ui samples
162
162
 
163
163
  const mojangMinecraftUIFuncs: {
164
- [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
164
+ [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>;
165
165
  } = {
166
166
  showActionForm: [showActionForm],
167
167
  showFavoriteMonth: [showFavoriteMonth],