hytopia 0.1.55 → 0.1.56

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 (37) hide show
  1. package/docs/server.basecharactercontroller.attach.md +53 -0
  2. package/docs/server.basecharactercontroller.despawn.md +53 -0
  3. package/docs/server.basecharactercontroller.detach.md +53 -0
  4. package/docs/server.basecharactercontroller.md +91 -28
  5. package/docs/server.basecharactercontroller.onattach.md +13 -0
  6. package/docs/server.basecharactercontroller.ondespawn.md +13 -0
  7. package/docs/server.basecharactercontroller.ondetach.md +13 -0
  8. package/docs/server.basecharactercontroller.onspawn.md +13 -0
  9. package/docs/server.basecharactercontroller.ontick.md +2 -2
  10. package/docs/server.basecharactercontroller.ontickwithplayerinput.md +2 -2
  11. package/docs/server.basecharactercontroller.spawn.md +53 -0
  12. package/docs/server.basecharactercontroller.tick.md +15 -1
  13. package/docs/server.basecharactercontroller.tickwithplayerinput.md +17 -1
  14. package/docs/server.defaultcharactercontroller._constructor_.md +1 -17
  15. package/docs/server.defaultcharactercontroller.attach.md +53 -0
  16. package/docs/server.defaultcharactercontroller.md +18 -4
  17. package/docs/server.defaultcharactercontroller.spawn.md +53 -0
  18. package/docs/server.defaultcharactercontroller.tickwithplayerinput.md +17 -1
  19. package/docs/server.entity.md +0 -19
  20. package/docs/server.entity.setcharactercontroller.md +2 -2
  21. package/docs/server.entityoptions.charactercontroller.md +13 -0
  22. package/docs/server.entityoptions.md +3 -3
  23. package/examples/block-entity/index.ts +1 -1
  24. package/examples/character-controller/MyCharacterController.ts +190 -119
  25. package/examples/character-controller/index.ts +5 -10
  26. package/examples/custom-ui/index.ts +1 -1
  27. package/examples/payload-game/index.ts +6 -7
  28. package/package.json +1 -1
  29. package/server.api.json +468 -176
  30. package/server.d.ts +71 -40
  31. package/server.js +81 -81
  32. package/docs/server.basecharactercontroller._constructor_.md +0 -65
  33. package/docs/server.basecharactercontroller.createcolliders.md +0 -19
  34. package/docs/server.basecharactercontroller.entity.md +0 -13
  35. package/docs/server.defaultcharactercontroller.createcolliders.md +0 -19
  36. package/docs/server.entity.createcustomcharactercontroller.md +0 -13
  37. package/docs/server.entityoptions.createcustomcharactercontroller.md +0 -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; [BaseCharacterController](./server.basecharactercontroller.md) &gt; [attach](./server.basecharactercontroller.attach.md)
4
+
5
+ ## BaseCharacterController.attach() method
6
+
7
+ Override this method to handle the attachment of an entity to your character controller.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ attach(entity: Entity): 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
+ entity
36
+
37
+
38
+ </td><td>
39
+
40
+ [Entity](./server.entity.md)
41
+
42
+
43
+ </td><td>
44
+
45
+ The entity to attach the controller to.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+ **Returns:**
51
+
52
+ void
53
+
@@ -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; [BaseCharacterController](./server.basecharactercontroller.md) &gt; [despawn](./server.basecharactercontroller.despawn.md)
4
+
5
+ ## BaseCharacterController.despawn() method
6
+
7
+ Override this method to handle the despawn of an entity from your character controller.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ despawn(entity: Entity): 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
+ entity
36
+
37
+
38
+ </td><td>
39
+
40
+ [Entity](./server.entity.md)
41
+
42
+
43
+ </td><td>
44
+
45
+ The entity to despawn.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+ **Returns:**
51
+
52
+ void
53
+
@@ -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; [BaseCharacterController](./server.basecharactercontroller.md) &gt; [detach](./server.basecharactercontroller.detach.md)
4
+
5
+ ## BaseCharacterController.detach() method
6
+
7
+ Override this method to handle the detachment of an entity from your character controller.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ detach(entity: Entity): 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
+ entity
36
+
37
+
38
+ </td><td>
39
+
40
+ [Entity](./server.entity.md)
41
+
42
+
43
+ </td><td>
44
+
45
+ The entity to detach.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+ **Returns:**
51
+
52
+ void
53
+
@@ -16,11 +16,11 @@ export default abstract class BaseCharacterController
16
16
 
