@minecraft/server-admin 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.
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/tests.ts +9 -9
package/index.d.ts
CHANGED
package/package.json
CHANGED
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.
|
|
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.
|
|
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.
|
|
32
|
-
location: mc.
|
|
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 =
|
|
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.
|
|
90
|
-
targetLocation: mc.
|
|
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.
|
|
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.
|
|
135
|
+
[name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Vector3) => void>;
|
|
136
136
|
} = {
|
|
137
137
|
getPlayerProfile: [getPlayerProfile],
|
|
138
138
|
};
|