hytopia 0.11.1 → 0.12.0-prerelease-1
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/bin/scripts.js +1 -1
- package/boilerplate/index.ts +1 -1
- package/docs/server.blocktexturemetadata.md +21 -0
- package/docs/server.blocktextureregistry.generateeverystart.md +13 -0
- package/docs/server.blocktextureregistry.getblocktexturemetadata.md +56 -0
- package/docs/server.blocktextureregistry.hasblocktexture.md +56 -0
- package/docs/server.blocktextureregistry.instance.md +13 -0
- package/docs/server.blocktextureregistry.md +145 -0
- package/docs/server.eventpayloads.md +2 -2
- package/docs/server.gameserver.blocktextureregistry.md +13 -0
- package/docs/server.gameserver.md +21 -0
- package/docs/server.md +22 -11
- package/package.json +2 -1
- package/server.api.json +238 -36
- package/server.d.ts +65 -12
- package/server.mjs +223 -219
- package/docs/server.port.md +0 -13
package/bin/scripts.js
CHANGED
|
@@ -474,7 +474,7 @@ async function packageProject() {
|
|
|
474
474
|
async function build(devMode = false) {
|
|
475
475
|
let envFlags = devMode ? '' : '--minify --sourcemap=inline';
|
|
476
476
|
|
|
477
|
-
execSync(`npx --yes bun build --target=node --env=disable --format=esm ${envFlags} --outfile=index.mjs index.ts`, { stdio: 'inherit' });
|
|
477
|
+
execSync(`npx --yes bun build --target=node --env=disable --format=esm ${envFlags} --external=@fails-components/webtransport-transport-http3-quiche --outfile=index.mjs index.ts`, { stdio: 'inherit' });
|
|
478
478
|
}
|
|
479
479
|
|
|
480
480
|
/**
|
package/boilerplate/index.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [server](./server.md) > [BlockTextureMetadata](./server.blocktexturemetadata.md)
|
|
4
|
+
|
|
5
|
+
## BlockTextureMetadata type
|
|
6
|
+
|
|
7
|
+
Block texture metadata including UVs and rendering hints.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export type BlockTextureMetadata = {
|
|
13
|
+
u0: number;
|
|
14
|
+
v0: number;
|
|
15
|
+
u1: number;
|
|
16
|
+
v1: number;
|
|
17
|
+
averageRGB: [number, number, number];
|
|
18
|
+
isTransparent: boolean;
|
|
19
|
+
needsAlphaTest: boolean;
|
|
20
|
+
};
|
|
21
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [server](./server.md) > [BlockTextureRegistry](./server.blocktextureregistry.md) > [generateEveryStart](./server.blocktextureregistry.generateeverystart.md)
|
|
4
|
+
|
|
5
|
+
## BlockTextureRegistry.generateEveryStart property
|
|
6
|
+
|
|
7
|
+
Whether to always generate the atlas on server start.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
generateEveryStart: boolean;
|
|
13
|
+
```
|
|
@@ -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) > [BlockTextureRegistry](./server.blocktextureregistry.md) > [getBlockTextureMetadata](./server.blocktextureregistry.getblocktexturemetadata.md)
|
|
4
|
+
|
|
5
|
+
## BlockTextureRegistry.getBlockTextureMetadata() method
|
|
6
|
+
|
|
7
|
+
Retrieves metadata for a block texture. Returns array for cubemaps (6 faces) or standard textures (1 face).
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
getBlockTextureMetadata(textureUri: string): BlockTextureMetadata[] | undefined;
|
|
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
|
+
textureUri
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</td><td>
|
|
39
|
+
|
|
40
|
+
string
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</td><td>
|
|
44
|
+
|
|
45
|
+
The URI of the texture (e.g., 'blocks/stone.png' or 'blocks/grass').
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
</td></tr>
|
|
49
|
+
</tbody></table>
|
|
50
|
+
|
|
51
|
+
**Returns:**
|
|
52
|
+
|
|
53
|
+
[BlockTextureMetadata](./server.blocktexturemetadata.md)<!-- -->\[\] \| undefined
|
|
54
|
+
|
|
55
|
+
Array of texture metadata, or undefined if not found.
|
|
56
|
+
|
|
@@ -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) > [BlockTextureRegistry](./server.blocktextureregistry.md) > [hasBlockTexture](./server.blocktextureregistry.hasblocktexture.md)
|
|
4
|
+
|
|
5
|
+
## BlockTextureRegistry.hasBlockTexture() method
|
|
6
|
+
|
|
7
|
+
Checks if a block texture is registered in the atlas.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
hasBlockTexture(textureUri: string): boolean;
|
|
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
|
+
textureUri
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</td><td>
|
|
39
|
+
|
|
40
|
+
string
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</td><td>
|
|
44
|
+
|
|
45
|
+
The URI of the texture (e.g., 'blocks/stone.png' or 'blocks/grass' for cubemaps).
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
</td></tr>
|
|
49
|
+
</tbody></table>
|
|
50
|
+
|
|
51
|
+
**Returns:**
|
|
52
|
+
|
|
53
|
+
boolean
|
|
54
|
+
|
|
55
|
+
Whether the texture is registered.
|
|
56
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [server](./server.md) > [BlockTextureRegistry](./server.blocktextureregistry.md) > [instance](./server.blocktextureregistry.instance.md)
|
|
4
|
+
|
|
5
|
+
## BlockTextureRegistry.instance property
|
|
6
|
+
|
|
7
|
+
The global BlockTextureRegistry instance as a singleton.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
static readonly instance: BlockTextureRegistry;
|
|
13
|
+
```
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [server](./server.md) > [BlockTextureRegistry](./server.blocktextureregistry.md)
|
|
4
|
+
|
|
5
|
+
## BlockTextureRegistry class
|
|
6
|
+
|
|
7
|
+
Manages block textures and block texture atlas generation of the game.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export default class BlockTextureRegistry
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
The BlockTextureRegistry is created internally as a global singletone accessible with the static property `BlockTextureRegistry.instance`<!-- -->.
|
|
18
|
+
|
|
19
|
+
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BlockTextureRegistry` class.
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { BlockTextureRegistry } from 'hytopia';
|
|
26
|
+
|
|
27
|
+
const blockTextureRegistry = BlockTextureRegistry.instance;
|
|
28
|
+
const metadata = blockTextureRegistry.getBlockTextureMetadata('blocks/stone.png');
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Properties
|
|
32
|
+
|
|
33
|
+
<table><thead><tr><th>
|
|
34
|
+
|
|
35
|
+
Property
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</th><th>
|
|
39
|
+
|
|
40
|
+
Modifiers
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</th><th>
|
|
44
|
+
|
|
45
|
+
Type
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
</th><th>
|
|
49
|
+
|
|
50
|
+
Description
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</th></tr></thead>
|
|
54
|
+
<tbody><tr><td>
|
|
55
|
+
|
|
56
|
+
[generateEveryStart](./server.blocktextureregistry.generateeverystart.md)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
</td><td>
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
</td><td>
|
|
63
|
+
|
|
64
|
+
boolean
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
</td><td>
|
|
68
|
+
|
|
69
|
+
Whether to always generate the atlas on server start.
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
</td></tr>
|
|
73
|
+
<tr><td>
|
|
74
|
+
|
|
75
|
+
[instance](./server.blocktextureregistry.instance.md)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
</td><td>
|
|
79
|
+
|
|
80
|
+
`static`
|
|
81
|
+
|
|
82
|
+
`readonly`
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
</td><td>
|
|
86
|
+
|
|
87
|
+
[BlockTextureRegistry](./server.blocktextureregistry.md)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
</td><td>
|
|
91
|
+
|
|
92
|
+
The global BlockTextureRegistry instance as a singleton.
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
</td></tr>
|
|
96
|
+
</tbody></table>
|
|
97
|
+
|
|
98
|
+
## Methods
|
|
99
|
+
|
|
100
|
+
<table><thead><tr><th>
|
|
101
|
+
|
|
102
|
+
Method
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
</th><th>
|
|
106
|
+
|
|
107
|
+
Modifiers
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
</th><th>
|
|
111
|
+
|
|
112
|
+
Description
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
</th></tr></thead>
|
|
116
|
+
<tbody><tr><td>
|
|
117
|
+
|
|
118
|
+
[getBlockTextureMetadata(textureUri)](./server.blocktextureregistry.getblocktexturemetadata.md)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
</td><td>
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
</td><td>
|
|
125
|
+
|
|
126
|
+
Retrieves metadata for a block texture. Returns array for cubemaps (6 faces) or standard textures (1 face).
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
</td></tr>
|
|
130
|
+
<tr><td>
|
|
131
|
+
|
|
132
|
+
[hasBlockTexture(textureUri)](./server.blocktextureregistry.hasblocktexture.md)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
</td><td>
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
</td><td>
|
|
139
|
+
|
|
140
|
+
Checks if a block texture is registered in the atlas.
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
</td></tr>
|
|
144
|
+
</tbody></table>
|
|
145
|
+
|
|
@@ -9,7 +9,7 @@ The payloads for all events in the game server.
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
export interface EventPayloads extends AudioEventPayloads, BaseEntityControllerEventPayloads, BlockTypeEventPayloads, BlockTypeRegistryEventPayloads, ChatEventPayloads, ChunkLatticeEventPayloads, ConnectionEventPayloads, EntityEventPayloads, GameServerEventPayloads, ParticleEmitterEventPayloads, PlayerCameraEventPayloads, PlayerEventPayloads, PlayerManagerEventPayloads, PlayerUIEventPayloads, SceneUIEventPayloads, SimulationEventPayloads,
|
|
12
|
+
export interface EventPayloads extends AudioEventPayloads, BaseEntityControllerEventPayloads, BlockTypeEventPayloads, BlockTypeRegistryEventPayloads, ChatEventPayloads, ChunkLatticeEventPayloads, ConnectionEventPayloads, EntityEventPayloads, GameServerEventPayloads, ParticleEmitterEventPayloads, PlayerCameraEventPayloads, PlayerEventPayloads, PlayerManagerEventPayloads, PlayerUIEventPayloads, SceneUIEventPayloads, SimulationEventPayloads, LightEventPayloads, WebServerEventPayloads, WorldEventPayloads, WorldLoopEventPayloads, WorldManagerEventPayloads
|
|
13
13
|
```
|
|
14
|
-
**Extends:** [AudioEventPayloads](./server.audioeventpayloads.md)<!-- -->, [BaseEntityControllerEventPayloads](./server.baseentitycontrollereventpayloads.md)<!-- -->, [BlockTypeEventPayloads](./server.blocktypeeventpayloads.md)<!-- -->, [BlockTypeRegistryEventPayloads](./server.blocktyperegistryeventpayloads.md)<!-- -->, [ChatEventPayloads](./server.chateventpayloads.md)<!-- -->, [ChunkLatticeEventPayloads](./server.chunklatticeeventpayloads.md)<!-- -->, ConnectionEventPayloads, [EntityEventPayloads](./server.entityeventpayloads.md)<!-- -->, [GameServerEventPayloads](./server.gameservereventpayloads.md)<!-- -->, [ParticleEmitterEventPayloads](./server.particleemittereventpayloads.md)<!-- -->, [PlayerCameraEventPayloads](./server.playercameraeventpayloads.md)<!-- -->, [PlayerEventPayloads](./server.playereventpayloads.md)<!-- -->, [PlayerManagerEventPayloads](./server.playermanagereventpayloads.md)<!-- -->, [PlayerUIEventPayloads](./server.playeruieventpayloads.md)<!-- -->, [SceneUIEventPayloads](./server.sceneuieventpayloads.md)<!-- -->, [SimulationEventPayloads](./server.simulationeventpayloads.md)<!-- -->,
|
|
14
|
+
**Extends:** [AudioEventPayloads](./server.audioeventpayloads.md)<!-- -->, [BaseEntityControllerEventPayloads](./server.baseentitycontrollereventpayloads.md)<!-- -->, [BlockTypeEventPayloads](./server.blocktypeeventpayloads.md)<!-- -->, [BlockTypeRegistryEventPayloads](./server.blocktyperegistryeventpayloads.md)<!-- -->, [ChatEventPayloads](./server.chateventpayloads.md)<!-- -->, [ChunkLatticeEventPayloads](./server.chunklatticeeventpayloads.md)<!-- -->, ConnectionEventPayloads, [EntityEventPayloads](./server.entityeventpayloads.md)<!-- -->, [GameServerEventPayloads](./server.gameservereventpayloads.md)<!-- -->, [ParticleEmitterEventPayloads](./server.particleemittereventpayloads.md)<!-- -->, [PlayerCameraEventPayloads](./server.playercameraeventpayloads.md)<!-- -->, [PlayerEventPayloads](./server.playereventpayloads.md)<!-- -->, [PlayerManagerEventPayloads](./server.playermanagereventpayloads.md)<!-- -->, [PlayerUIEventPayloads](./server.playeruieventpayloads.md)<!-- -->, [SceneUIEventPayloads](./server.sceneuieventpayloads.md)<!-- -->, [SimulationEventPayloads](./server.simulationeventpayloads.md)<!-- -->, [LightEventPayloads](./server.lighteventpayloads.md)<!-- -->, WebServerEventPayloads, [WorldEventPayloads](./server.worldeventpayloads.md)<!-- -->, [WorldLoopEventPayloads](./server.worldloopeventpayloads.md)<!-- -->, [WorldManagerEventPayloads](./server.worldmanagereventpayloads.md)
|
|
15
15
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [server](./server.md) > [GameServer](./server.gameserver.md) > [blockTextureRegistry](./server.gameserver.blocktextureregistry.md)
|
|
4
|
+
|
|
5
|
+
## GameServer.blockTextureRegistry property
|
|
6
|
+
|
|
7
|
+
The block texture registry for the game server.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
get blockTextureRegistry(): BlockTextureRegistry;
|
|
13
|
+
```
|
|
@@ -43,6 +43,27 @@ Description
|
|
|
43
43
|
</th></tr></thead>
|
|
44
44
|
<tbody><tr><td>
|
|
45
45
|
|
|
46
|
+
[blockTextureRegistry](./server.gameserver.blocktextureregistry.md)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
</td><td>
|
|
50
|
+
|
|
51
|
+
`readonly`
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
</td><td>
|
|
55
|
+
|
|
56
|
+
[BlockTextureRegistry](./server.blocktextureregistry.md)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
</td><td>
|
|
60
|
+
|
|
61
|
+
The block texture registry for the game server.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
</td></tr>
|
|
65
|
+
<tr><td>
|
|
66
|
+
|
|
46
67
|
[instance](./server.gameserver.instance.md)
|
|
47
68
|
|
|
48
69
|
|
package/docs/server.md
CHANGED
|
@@ -49,6 +49,17 @@ Manages audio instances in a world.
|
|
|
49
49
|
Represents a block in a world.
|
|
50
50
|
|
|
51
51
|
|
|
52
|
+
</td></tr>
|
|
53
|
+
<tr><td>
|
|
54
|
+
|
|
55
|
+
[BlockTextureRegistry](./server.blocktextureregistry.md)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
</td><td>
|
|
59
|
+
|
|
60
|
+
Manages block textures and block texture atlas generation of the game.
|
|
61
|
+
|
|
62
|
+
|
|
52
63
|
</td></tr>
|
|
53
64
|
<tr><td>
|
|
54
65
|
|
|
@@ -1499,17 +1510,6 @@ Description
|
|
|
1499
1510
|
The default rigid body options for a model entity when EntityOptions.rigidBodyOptions is not provided.
|
|
1500
1511
|
|
|
1501
1512
|
|
|
1502
|
-
</td></tr>
|
|
1503
|
-
<tr><td>
|
|
1504
|
-
|
|
1505
|
-
[PORT](./server.port.md)
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
</td><td>
|
|
1509
|
-
|
|
1510
|
-
The port the server will run on. You can override this in your .env by setting PORT. When deployed in production to HYTOPIA servers, any .env value will be ignored and 8080 will be used.
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
1513
|
</td></tr>
|
|
1514
1514
|
<tr><td>
|
|
1515
1515
|
|
|
@@ -1539,6 +1539,17 @@ Description
|
|
|
1539
1539
|
</th></tr></thead>
|
|
1540
1540
|
<tbody><tr><td>
|
|
1541
1541
|
|
|
1542
|
+
[BlockTextureMetadata](./server.blocktexturemetadata.md)
|
|
1543
|
+
|
|
1544
|
+
|
|
1545
|
+
</td><td>
|
|
1546
|
+
|
|
1547
|
+
Block texture metadata including UVs and rendering hints.
|
|
1548
|
+
|
|
1549
|
+
|
|
1550
|
+
</td></tr>
|
|
1551
|
+
<tr><td>
|
|
1552
|
+
|
|
1542
1553
|
[ColliderOptions](./server.collideroptions.md)
|
|
1543
1554
|
|
|
1544
1555
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hytopia",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0-prerelease-1",
|
|
4
4
|
"description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./server.mjs",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"homepage": "https://github.com/hytopiagg/sdk#readme",
|
|
58
58
|
"dependencies": {
|
|
59
|
+
"@fails-components/webtransport-transport-http3-quiche": "1.4.4",
|
|
59
60
|
"@gltf-transform/cli": "4.2.1",
|
|
60
61
|
"archiver": "7.0.1",
|
|
61
62
|
"bun": "1.3.0",
|