17
17
  The BaseCharacterController should be extended by a more specific character controller that you or a plugin implements.
18
18
 
19
- ## Constructors
19
+ ## Properties
20
20
 
21
21
  <table><thead><tr><th>
22
22
 
23
- Constructor
23
+ Property
24
24
 
25
25
 
26
26
  </th><th>
@@ -28,6 +28,11 @@ Constructor
28
28
  Modifiers
29
29
 
30
30
 
31
+ </th><th>
32
+
33
+ Type
34
+
35
+
31
36
  </th><th>
32
37
 
33
38
  Description
@@ -36,61 +41,77 @@ Description
36
41
  </th></tr></thead>
37
42
  <tbody><tr><td>
38
43
 
39
- [(constructor)(entity, \_options)](./server.basecharactercontroller._constructor_.md)
44
+ [onAttach?](./server.basecharactercontroller.onattach.md)
45
+
46
+
47
+ </td><td>
40
48
 
41
49
 
42
50
  </td><td>
43
51
 
52
+ (entity: [Entity](./server.entity.md)<!-- -->) =&gt; void
53
+
44
54
 
45
55
  </td><td>
46
56
 
47
- Constructs a new instance of the `BaseCharacterController` class
57
+ _(Optional)_ A function that is called when the controller is attached to an entity. Useful for implementing attach logic without writing a new character controller class.
48
58
 
49
59
 
50
60
  </td></tr>
51
- </tbody></table>
61
+ <tr><td>
52
62
 
53
- ## Properties
63
+ [onDespawn?](./server.basecharactercontroller.ondespawn.md)
54
64
 
55
- <table><thead><tr><th>
56
65
 
57
- Property
66
+ </td><td>
58
67
 
59
68
 
60
- </th><th>
69
+ </td><td>
61
70
 
62
- Modifiers
71
+ (entity: [Entity](./server.entity.md)<!-- -->) =&gt; void
63
72
 
64
73
 
65
- </th><th>
74
+ </td><td>
66
75
 
67
- Type
76
+ _(Optional)_ A function that is called when the controlled entity is despawned. Useful for implementing despawn logic without writing a new character controller class.
68
77
 
69
78
 
70
- </th><th>
79
+ </td></tr>
80
+ <tr><td>
71
81
 
72
- Description
82
+ [onDetach?](./server.basecharactercontroller.ondetach.md)
73
83
 
74
84
 
75
- </th></tr></thead>
76
- <tbody><tr><td>
85
+ </td><td>
77
86
 
78
- [entity](./server.basecharactercontroller.entity.md)
87
+
88
+ </td><td>
89
+
90
+ (entity: [Entity](./server.entity.md)<!-- -->) =&gt; void
79
91
 
80
92
 
81
93
  </td><td>
82
94
 
83
- `readonly`
95
+ _(Optional)_ A function that is called when the controller is detached from an entity. Useful for implementing detach logic without writing a new character controller class.
96
+
97
+
98
+ </td></tr>
99
+ <tr><td>
100
+
101
+ [onSpawn?](./server.basecharactercontroller.onspawn.md)
84
102
 
85
103
 
86
104
  </td><td>
87
105
 
88
- [Entity](./server.entity.md)
106
+
107
+ </td><td>
108
+
109
+ (entity: [Entity](./server.entity.md)<!-- -->) =&gt; void
89
110
 
90
111
 
91
112
  </td><td>
92
113
 
93
- The entity the controller is for.
114
+ _(Optional)_ A function that is called when the controlled entity is spawned. Useful for implementing spawn logic without writing a new character controller class.
94
115
 
95
116
 
96
117
  </td></tr>
@@ -104,12 +125,12 @@ The entity the controller is for.
104
125
 
105
126
  </td><td>
106
127
 
107
- (deltaTimeMs: number) =&gt; void
128
+ (entity: [Entity](./server.entity.md)<!-- -->, deltaTimeMs: number) =&gt; void
108
129
 
109
130
 
110
131
  </td><td>
111
132
 
112
- _(Optional)_ A callback function for when the controller ticks.
133
+ _(Optional)_ A function that is called every tick. Useful for implementing tick logic without writing a new character controller class.
113
134
 
114
135
 
115
136
  </td></tr>
@@ -123,12 +144,12 @@ _(Optional)_ A callback function for when the controller ticks.
123
144
 
124
145
  </td><td>
125
146
 
