hytopia 0.1.60 → 0.1.62

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 (38) hide show
  1. package/bin/scripts.js +6 -4
  2. package/boilerplate/assets/map.json +2 -1
  3. package/docs/server.blocktypeoptions.customcollideroptions.md +2 -0
  4. package/docs/server.blocktypeoptions.id.md +2 -0
  5. package/docs/server.blocktypeoptions.isliquid.md +2 -0
  6. package/docs/server.blocktypeoptions.md +8 -2
  7. package/docs/server.blocktypeoptions.name.md +2 -0
  8. package/docs/server.blocktypeoptions.textureuri.md +2 -0
  9. package/docs/server.collisiongroup.md +168 -0
  10. package/docs/server.entity.md +35 -0
  11. package/docs/server.entity.opacity.md +13 -0
  12. package/docs/server.entity.setopacity.md +53 -0
  13. package/docs/server.entityeventpayload.md +9 -0
  14. package/docs/server.entityeventpayload.setopacity.entity.md +11 -0
  15. package/docs/server.entityeventpayload.setopacity.md +70 -0
  16. package/docs/server.entityeventpayload.setopacity.opacity.md +11 -0
  17. package/docs/server.entityeventtype.md +14 -0
  18. package/docs/server.entityoptions.md +19 -0
  19. package/docs/server.entityoptions.opacity.md +13 -0
  20. package/docs/server.playerentitycontroller.md +19 -0
  21. package/docs/server.playerentitycontroller.stickstoplatforms.md +13 -0
  22. package/docs/server.playerentitycontrolleroptions.md +19 -0
  23. package/docs/server.playerentitycontrolleroptions.stickstoplatforms.md +13 -0
  24. package/examples/big-world/package.json +3 -2
  25. package/examples/block-entity/package.json +3 -2
  26. package/examples/custom-ui/package.json +3 -2
  27. package/examples/entity-controller/package.json +3 -2
  28. package/examples/entity-spawn/package.json +3 -2
  29. package/examples/payload-game/package.json +3 -2
  30. package/examples/wall-dodge-game/assets/map.json +3995 -0
  31. package/examples/wall-dodge-game/assets/textures/water.png +0 -0
  32. package/examples/wall-dodge-game/assets/ui/index.html +249 -0
  33. package/examples/wall-dodge-game/index.ts +336 -0
  34. package/examples/wall-dodge-game/package.json +16 -0
  35. package/package.json +1 -1
  36. package/server.api.json +512 -5
  37. package/server.d.ts +48 -12
  38. package/server.js +71 -71
package/bin/scripts.js CHANGED
@@ -30,10 +30,6 @@ const path = require('path');
30
30
  // Initialize project with latest HYTOPIA SDK
31
31
  console.log('🔧 Initializing project with latest HYTOPIA SDK...');
32
32
 
33
- execSync('bun init --yes');
34
- execSync('bun add hytopia@latest');
35
- execSync('bun add @hytopia.com/assets');
36
-
37
33
  if (flags.template) {
38
34
  // Init from example template
39
35
  console.log(`🖨️ Initializing project with examples template "${flags.template}"...`);
@@ -46,7 +42,13 @@ const path = require('path');
46
42
  }
47
43
 
48
44
  fs.cpSync(templateDir, destDir, { recursive: true });
45
+
46
+ execSync('bun install');
49
47
  } else {
48
+ execSync('bun init --yes');
49
+ execSync('bun add hytopia@latest');
50
+ execSync('bun add @hytopia.com/assets');
51
+
50
52
  // Init from boilerplate
51
53
  console.log('🧑‍💻 Initializing project with boilerplate...');
52
54
 
@@ -108,7 +108,8 @@
108
108
  {
109
109
  "id": 22,
110
110
  "name": "water_still",
111
- "textureUri": "textures/water.png"
111
+ "textureUri": "textures/water.png",
112
+ "isLiquid": true
112
113
  }
113
114
  ],
