@minecraft/server-net 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 +9 -9
package/index.d.ts CHANGED
@@ -17,7 +17,7 @@
17
17
  * ```json
18
18
  * {
19
19
  * "module_name": "@minecraft/server-net",
20
- * "version": "1.0.0-beta.1.19.60-preview.25"
20
+ * "version": "1.0.0-beta.1.19.60-stable"
21
21
  * }
22
22
  * ```
23
23
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-net",
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-admin": "1.0.0-beta.1.19.60-preview.25"
16
+ "@minecraft/server-admin": "1.0.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 updateScore(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
4
+ export async function updateScore(log: (message: string, status?: number) => void, targetLocation: mc.Vector3) {
5
5
  const req = new mcnet.HttpRequest('http://localhost:3000/updateScore');
6
6
 
7
7
  req.body = JSON.stringify({
@@ -21,13 +21,13 @@ export default class SampleManager {
21
21
  tickCount = 0;
22
22
 
23
23
  _availableFuncs: {
24
- [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
24
+ [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>;
25
25
  };
26
26
 
27
27
  pendingFuncs: Array<{
28
28
  name: string;
29
- func: (log: (message: string, status?: number) => void, location: mc.Location) => void;
30
- location: mc.Location;
29
+ func: (log: (message: string, status?: number) => void, location: mc.Vector3) => void;
30
+ location: mc.Vector3;
31
31
  }> = [];
32
32
 
33
33
  gameplayLogger(message: string, status?: number) {
@@ -54,7 +54,7 @@ export default class SampleManager {
54
54
  }
55
55
 
56
56
  const nearbyBlockLoc = nearbyBlock.location;
57
- const nearbyLoc = new mc.Location(nearbyBlockLoc.x, nearbyBlockLoc.y + 1, nearbyBlockLoc.z);
57
+ const nearbyLoc = { x: nearbyBlockLoc.x, y: nearbyBlockLoc.y + 1, z: nearbyBlockLoc.z };
58
58
 
59
59
  const sampleId = message.substring(5).trim();
60
60
 
@@ -84,8 +84,8 @@ export default class SampleManager {
84
84
 
85
85
  runSample(
86
86
  sampleId: string,
87
- snippetFunctions: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>,
88
- targetLocation: mc.Location,
87
+ snippetFunctions: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>,
88
+ targetLocation: mc.Vector3,
89
89
  ) {
90
90
  for (let i = snippetFunctions.length - 1; i >= 0; i--) {
91
91
  this.pendingFuncs.push({ name: sampleId, func: snippetFunctions[i], location: targetLocation });
@@ -116,7 +116,7 @@ export default class SampleManager {
116
116
  }
117
117
 
118
118
  registerSamples(sampleSet: {
119
- [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
119
+ [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>;
120
120
  }) {
121
121
  for (const sampleKey in sampleSet) {
122
122
  if (sampleKey.length > 1 && sampleSet[sampleKey]) {
@@ -129,7 +129,7 @@ export default class SampleManager {
129
129
  import * as mcnet from '@minecraft/server-net'; // keep in for net samples
130
130
 
131
131
  const mojangNetAdminTestFuncs: {
132
- [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
132
+ [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>;
133
133
  } = {
134
134
  updateScore: [updateScore],
135
135
  };