126
- (input: [PlayerInput](./server.playerinput.md)<!-- -->, cameraOrientation: [PlayerCameraOrientation](./server.playercameraorientation.md)<!-- -->, deltaTimeMs: number) =&gt; void
147
+ (entity: [PlayerEntity](./server.playerentity.md)<!-- -->, input: [PlayerInput](./server.playerinput.md)<!-- -->, cameraOrientation: [PlayerCameraOrientation](./server.playercameraorientation.md)<!-- -->, deltaTimeMs: number) =&gt; void
127
148
 
128
149
 
129
150
  </td><td>
130
151
 
131
- _(Optional)_ A callback function for when the controller ticks player movement.
152
+ _(Optional)_ A function that is called every tick with player input by a PlayerEntity with this controller attached. Useful for implementing tick logic without writing a new character controller class.
132
153
 
133
154
 
134
155
  </td></tr>
@@ -154,7 +175,49 @@ Description
154
175
  </th></tr></thead>
155
176
  <tbody><tr><td>
156
177
 
157
- [createColliders()](./server.basecharactercontroller.createcolliders.md)
178
+ [attach(entity)](./server.basecharactercontroller.attach.md)
179
+
180
+
181
+ </td><td>
182
+
183
+
184
+ </td><td>
185
+
186
+ Override this method to handle the attachment of an entity to your character controller.
187
+
188
+
189
+ </td></tr>
190
+ <tr><td>
191
+
192
+ [despawn(entity)](./server.basecharactercontroller.despawn.md)
193
+
194
+
195
+ </td><td>
196
+
197
+
198
+ </td><td>
199
+
200
+ Override this method to handle the despawn of an entity from your character controller.
201
+
202
+
203
+ </td></tr>
204
+ <tr><td>
205
+
206
+ [detach(entity)](./server.basecharactercontroller.detach.md)
207
+
208
+
209
+ </td><td>
210
+
211
+
212
+ </td><td>
213
+
214
+ Override this method to handle the detachment of an entity from your character controller.
215
+
216
+
217
+ </td></tr>
218
+ <tr><td>
219
+
220
+ [spawn(entity)](./server.basecharactercontroller.spawn.md)
158
221
 
159
222
 
160
223
  </td><td>
@@ -162,13 +225,13 @@ Description
162
225
 
163
226
  </td><td>
164
227
 
165
- Override this method to create controller specific colliders to be attached to the controlled entity when it spawns.
228
+ Override this method to handle the spawning of an entity to your character controller.
166
229
 
167
230
 
168
231
  </td></tr>
169
232
  <tr><td>
170
233
 
171
- [tick(deltaTimeMs)](./server.basecharactercontroller.tick.md)
234
+ [tick(entity, deltaTimeMs)](./server.basecharactercontroller.tick.md)
172
235
 
173
236
 
174
237
  </td><td>
@@ -182,7 +245,7 @@ Override this method to handle entity movements based on your character controll
182
245
  </td></tr>
183
246
  <tr><td>
184
247
 
185
- [tickWithPlayerInput(input, cameraOrientation, deltaTimeMs)](./server.basecharactercontroller.tickwithplayerinput.md)
248
+ [tickWithPlayerInput(entity, input, cameraOrientation, deltaTimeMs)](./server.basecharactercontroller.tickwithplayerinput.md)
186
249
 
187
250
 
188
251
  </td><td>
@@ -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; [BaseCharacterController](./server.basecharactercontroller.md) &gt; [onAttach](./server.basecharactercontroller.onattach.md)
4
+
5
+ ## BaseCharacterController.onAttach property
6
+
7
+ A function that is called when the controller is attached to an entity. Useful for implementing attach logic without writing a new character controller class.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ onAttach?: (entity: Entity) => void;
13
+ ```
@@ -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; [BaseCharacterController](./server.basecharactercontroller.md) &gt; [onDespawn](./server.basecharactercontroller.ondespawn.md)
4
+
5
+ ## BaseCharacterController.onDespawn property
6
+
7
+ A function that is called when the controlled entity is despawned. Useful for implementing despawn logic without writing a new character controller class.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ onDespawn?: (entity: Entity) => void;
13
+ ```
@@ -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; [BaseCharacterController](./server.basecharactercontroller.md) &gt; [onDetach](./server.basecharactercontroller.ondetach.md)
4
+
5
+ ## BaseCharacterController.onDetach property
6
+
7
+ A function that is called when the controller is detached from an entity. Useful for implementing detach logic without writing a new character controller class.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ onDetach?: (entity: Entity) => void;
13
+ ```
@@ -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; [BaseCharacterController](./server.basecharactercontroller.md) &gt; [onSpawn](./server.basecharactercontroller.onspawn.md)
4
+
5
+ ## BaseCharacterController.onSpawn property
6
+
7
+ A function that is called when the controlled entity is spawned. Useful for implementing spawn logic without writing a new character controller class.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ onSpawn?: (entity: Entity) => void;
13
+ ```
@@ -4,10 +4,10 @@
4
4
 
