@minecraft/server-admin 1.0.0-beta.1.19.60-preview.25 → 1.0.0-beta.1.19.70-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 (3) hide show
  1. package/index.d.ts +1 -1
  2. package/package.json +1 -1
  3. package/tests.ts +9 -9
package/index.d.ts CHANGED
@@ -18,7 +18,7 @@
18
18
  * ```json
19
19
  * {
20
20
  * "module_name": "@minecraft/server-admin",
21
- * "version": "1.0.0-beta.1.19.60-preview.25"
21
+ * "version": "1.0.0-beta.1.19.70-preview.20"
22
22
  * }
23
23
  * ```
24
24
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-admin",
3
- "version": "1.0.0-beta.1.19.60-preview.25",
3
+ "version": "1.0.0-beta.1.19.70-preview.20",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
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 getPlayerProfile(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
4
+ export async function getPlayerProfile(log: (message: string, status?: number) => void, targetLocation: mc.Vector3) {
5
5
  const serverUrl = mcsa.variables.get('serverEndpoint');
6
6
 
7
7
  const req = new mcnet.HttpRequest(serverUrl + 'getPlayerProfile');
@@ -23,13 +23,13 @@ export default class SampleManager {
23
23
  tickCount = 0;
24
24
 
25
25
  _availableFuncs: {
26
- [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
26
+ [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>;
27
27
  };
28
28
 
29
29
  pendingFuncs: Array<{
30
30
  name: string;
31
- func: (log: (message: string, status?: number) => void, location: mc.Location) => void;
32
- location: mc.Location;
31
+ func: (log: (message: string, status?: number) => void, location: mc.Vector3) => void;
32
+ location: mc.Vector3;
33
33
  }> = [];
34
34
 
35
35
  gameplayLogger(message: string, status?: number) {
@@ -56,7 +56,7 @@ export default class SampleManager {
56
56
  }
57
57
 
58
58
  const nearbyBlockLoc = nearbyBlock.location;
59
- const nearbyLoc = new mc.Location(nearbyBlockLoc.x, nearbyBlockLoc.y + 1, nearbyBlockLoc.z);
59
+ const nearbyLoc: mc.Vector3 = { x: nearbyBlockLoc.x, y: nearbyBlockLoc.y + 1, z: nearbyBlockLoc.z };
60
60
 
61
61
  const sampleId = message.substring(5).trim();
62
62
 
@@ -86,8 +86,8 @@ export default class SampleManager {
86
86
 
87
87
  runSample(
88
88
  sampleId: string,
89
- snippetFunctions: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>,
90
- targetLocation: mc.Location,
89
+ snippetFunctions: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>,
90
+ targetLocation: mc.Vector3,
91
91
  ) {
92
92
  for (let i = snippetFunctions.length - 1; i >= 0; i--) {
93
93
  this.pendingFuncs.push({ name: sampleId, func: snippetFunctions[i], location: targetLocation });
@@ -118,7 +118,7 @@ export default class SampleManager {
118
118
  }
119
119
 
120
120
  registerSamples(sampleSet: {
121
- [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
121
+ [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>;
122
122
  }) {
123
123
  for (const sampleKey in sampleSet) {
124
124
  if (sampleKey.length > 1 && sampleSet[sampleKey]) {
@@ -132,7 +132,7 @@ import * as mcsa from '@minecraft/server-admin';
132
132
  import * as mcnet from '@minecraft/server-net'; // keep in for net samples
133
133
 
134
134
  const mojangServerAdminTestFuncs: {
135
- [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
135
+ [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>;
136
136
  } = {
137
137
  getPlayerProfile: [getPlayerProfile],
138
138
  };