@hytopia.com/server-protocol 1.4.45 → 1.4.47
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/package.json +1 -1
- package/schemas/Block.ts +2 -0
- package/schemas/Chunk.ts +12 -0
package/package.json
CHANGED
package/schemas/Block.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { VectorSchema } from './Vector';
|
|
|
5
5
|
export type BlockSchema = {
|
|
6
6
|
i: number; // block id
|
|
7
7
|
c: VectorSchema; // block global coordinate
|
|
8
|
+
r?: number; // block rotation enum index
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
export const blockSchema: JSONSchemaType<BlockSchema> = {
|
|
@@ -12,6 +13,7 @@ export const blockSchema: JSONSchemaType<BlockSchema> = {
|
|
|
12
13
|
properties: {
|
|
13
14
|
i: { type: 'number' },
|
|
14
15
|
c: vectorSchema,
|
|
16
|
+
r: { type: 'number', nullable: true },
|
|
15
17
|
},
|
|
16
18
|
required: [ 'i', 'c' ],
|
|
17
19
|
additionalProperties: false,
|
package/schemas/Chunk.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { VectorSchema } from './Vector';
|
|
|
5
5
|
export type ChunkSchema = {
|
|
6
6
|
c: VectorSchema; // chunk origin coordinate [ 16n, 16n, 16n ]
|
|
7
7
|
b?: Uint8Array | number[]; // block ids in chunk, 16^3 entries, registry block ids 1-255, 0 = none
|
|
8
|
+
r?: number[]; // block rotations, sparse array of block ids index -> rotation enum (0-23)
|
|
8
9
|
rm?: boolean; // removed/remove
|
|
9
10
|
};
|
|
10
11
|
|
|
@@ -23,6 +24,17 @@ export const chunkSchema: JSONSchemaType<ChunkSchema> = {
|
|
|
23
24
|
maxItems: 4096,
|
|
24
25
|
nullable: true,
|
|
25
26
|
},
|
|
27
|
+
r: {
|
|
28
|
+
type: 'array',
|
|
29
|
+
items: {
|
|
30
|
+
type: 'number',
|
|
31
|
+
minimum: 0,
|
|
32
|
+
maximum: 23
|
|
33
|
+
},
|
|
34
|
+
minItems: 0,
|
|
35
|
+
maxItems: 8192, // 4096 blocks per chunk, multiples of 2 for index,blockId
|
|
36
|
+
nullable: true,
|
|
37
|
+
},
|
|
26
38
|
rm: { type: 'boolean', nullable: true },
|
|
27
39
|
},
|
|
28
40
|
required: [ 'c' ],
|