114
115
  "blocks": {
@@ -4,6 +4,8 @@
4
4
 
5
5
  ## BlockTypeOptions.customColliderOptions property
6
6
 
7
+ The custom collider options for the block type.
8
+
7
9
  **Signature:**
8
10
 
9
11
  ```typescript
@@ -4,6 +4,8 @@
4
4
 
5
5
  ## BlockTypeOptions.id property
6
6
 
7
+ The unique numeric identifier for the block type.
8
+
7
9
  **Signature:**
8
10
 
9
11
  ```typescript
@@ -4,6 +4,8 @@
4
4
 
5
5
  ## BlockTypeOptions.isLiquid property
6
6
 
7
+ Whether the block type is a liquid.
8
+
7
9
  **Signature:**
8
10
 
9
11
  ```typescript
@@ -50,7 +50,7 @@ Description
50
50
 
51
51
  </td><td>
52
52
 
53
- _(Optional)_
53
+ _(Optional)_ The custom collider options for the block type.
54
54
 
55
55
 
56
56
  </td></tr>
@@ -69,6 +69,8 @@ number
69
69
 
70
70
  </td><td>
71
71
 
72
+ The unique numeric identifier for the block type.
73
+
72
74
 
73
75
  </td></tr>
74
76
  <tr><td>
@@ -86,7 +88,7 @@ boolean
86
88
 
87
89
  </td><td>
88
90
 
89
- _(Optional)_
91
+ _(Optional)_ Whether the block type is a liquid.
90
92
 
91
93
 
92
94
  </td></tr>
@@ -105,6 +107,8 @@ string
105
107
 
106
108
  </td><td>
107
109
 
110
+ The name of the block type.
111
+
108
112
 
109
113
  </td></tr>
110
114
  <tr><td>
@@ -122,6 +126,8 @@ string
122
126
 
123
127
  </td><td>
124
128
 
129
+ The URI of the texture asset for the block type.
130
+
125
131
 
126
132
  </td></tr>
127
133
  </tbody></table>
@@ -4,6 +4,8 @@
4
4
 
5
5
  ## BlockTypeOptions.name property
6
6
 
7
+ The name of the block type.
8
+
7
9
  **Signature:**
8
10
 
9
11
  ```typescript
@@ -4,6 +4,8 @@
4
4
 
5
5
  ## BlockTypeOptions.textureUri property
6
6
 
7
+ The URI of the texture asset for the block type.
8
+
7
9
  **Signature:**
8
10
 
9
11
  ```typescript
@@ -85,6 +85,174 @@ ENTITY\_SENSOR
85
85
  </td><td>
86
86
 
87
87
 
88
+ </td></tr>
89
+ <tr><td>
90
+
91
+ GROUP\_1
92
+
93
+
94
+ </td><td>
95
+
96
+ `16`
97
+
98
+
99
+ </td><td>
100
+
101
+
102
+ </td></tr>
103
+ <tr><td>
104
+
105
+ GROUP\_10
106
+
107
+
108
+ </td><td>
109
+
110
+ `8192`
111
+
112
+
113
+ </td><td>
114
+
115
+
116
+ </td></tr>
117
+ <tr><td>
118
+
119
+ GROUP\_11
120
+
121
+
122
+ </td><td>
123
+
124
+ `16384`
125
+
126
+
127
+ </td><td>
128
+
129
+
130
+ </td></tr>
131
+ <tr><td>
132
+
133
+ GROUP\_12
134
+
135
+
136
+ </td><td>
137
+
138
+ `32768`
139
+
140
+
141
+ </td><td>
142
+
143
+
144
+ </td></tr>
145
+ <tr><td>
146
+
147
+ GROUP\_2
148
+
149
+
150
+ </td><td>
151
+
152
+ `32`
153
+
154
+
155
+ </td><td>
156
+
157
+
158
+ </td></tr>
159
+ <tr><td>
160
+
161
+ GROUP\_3
162
+
163
+
164
+ </td><td>
165
+
166
+ `64`
167
+
168
+
169
+ </td><td>
170
+
171
+
172
+ </td></tr>
173
+ <tr><td>
174
+
175
+ GROUP\_4
176
+
177
+
178
+ </td><td>
179
+
180
+ `128`
181
+
182
+
183
+ </td><td>
184
+
185
+
186
+ </td></tr>
187
+ <tr><td>
188
+
189
+ GROUP\_5
190
+
191
+
192
+ </td><td>
193
+
194
+ `256`
195
+
196
+
197
+ </td><td>
198
+
199
+
200
+ </td></tr>
201
+ <tr><td>
202
+
203
+ GROUP\_6
204
+
205
+
206
+ </td><td>
207
+
208
+ `512`
209
+
210
+
211
+ </td><td>
212
+
213
+
214
+ </td></tr>
215
+ <tr><td>
216
+
217
+ GROUP\_7
218
+
219
+
220
+ </td><td>
221
+
222
+ `1024`
223
+
224
+
225
+ </td><td>
226
+
227
+
228
+ </td></tr>
229
+ <tr><td>
230
+
231
+ GROUP\_8
232
+
233
+
234
+ </td><td>
235
+
236
+ `2048`
237
+
238
+
239
+ </td><td>
240
+
241
+
242
+ </td></tr>
243
+ <tr><td>
244
+
245
+ GROUP\_9
246
+
247
+
248
+ </td><td>
249
+
250
+ `4096`
251
+
252
+
253
+ </td><td>
254
+
255
+
88
256
  </td></tr>
89
257
  <tr><td>
90
258
 
@@ -507,6 +507,27 @@ _(Optional)_ A function that is called when the entity is spawned.
507
507
  _(Optional)_ A function that is called every tick.
508
508
 
509
509
 
510
+ </td></tr>
511
+ <tr><td>
512
+
513
+ [opacity](./server.entity.opacity.md)
514
+
515
+
516
+ </td><td>
517
+
518
+ `readonly`
519
+
520
+
521
+ </td><td>
522
+
523
+ number \| undefined
524
+
525
+
526
+ </td><td>
527
+
528
+ The opacity of the entity between 0 and 1. 0 is fully transparent, 1 is fully opaque.
529
+
530
+
510
531
  </td></tr>
511
532
  <tr><td>
512
533
 
@@ -646,6 +667,20 @@ Sets the playback rate of all animations on the entity's model.
646
667
  Sets the nodes to hide on the entity's model. Matched nodes will be hidden for all players. Uses case insensitive substring matching.
647
668
 
648
669
 
670
+ </td></tr>
671
+ <tr><td>
672
+
673
+ [setOpacity(opacity)](./server.entity.setopacity.md)
674
+
675
+
676
+ </td><td>
677
+
678
+
679
+ </td><td>
680
+
681
+ Sets the opacity of the entity.
682
+
683
+
649
684
  </td></tr>
650
685
  <tr><td>
651
686
 
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Entity](./server.entity.md) &gt; [opacity](./server.entity.opacity.md)
4
+
5
+ ## Entity.opacity property
6
+
7
+ The opacity of the entity between 0 and 1. 0 is fully transparent, 1 is fully opaque.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ get opacity(): number | undefined;
13
+ ```
@@ -0,0 +1,53 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Entity](./server.entity.md) &gt; [setOpacity](./server.entity.setopacity.md)
4
+
5
+ ## Entity.setOpacity() method
6
+
7
+ Sets the opacity of the entity.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ setOpacity(opacity: number): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ opacity
36
+
37
+
38
+ </td><td>
39
+
40
+ number
41
+
42
+
43
+ </td><td>
44
+
45
+ The opacity of the entity between 0 and 1. 0 is fully transparent, 1 is fully opaque.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+ **Returns:**
51
+
52
+ void
53
+
@@ -51,6 +51,15 @@ Description
51
51
  </td><td>
