hytopia 0.10.20 → 0.10.21
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/docs/server.chunklattice.initializeblocks.md +56 -0
- package/docs/server.chunklattice.md +14 -0
- package/docs/server.player.md +0 -28
- package/docs/server.playerevent.md +0 -14
- package/docs/server.playereventpayloads.md +0 -19
- package/package.json +1 -1
- package/server.api.json +57 -188
- package/server.d.ts +9 -22
- package/server.mjs +152 -152
- package/docs/server.player.schedulenotification.md +0 -72
- package/docs/server.player.unschedulenotification.md +0 -56
- package/docs/server.playereventpayloads._player.request_notification_permission_.md +0 -15
@@ -0,0 +1,56 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [ChunkLattice](./server.chunklattice.md) > [initializeBlocks](./server.chunklattice.initializeblocks.md)
|
4
|
+
|
5
|
+
## ChunkLattice.initializeBlocks() method
|
6
|
+
|
7
|
+
Initialize all blocks in the lattice in bulk, removing all previously existing blocks. This is much more efficient than setting each block individually.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
initializeBlocks(blocks: {
|
13
|
+
[blockTypeId: number]: Vector3Like[];
|
14
|
+
}): void;
|
15
|
+
```
|
16
|
+
|
17
|
+
## Parameters
|
18
|
+
|
19
|
+
<table><thead><tr><th>
|
20
|
+
|
21
|
+
Parameter
|
22
|
+
|
23
|
+
|
24
|
+
</th><th>
|
25
|
+
|
26
|
+
Type
|
27
|
+
|
28
|
+
|
29
|
+
</th><th>
|
30
|
+
|
31
|
+
Description
|
32
|
+
|
33
|
+
|
34
|
+
</th></tr></thead>
|
35
|
+
<tbody><tr><td>
|
36
|
+
|
37
|
+
blocks
|
38
|
+
|
39
|
+
|
40
|
+
</td><td>
|
41
|
+
|
42
|
+
{ \[blockTypeId: number\]: [Vector3Like](./server.vector3like.md)<!-- -->\[\]; }
|
43
|
+
|
44
|
+
|
45
|
+
</td><td>
|
46
|
+
|
47
|
+
The blocks to initialize.
|
48
|
+
|
49
|
+
|
50
|
+
</td></tr>
|
51
|
+
</tbody></table>
|
52
|
+
|
53
|
+
**Returns:**
|
54
|
+
|
55
|
+
void
|
56
|
+
|
@@ -240,6 +240,20 @@ Check if a block exists at a specific global coordinate.
|
|
240
240
|
Check if a chunk exists for a given global coordinate.
|
241
241
|
|
242
242
|
|
243
|
+
</td></tr>
|
244
|
+
<tr><td>
|
245
|
+
|
246
|
+
[initializeBlocks(blocks)](./server.chunklattice.initializeblocks.md)
|
247
|
+
|
248
|
+
|
249
|
+
</td><td>
|
250
|
+
|
251
|
+
|
252
|
+
</td><td>
|
253
|
+
|
254
|
+
Initialize all blocks in the lattice in bulk, removing all previously existing blocks. This is much more efficient than setting each block individually.
|
255
|
+
|
256
|
+
|
243
257
|
</td></tr>
|
244
258
|
<tr><td>
|
245
259
|
|
package/docs/server.player.md
CHANGED
@@ -291,20 +291,6 @@ Joins a player to a world.
|
|
291
291
|
Resets all inputs keys
|
292
292
|
|
293
293
|
|
294
|
-
</td></tr>
|
295
|
-
<tr><td>
|
296
|
-
|
297
|
-
[scheduleNotification(type, scheduledFor)](./server.player.schedulenotification.md)
|
298
|
-
|
299
|
-
|
300
|
-
</td><td>
|
301
|
-
|
302
|
-
|
303
|
-
</td><td>
|
304
|
-
|
305
|
-
Schedule a notification the player at a point in time in the future. This will automatically handle prompting a player (if necessary) for notification permissions in-game.
|
306
|
-
|
307
|
-
|
308
294
|
</td></tr>
|
309
295
|
<tr><td>
|
310
296
|
|
@@ -319,20 +305,6 @@ Schedule a notification the player at a point in time in the future. This will a
|
|
319
305
|
Set the persisted data for the player. This data can later be retrieved using [Player.getPersistedData()](./server.player.getpersisteddata.md)<!-- -->, even if a player disconnects and rejoin a game in the future, or joins a different HYTOPIA managed lobby of your game.
|
320
306
|
|
321
307
|
|
322
|
-
</td></tr>
|
323
|
-
<tr><td>
|
324
|
-
|
325
|
-
[unscheduleNotification(notificationId)](./server.player.unschedulenotification.md)
|
326
|
-
|
327
|
-
|
328
|
-
</td><td>
|
329
|
-
|
330
|
-
|
331
|
-
</td><td>
|
332
|
-
|
333
|
-
Unschedules a scheduled notification for the player.
|
334
|
-
|
335
|
-
|
336
308
|
</td></tr>
|
337
309
|
</tbody></table>
|
338
310
|
|
@@ -110,25 +110,6 @@ Emitted when a player leaves a world.
|
|
110
110
|
Emitted when a player reconnects to a world after a unintentional disconnect.
|
111
111
|
|
112
112
|
|
113
|
-
</td></tr>
|
114
|
-
<tr><td>
|
115
|
-
|
116
|
-
["PLAYER.REQUEST\_NOTIFICATION\_PERMISSION"](./server.playereventpayloads._player.request_notification_permission_.md)
|
117
|
-
|
118
|
-
|
119
|
-
</td><td>
|
120
|
-
|
121
|
-
|
122
|
-
</td><td>
|
123
|
-
|
124
|
-
{ player: [Player](./server.player.md)<!-- -->; }
|
125
|
-
|
126
|
-
|
127
|
-
</td><td>
|
128
|
-
|
129
|
-
Emitted when notification permission is requested by a game.
|
130
|
-
|
131
|
-
|
132
113
|
</td></tr>
|
133
114
|
<tr><td>
|
134
115
|
|
package/package.json
CHANGED
package/server.api.json
CHANGED
@@ -7527,6 +7527,63 @@
|
|
7527
7527
|
"isAbstract": false,
|
7528
7528
|
"name": "hasChunk"
|
7529
7529
|
},
|
7530
|
+
{
|
7531
|
+
"kind": "Method",
|
7532
|
+
"canonicalReference": "server!ChunkLattice#initializeBlocks:member(1)",
|
7533
|
+
"docComment": "/**\n * Initialize all blocks in the lattice in bulk, removing all previously existing blocks. This is much more efficient than setting each block individually.\n *\n * @param blocks - The blocks to initialize.\n */\n",
|
7534
|
+
"excerptTokens": [
|
7535
|
+
{
|
7536
|
+
"kind": "Content",
|
7537
|
+
"text": "initializeBlocks(blocks: "
|
7538
|
+
},
|
7539
|
+
{
|
7540
|
+
"kind": "Content",
|
7541
|
+
"text": "{\n [blockTypeId: number]: "
|
7542
|
+
},
|
7543
|
+
{
|
7544
|
+
"kind": "Reference",
|
7545
|
+
"text": "Vector3Like",
|
7546
|
+
"canonicalReference": "server!Vector3Like:interface"
|
7547
|
+
},
|
7548
|
+
{
|
7549
|
+
"kind": "Content",
|
7550
|
+
"text": "[];\n }"
|
7551
|
+
},
|
7552
|
+
{
|
7553
|
+
"kind": "Content",
|
7554
|
+
"text": "): "
|
7555
|
+
},
|
7556
|
+
{
|
7557
|
+
"kind": "Content",
|
7558
|
+
"text": "void"
|
7559
|
+
},
|
7560
|
+
{
|
7561
|
+
"kind": "Content",
|
7562
|
+
"text": ";"
|
7563
|
+
}
|
7564
|
+
],
|
7565
|
+
"isStatic": false,
|
7566
|
+
"returnTypeTokenRange": {
|
7567
|
+
"startIndex": 5,
|
7568
|
+
"endIndex": 6
|
7569
|
+
},
|
7570
|
+
"releaseTag": "Public",
|
7571
|
+
"isProtected": false,
|
7572
|
+
"overloadIndex": 1,
|
7573
|
+
"parameters": [
|
7574
|
+
{
|
7575
|
+
"parameterName": "blocks",
|
7576
|
+
"parameterTypeTokenRange": {
|
7577
|
+
"startIndex": 1,
|
7578
|
+
"endIndex": 4
|
7579
|
+
},
|
7580
|
+
"isOptional": false
|
7581
|
+
}
|
7582
|
+
],
|
7583
|
+
"isOptional": false,
|
7584
|
+
"isAbstract": false,
|
7585
|
+
"name": "initializeBlocks"
|
7586
|
+
},
|
7530
7587
|
{
|
7531
7588
|
"kind": "Method",
|
7532
7589
|
"canonicalReference": "server!ChunkLattice#setBlock:member(1)",
|
@@ -35782,75 +35839,6 @@
|
|
35782
35839
|
"isAbstract": false,
|
35783
35840
|
"name": "resetInputs"
|
35784
35841
|
},
|
35785
|
-
{
|
35786
|
-
"kind": "Method",
|
35787
|
-
"canonicalReference": "server!Player#scheduleNotification:member(1)",
|
35788
|
-
"docComment": "/**\n * Schedule a notification the player at a point in time in the future. This will automatically handle prompting a player (if necessary) for notification permissions in-game.\n *\n * @param type - The type of notification to schedule.\n *\n * @param scheduledFor - The point in time in the future to schedule the notification for.\n *\n * @returns The id of the notification if it was scheduled successfully, undefined otherwise.\n */\n",
|
35789
|
-
"excerptTokens": [
|
35790
|
-
{
|
35791
|
-
"kind": "Content",
|
35792
|
-
"text": "scheduleNotification(type: "
|
35793
|
-
},
|
35794
|
-
{
|
35795
|
-
"kind": "Content",
|
35796
|
-
"text": "string"
|
35797
|
-
},
|
35798
|
-
{
|
35799
|
-
"kind": "Content",
|
35800
|
-
"text": ", scheduledFor: "
|
35801
|
-
},
|
35802
|
-
{
|
35803
|
-
"kind": "Content",
|
35804
|
-
"text": "number"
|
35805
|
-
},
|
35806
|
-
{
|
35807
|
-
"kind": "Content",
|
35808
|
-
"text": "): "
|
35809
|
-
},
|
35810
|
-
{
|
35811
|
-
"kind": "Reference",
|
35812
|
-
"text": "Promise",
|
35813
|
-
"canonicalReference": "!Promise:interface"
|
35814
|
-
},
|
35815
|
-
{
|
35816
|
-
"kind": "Content",
|
35817
|
-
"text": "<string | void>"
|
35818
|
-
},
|
35819
|
-
{
|
35820
|
-
"kind": "Content",
|
35821
|
-
"text": ";"
|
35822
|
-
}
|
35823
|
-
],
|
35824
|
-
"isStatic": false,
|
35825
|
-
"returnTypeTokenRange": {
|
35826
|
-
"startIndex": 5,
|
35827
|
-
"endIndex": 7
|
35828
|
-
},
|
35829
|
-
"releaseTag": "Public",
|
35830
|
-
"isProtected": false,
|
35831
|
-
"overloadIndex": 1,
|
35832
|
-
"parameters": [
|
35833
|
-
{
|
35834
|
-
"parameterName": "type",
|
35835
|
-
"parameterTypeTokenRange": {
|
35836
|
-
"startIndex": 1,
|
35837
|
-
"endIndex": 2
|
35838
|
-
},
|
35839
|
-
"isOptional": false
|
35840
|
-
},
|
35841
|
-
{
|
35842
|
-
"parameterName": "scheduledFor",
|
35843
|
-
"parameterTypeTokenRange": {
|
35844
|
-
"startIndex": 3,
|
35845
|
-
"endIndex": 4
|
35846
|
-
},
|
35847
|
-
"isOptional": false
|
35848
|
-
}
|
35849
|
-
],
|
35850
|
-
"isOptional": false,
|
35851
|
-
"isAbstract": false,
|
35852
|
-
"name": "scheduleNotification"
|
35853
|
-
},
|
35854
35842
|
{
|
35855
35843
|
"kind": "Method",
|
35856
35844
|
"canonicalReference": "server!Player#setPersistedData:member(1)",
|
@@ -35940,59 +35928,6 @@
|
|
35940
35928
|
"isProtected": false,
|
35941
35929
|
"isAbstract": false
|
35942
35930
|
},
|
35943
|
-
{
|
35944
|
-
"kind": "Method",
|
35945
|
-
"canonicalReference": "server!Player#unscheduleNotification:member(1)",
|
35946
|
-
"docComment": "/**\n * Unschedules a scheduled notification for the player.\n *\n * @param notificationId - The id of the notification returned from {@link Player.scheduleNotification}.\n *\n * @returns boolean - True if the notification was unscheduled, false otherwise.\n */\n",
|
35947
|
-
"excerptTokens": [
|
35948
|
-
{
|
35949
|
-
"kind": "Content",
|
35950
|
-
"text": "unscheduleNotification(notificationId: "
|
35951
|
-
},
|
35952
|
-
{
|
35953
|
-
"kind": "Content",
|
35954
|
-
"text": "string"
|
35955
|
-
},
|
35956
|
-
{
|
35957
|
-
"kind": "Content",
|
35958
|
-
"text": "): "
|
35959
|
-
},
|
35960
|
-
{
|
35961
|
-
"kind": "Reference",
|
35962
|
-
"text": "Promise",
|
35963
|
-
"canonicalReference": "!Promise:interface"
|
35964
|
-
},
|
35965
|
-
{
|
35966
|
-
"kind": "Content",
|
35967
|
-
"text": "<boolean>"
|
35968
|
-
},
|
35969
|
-
{
|
35970
|
-
"kind": "Content",
|
35971
|
-
"text": ";"
|
35972
|
-
}
|
35973
|
-
],
|
35974
|
-
"isStatic": false,
|
35975
|
-
"returnTypeTokenRange": {
|
35976
|
-
"startIndex": 3,
|
35977
|
-
"endIndex": 5
|
35978
|
-
},
|
35979
|
-
"releaseTag": "Public",
|
35980
|
-
"isProtected": false,
|
35981
|
-
"overloadIndex": 1,
|
35982
|
-
"parameters": [
|
35983
|
-
{
|
35984
|
-
"parameterName": "notificationId",
|
35985
|
-
"parameterTypeTokenRange": {
|
35986
|
-
"startIndex": 1,
|
35987
|
-
"endIndex": 2
|
35988
|
-
},
|
35989
|
-
"isOptional": false
|
35990
|
-
}
|
35991
|
-
],
|
35992
|
-
"isOptional": false,
|
35993
|
-
"isAbstract": false,
|
35994
|
-
"name": "unscheduleNotification"
|
35995
|
-
},
|
35996
35931
|
{
|
35997
35932
|
"kind": "Property",
|
35998
35933
|
"canonicalReference": "server!Player#username:member",
|
@@ -38977,27 +38912,6 @@
|
|
38977
38912
|
"releaseTag": "Public",
|
38978
38913
|
"name": "RECONNECTED_WORLD"
|
38979
38914
|
},
|
38980
|
-
{
|
38981
|
-
"kind": "EnumMember",
|
38982
|
-
"canonicalReference": "server!PlayerEvent.REQUEST_NOTIFICATION_PERMISSION:member",
|
38983
|
-
"docComment": "",
|
38984
|
-
"excerptTokens": [
|
38985
|
-
{
|
38986
|
-
"kind": "Content",
|
38987
|
-
"text": "REQUEST_NOTIFICATION_PERMISSION = "
|
38988
|
-
},
|
38989
|
-
{
|
38990
|
-
"kind": "Content",
|
38991
|
-
"text": "\"PLAYER.REQUEST_NOTIFICATION_PERMISSION\""
|
38992
|
-
}
|
38993
|
-
],
|
38994
|
-
"initializerTokenRange": {
|
38995
|
-
"startIndex": 1,
|
38996
|
-
"endIndex": 2
|
38997
|
-
},
|
38998
|
-
"releaseTag": "Public",
|
38999
|
-
"name": "REQUEST_NOTIFICATION_PERMISSION"
|
39000
|
-
},
|
39001
38915
|
{
|
39002
38916
|
"kind": "EnumMember",
|
39003
38917
|
"canonicalReference": "server!PlayerEvent.REQUEST_SYNC:member",
|
@@ -39243,51 +39157,6 @@
|
|
39243
39157
|
"endIndex": 8
|
39244
39158
|
}
|
39245
39159
|
},
|
39246
|
-
{
|
39247
|
-
"kind": "PropertySignature",
|
39248
|
-
"canonicalReference": "server!PlayerEventPayloads#\"PLAYER.REQUEST_NOTIFICATION_PERMISSION\":member",
|
39249
|
-
"docComment": "/**\n * Emitted when notification permission is requested by a game.\n */\n",
|
39250
|
-
"excerptTokens": [
|
39251
|
-
{
|
39252
|
-
"kind": "Content",
|
39253
|
-
"text": "["
|
39254
|
-
},
|
39255
|
-
{
|
39256
|
-
"kind": "Reference",
|
39257
|
-
"text": "PlayerEvent.REQUEST_NOTIFICATION_PERMISSION",
|
39258
|
-
"canonicalReference": "server!PlayerEvent.REQUEST_NOTIFICATION_PERMISSION:member"
|
39259
|
-
},
|
39260
|
-
{
|
39261
|
-
"kind": "Content",
|
39262
|
-
"text": "]: "
|
39263
|
-
},
|
39264
|
-
{
|
39265
|
-
"kind": "Content",
|
39266
|
-
"text": "{\n player: "
|
39267
|
-
},
|
39268
|
-
{
|
39269
|
-
"kind": "Reference",
|
39270
|
-
"text": "Player",
|
39271
|
-
"canonicalReference": "server!Player:class"
|
39272
|
-
},
|
39273
|
-
{
|
39274
|
-
"kind": "Content",
|
39275
|
-
"text": ";\n }"
|
39276
|
-
},
|
39277
|
-
{
|
39278
|
-
"kind": "Content",
|
39279
|
-
"text": ";"
|
39280
|
-
}
|
39281
|
-
],
|
39282
|
-
"isReadonly": false,
|
39283
|
-
"isOptional": false,
|
39284
|
-
"releaseTag": "Public",
|
39285
|
-
"name": "\"PLAYER.REQUEST_NOTIFICATION_PERMISSION\"",
|
39286
|
-
"propertyTypeTokenRange": {
|
39287
|
-
"startIndex": 3,
|
39288
|
-
"endIndex": 6
|
39289
|
-
}
|
39290
|
-
},
|
39291
39160
|
{
|
39292
39161
|
"kind": "PropertySignature",
|
39293
39162
|
"canonicalReference": "server!PlayerEventPayloads#\"PLAYER.REQUEST_SYNC\":member",
|
package/server.d.ts
CHANGED
@@ -994,6 +994,15 @@ export declare class ChunkLattice extends EventRouter {
|
|
994
994
|
* @returns Whether the chunk exists.
|
995
995
|
*/
|
996
996
|
hasChunk(globalCoordinate: Vector3Like): boolean;
|
997
|
+
/**
|
998
|
+
* Initialize all blocks in the lattice in bulk, removing
|
999
|
+
* all previously existing blocks. This is much more
|
1000
|
+
* efficient than setting each block individually.
|
1001
|
+
* @param blocks - The blocks to initialize.
|
1002
|
+
*/
|
1003
|
+
initializeBlocks(blocks: {
|
1004
|
+
[blockTypeId: number]: Vector3Like[];
|
1005
|
+
}): void;
|
997
1006
|
/**
|
998
1007
|
* Set the block at a global coordinate by block type id, automatically
|
999
1008
|
* creating a chunk if it doesn't exist. Use block type id 0 for air (to remove a block).
|
@@ -4424,23 +4433,6 @@ export declare class Player extends EventRouter implements protocol.Serializable
|
|
4424
4433
|
* @param world - The world to join the player to.
|
4425
4434
|
*/
|
4426
4435
|
joinWorld(world: World): void;
|
4427
|
-
/**
|
4428
|
-
* Schedule a notification the player at a point in time in the future.
|
4429
|
-
* This will automatically handle prompting a player (if necessary) for
|
4430
|
-
* notification permissions in-game.
|
4431
|
-
*
|
4432
|
-
* @param type - The type of notification to schedule.
|
4433
|
-
* @param scheduledFor - The point in time in the future to schedule the notification for.
|
4434
|
-
* @returns The id of the notification if it was scheduled successfully, undefined otherwise.
|
4435
|
-
*/
|
4436
|
-
scheduleNotification(type: string, scheduledFor: number): Promise<string | void>;
|
4437
|
-
/**
|
4438
|
-
* Unschedules a scheduled notification for the player.
|
4439
|
-
*
|
4440
|
-
* @param notificationId - The id of the notification returned from {@link Player.scheduleNotification}.
|
4441
|
-
* @returns boolean - True if the notification was unscheduled, false otherwise.
|
4442
|
-
*/
|
4443
|
-
unscheduleNotification(notificationId: string): Promise<boolean>;
|
4444
4436
|
|
4445
4437
|
|
4446
4438
|
/**
|
@@ -4835,7 +4827,6 @@ export declare enum PlayerEvent {
|
|
4835
4827
|
JOINED_WORLD = "PLAYER.JOINED_WORLD",
|
4836
4828
|
LEFT_WORLD = "PLAYER.LEFT_WORLD",
|
4837
4829
|
RECONNECTED_WORLD = "PLAYER.RECONNECTED_WORLD",
|
4838
|
-
REQUEST_NOTIFICATION_PERMISSION = "PLAYER.REQUEST_NOTIFICATION_PERMISSION",
|
4839
4830
|
REQUEST_SYNC = "PLAYER.REQUEST_SYNC"
|
4840
4831
|
}
|
4841
4832
|
|
@@ -4861,10 +4852,6 @@ export declare interface PlayerEventPayloads {
|
|
4861
4852
|
player: Player;
|
4862
4853
|
world: World;
|
4863
4854
|
};
|
4864
|
-
/** Emitted when notification permission is requested by a game. */
|
4865
|
-
[PlayerEvent.REQUEST_NOTIFICATION_PERMISSION]: {
|
4866
|
-
player: Player;
|
4867
|
-
};
|
4868
4855
|
/** Emitted when a player's client requests a round trip time synchronization. */
|
4869
4856
|
[PlayerEvent.REQUEST_SYNC]: {
|
4870
4857
|
player: Player;
|