5
5
  ## BaseCharacterController.onTick property
6
6
 
7
- A callback function for when the controller ticks.
7
+ A function that is called every tick. Useful for implementing tick logic without writing a new character controller class.
8
8
 
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- onTick?: (deltaTimeMs: number) => void;
12
+ onTick?: (entity: Entity, deltaTimeMs: number) => void;
13
13
  ```
@@ -4,10 +4,10 @@
4
4
 
5
5
  ## BaseCharacterController.onTickWithPlayerInput property
6
6
 
7
- A callback function for when the controller ticks player movement.
7
+ A function that is called every tick with player input by a PlayerEntity with this controller attached. Useful for implementing tick logic without writing a new character controller class.
8
8
 
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- onTickWithPlayerInput?: (input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number) => void;
12
+ onTickWithPlayerInput?: (entity: PlayerEntity, input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number) => void;
13
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; [BaseCharacterController](./server.basecharactercontroller.md) &gt; [spawn](./server.basecharactercontroller.spawn.md)
4
+
5
+ ## BaseCharacterController.spawn() method
6
+
7
+ Override this method to handle the spawning of an entity to your character controller.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ spawn(entity: Entity): 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
+ entity
36
+
37
+
38
+ </td><td>
39
+
40
+ [Entity](./server.entity.md)
41
+
42
+
43
+ </td><td>
44
+
45
+ The entity to spawn.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+ **Returns:**
51
+
52
+ void
53
+
@@ -9,7 +9,7 @@ Override this method to handle entity movements based on your character controll
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- tick(deltaTimeMs: number): void;
12
+ tick(entity: Entity, deltaTimeMs: number): void;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -32,6 +32,20 @@ Description
32
32
  </th></tr></thead>
33
33
  <tbody><tr><td>
34
34
 
35
+ entity
36
+
37
+
38
+ </td><td>
39
+
40
+ [Entity](./server.entity.md)
41
+
42
+
43
+ </td><td>
44
+
45
+
46
+ </td></tr>
47
+ <tr><td>
48
+
35
49
  deltaTimeMs
36
50
 
37
51
 
@@ -9,7 +9,7 @@ Override this method to handle entity movements based on player input for your c
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- tickWithPlayerInput(input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number): void;
12
+ tickWithPlayerInput(entity: PlayerEntity, input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number): void;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -32,6 +32,22 @@ Description
32
32
  </th></tr></thead>
33
33
  <tbody><tr><td>
34
34
 
35
+ entity
36
+
37
+
38
+ </td><td>
39
+
40
+ [PlayerEntity](./server.playerentity.md)
41
+
42
+
43
+ </td><td>
44
+
45
+ The entity to tick.
46
+
47
+
48
+ </td></tr>
49
+ <tr><td>
50
+
35
51
  input
36
52
 
37
53
 
@@ -9,7 +9,7 @@ Constructs a new instance of the `DefaultCharacterController` class
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- constructor(entity: Entity, options?: DefaultCharacterControllerOptions);
12
+ constructor(options?: DefaultCharacterControllerOptions);
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -32,22 +32,6 @@ Description
32
32
  </th></tr></thead>
33
33
  <tbody><tr><td>
34
34
 
35
- entity
36
-
37
-
38
- </td><td>
39
-
40
- [Entity](./server.entity.md)
41
-
42
-
43
- </td><td>
44
-
45
- The entity the controller is for.
46
-
47
-
48
- </td></tr>
49
- <tr><td>
50
-
51
35
  options
52
36
 
53
37
 
@@ -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; [DefaultCharacterController](./server.defaultcharactercontroller.md) &gt; [attach](./server.defaultcharactercontroller.attach.md)
4
+
5
+ ## DefaultCharacterController.attach() method
6
+
7
+ Called when the controller is attached to an entity.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ attach(entity: Entity): 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
+ entity
36
+
37
+
38
+ </td><td>
39
+
40
+ [Entity](./server.entity.md)
41
+
42
+
43
+ </td><td>
44
+
45
+ The entity to attach the controller to.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+ **Returns:**
51
+
52
+ void
53
+