52
52
 
53
53
 
54
+ </td></tr>
55
+ <tr><td>
56
+
57
+ [SetOpacity](./server.entityeventpayload.setopacity.md)
58
+
59
+
60
+ </td><td>
61
+
62
+
54
63
  </td></tr>
55
64
  <tr><td>
56
65
 
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [EntityEventPayload](./server.entityeventpayload.md) &gt; [SetOpacity](./server.entityeventpayload.setopacity.md) &gt; [entity](./server.entityeventpayload.setopacity.entity.md)
4
+
5
+ ## EntityEventPayload.SetOpacity.entity property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ entity: Entity;
11
+ ```
@@ -0,0 +1,70 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [EntityEventPayload](./server.entityeventpayload.md) &gt; [SetOpacity](./server.entityeventpayload.setopacity.md)
4
+
5
+ ## EntityEventPayload.SetOpacity interface
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ interface SetOpacity
11
+ ```
12
+
13
+ ## Properties
14
+
15
+ <table><thead><tr><th>
16
+
17
+ Property
18
+
19
+
20
+ </th><th>
21
+
22
+ Modifiers
23
+
24
+
25
+ </th><th>
26
+
27
+ Type
28
+
29
+
30
+ </th><th>
31
+
32
+ Description
33
+
34
+
35
+ </th></tr></thead>
36
+ <tbody><tr><td>
37
+
38
+ [entity](./server.entityeventpayload.setopacity.entity.md)
39
+
40
+
41
+ </td><td>
42
+
43
+
44
+ </td><td>
45
+
46
+ [Entity](./server.entity.md)
47
+
48
+
49
+ </td><td>
50
+
51
+
52
+ </td></tr>
53
+ <tr><td>
54
+
55
+ [opacity](./server.entityeventpayload.setopacity.opacity.md)
56
+
57
+
58
+ </td><td>
59
+
60
+
61
+ </td><td>
62
+
63
+ number
64
+
65
+
66
+ </td><td>
67
+
68
+
69
+ </td></tr>
70
+ </tbody></table>
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [EntityEventPayload](./server.entityeventpayload.md) &gt; [SetOpacity](./server.entityeventpayload.setopacity.md) &gt; [opacity](./server.entityeventpayload.setopacity.opacity.md)
4
+
5
+ ## EntityEventPayload.SetOpacity.opacity property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ opacity: number;
11
+ ```
@@ -71,6 +71,20 @@ SET\_MODEL\_HIDDEN\_NODES
71
71
  </td><td>
72
72
 
73
73
 
74
+ </td></tr>
75
+ <tr><td>
76
+
77
+ SET\_OPACITY
78
+
79
+
80
+ </td><td>
81
+
82
+ `"ENTITY.SET_OPACITY"`
83
+
84
+
85
+ </td><td>
86
+
87
+
74
88
  </td></tr>
75
89
  <tr><td>
76
90
 
@@ -205,6 +205,25 @@ string
205
205
  _(Optional)_ The name of the entity.
206
206
 
207
207
 
208
+ </td></tr>
209
+ <tr><td>
210
+
211
+ [opacity?](./server.entityoptions.opacity.md)
212
+
213
+
214
+ </td><td>
215
+
216
+
217
+ </td><td>
218
+
219
+ number
220
+
221
+
222
+ </td><td>
223
+
224
+ _(Optional)_ The opacity of the entity between 0 and 1. 0 is fully transparent, 1 is fully opaque.
225
+
226
+
208
227
  </td></tr>
209
228
  <tr><td>
210
229
 
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [EntityOptions](./server.entityoptions.md) &gt; [opacity](./server.entityoptions.opacity.md)
4
+
5
+ ## EntityOptions.opacity property
6
+
7
+ The opacity of the entity between 0 and 1. 0 is fully transparent, 1 is fully opaque.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ opacity?: number;
13
+ ```
@@ -246,6 +246,25 @@ number
246
246
  The normalized horizontal velocity applied to the entity when it runs.
247
247
 
248
248
 
249
+ </td></tr>
250
+ <tr><td>
251
+
252
+ [sticksToPlatforms](./server.playerentitycontroller.stickstoplatforms.md)
253
+
254
+
255
+ </td><td>
256
+
257
+
258
+ </td><td>
259
+
260
+ boolean
261
+
262
+
263
+ </td><td>
264
+
265
+ Whether the entity sticks to platforms.
266
+
267
+
249
268
  </td></tr>
250
269
  <tr><td>
251
270
 
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [PlayerEntityController](./server.playerentitycontroller.md) &gt; [sticksToPlatforms](./server.playerentitycontroller.stickstoplatforms.md)
4
+
5
+ ## PlayerEntityController.sticksToPlatforms property
6
+
7
+ Whether the entity sticks to platforms.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ sticksToPlatforms: boolean;
13
+ ```
@@ -129,6 +129,25 @@ number
129
129
  _(Optional)_ The normalized horizontal velocity applied to the entity when it runs.
130
130
 
131
131
 
132
+ </td></tr>
133
+ <tr><td>
134
+
135
+ [sticksToPlatforms?](./server.playerentitycontrolleroptions.stickstoplatforms.md)
136
+
137
+
138
+ </td><td>
139
+
140
+
141
+ </td><td>
142
+
143
+ boolean
144
+
145
+
146
+ </td><td>
147
+
148
+ _(Optional)_ Whether the entity sticks to platforms, defaults to true.
149
+
150
+
132
151
  </td></tr>
133
152
  <tr><td>
134
153
 
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [PlayerEntityControllerOptions](./server.playerentitycontrolleroptions.md) &gt; [sticksToPlatforms](./server.playerentitycontrolleroptions.stickstoplatforms.md)
4
+
5
+ ## PlayerEntityControllerOptions.sticksToPlatforms property
6
+
7
+ Whether the entity sticks to platforms, defaults to true.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ sticksToPlatforms?: boolean;
13
+ ```
@@ -8,7 +8,8 @@
8
8
  },
9
9
  "author": "",
10
10
  "license": "ISC",
11
- "devDependencies": {
12
- "@hytopia.com/assets": "^0.1.6"
11
+ "dependencies": {
12
+ "hytopia": "latest",
13
+ "@hytopia.com/assets": "latest"
13
14
  }
14
15
  }
@@ -9,7 +9,8 @@
9
9
  "keywords": [],
10
10
  "author": "",
11
11
  "license": "ISC",
12
- "devDependencies": {
13
- "@hytopia.com/assets": "^0.1.6"
12
+ "dependencies": {
13
+ "hytopia": "latest",
14
+ "@hytopia.com/assets": "latest"
14
15
  }
15
16
  }