hytopia 0.6.33 → 0.7.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.
Files changed (53) hide show
  1. package/bin/scripts.mjs +2 -0
  2. package/bun-server.mjs +167 -167
  3. package/docs/server.blocktype.collideroptions.md +1 -1
  4. package/docs/server.blocktype.halfextents.md +13 -0
  5. package/docs/server.blocktype.md +43 -1
  6. package/docs/server.blocktype.size.md +13 -0
  7. package/docs/server.blocktypeoptions.customcollideroptions.md +1 -1
  8. package/docs/server.blocktypeoptions.halfextents.md +13 -0
  9. package/docs/server.blocktypeoptions.md +20 -1
  10. package/docs/server.chunk._constructor_.md +35 -1
  11. package/docs/server.chunk.md +4 -147
  12. package/docs/server.chunk.origincoordinate.md +1 -1
  13. package/docs/server.chunklattice.clear.md +1 -1
  14. package/docs/server.chunklattice.getblocktypecount.md +55 -0
  15. package/docs/server.chunklattice.getchunk.md +5 -5
  16. package/docs/server.chunklattice.getorcreatechunk.md +55 -0
  17. package/docs/server.chunklattice.haschunk.md +4 -4
  18. package/docs/server.chunklattice.md +36 -7
  19. package/docs/server.chunklattice.setblock.md +1 -1
  20. package/docs/server.chunklatticeevent.md +61 -0
  21. package/docs/server.chunklatticeeventpayloads._chunk_lattice.remove_chunk_.md +16 -0
  22. package/docs/server.chunklatticeeventpayloads._chunk_lattice.set_block_.md +19 -0
  23. package/docs/server.chunklatticeeventpayloads.md +76 -0
  24. package/docs/server.collider.md +16 -0
  25. package/docs/server.collider.scale.md +4 -0
  26. package/docs/server.collider.setvoxel.md +69 -0
  27. package/docs/server.collideroptions.md +2 -2
  28. package/docs/server.collidershape.md +14 -0
  29. package/docs/server.eventpayloads.md +2 -2
  30. package/docs/server.md +17 -4
  31. package/docs/server.particleemitteroptions.md +2 -0
  32. package/docs/server.voxelscollideroptions.coordinates.md +13 -0
  33. package/docs/server.voxelscollideroptions.md +94 -0
  34. package/docs/server.voxelscollideroptions.shape.md +11 -0
  35. package/docs/server.voxelscollideroptions.size.md +13 -0
  36. package/docs/server.world.md +1 -1
  37. package/docs/server.world.setdirectionallightposition.md +2 -2
  38. package/node-server.mjs +167 -167
  39. package/package.json +1 -1
  40. package/server.api.json +827 -764
  41. package/server.d.ts +100 -113
  42. package/docs/server.chunk.despawn.md +0 -17
  43. package/docs/server.chunk.issimulated.md +0 -13
  44. package/docs/server.chunk.isspawned.md +0 -13
  45. package/docs/server.chunk.isvalidorigincoordinate.md +0 -55
  46. package/docs/server.chunk.setblock.md +0 -69
  47. package/docs/server.chunk.spawn.md +0 -69
  48. package/docs/server.chunk.world.md +0 -13
  49. package/docs/server.chunkevent.md +0 -75
  50. package/docs/server.chunkeventpayloads._chunk.despawn_.md +0 -15
  51. package/docs/server.chunkeventpayloads._chunk.set_block_.md +0 -18
  52. package/docs/server.chunkeventpayloads._chunk.spawn_.md +0 -15
  53. package/docs/server.chunkeventpayloads.md +0 -95
package/server.d.ts CHANGED
@@ -602,6 +602,7 @@ export declare class BlockType extends EventRouter implements protocol.Serializa
602
602
 
603
603
 
604
604
 
605
+
605
606
  /**
606
607
  * Creates a new block type instance.
607
608
  * @param world - The world the block type is for.
@@ -611,13 +612,17 @@ export declare class BlockType extends EventRouter implements protocol.Serializa
611
612
  /** The unique identifier for the block type. */
612
613
  get id(): number;
613
614
  /** The collider options for the block type. */
614
- get colliderOptions(): TrimeshColliderOptions;
615
+ get colliderOptions(): VoxelsColliderOptions;
616
+ /** The half extents size of the block type. */
617
+ get halfExtents(): Vector3Like;
615
618
  /** Whether the block type is a liquid. */
616
619
  get isLiquid(): boolean;
617
620
  /** Whether the block type is meshable. */
618
621
  get isMeshable(): boolean;
619
622
  /** The name of the block type. */
620
623
  get name(): string;
624
+ /** The size of the block type. */
625
+ get size(): Vector3Like;
621
626
  /** The URI of the texture for the block type. */
622
627
  get textureUri(): string;
623
628
 
@@ -653,7 +658,9 @@ export declare interface BlockTypeOptions {
653
658
  /** The unique numeric identifier for the block type. */
654
659
  id: number;
655
660
  /** The custom collider options for the block type. */
656
- customColliderOptions?: TrimeshColliderOptions;
661
+ customColliderOptions?: VoxelsColliderOptions;
662
+ /** The half extents size of the block type. */
663
+ halfExtents?: Vector3Like;
657
664
  /** Whether the block type is a liquid. */
658
665
  isLiquid?: boolean;
659
666
  /** The name of the block type. */
@@ -845,58 +852,24 @@ export declare class ChatManager extends EventRouter {
845
852
  * @remarks
846
853
  * Chunks make up the bulk of the terrain in a world. Chunks are
847
854
  * fixed size, each containing 16^3 possible blocks as
848
- * a 16x16x16 cube. Chunks can be spawned, despawned, have their
849
- * unique blocks set or removed, and more. Chunks represent their
850
- * internal block coordinates in local space, meaning only coordinates
851
- * x: 0...15, y: 0...15, z: 0...15 are valid.
852
- *
853
- * The Chunk follows a spawn and despawn lifecycle pattern.
854
- * When you create a chunk, when you're ready to load it in your
855
- * world you use .spawn(). To remove it, you use .despawn().
856
- *
857
- * Use .setBlock() to set the block type id at a specific local cooridnate.
858
- * Block type ids are ones that have been registered in the {@link BlockTypeRegistry}
859
- * associated with the {@link World} the chunk belongs to. A block type id of 0
860
- * is used to represent no block. Removing a block is done by .setBlock(localCoordinate, 0).
861
- *
862
- * <h2>Events</h2>
863
- *
864
- * This class is an EventRouter, and instances of it emit
865
- * events with payloads listed under {@link ChunkEventPayloads}
866
- *
867
- * @example
868
- * ```typescript
869
- * // Assume we previously registered a stone block with type id of 10..
870
- *
871
- * const chunk = new Chunk();
872
- *
873
- * chunk.setBlock({ x: 0, y: 0, z: 0 }, 10); // Set the block at 0, 0, 0 to stone
874
- * chunk.spawn(world, { x: 16, y: 0, z: 16 }); // Spawn the chunk at global coordinate 16, 0, 16
875
- * ```
855
+ * a 16x16x16 cube. Chunks are primarily a data structure used by
856
+ * {@link ChunkLattice} to represent a world's terrain.
857
+ * Chunks store their internal block coordinates in local
858
+ * space, meaning local coordinates x: 0...15, y: 0...15, z: 0...15.
876
859
  *
877
860
  * @public
878
861
  */
879
- export declare class Chunk extends EventRouter implements protocol.Serializable {
880
-
881
-
882
-
862
+ export declare class Chunk implements protocol.Serializable {
883
863
 
884
864
 
885
865
  /**
886
866
  * Creates a new chunk instance.
887
867
  */
888
- constructor();
868
+ constructor(originCoordinate: Vector3Like);
889
869
  /** The blocks in the chunk as a flat Uint8Array[4096], each index as 0 or a block type id. */
890
870
  get blocks(): Readonly<Uint8Array>;
891
-
892
- /** Whether the chunk is actively simulated in the internal physics engine. */
893
- get isSimulated(): boolean;
894
- /** Whether the chunk has been spawned. */
895
- get isSpawned(): boolean;
896
871
  /** The origin coordinate of the chunk. */
897
- get originCoordinate(): Vector3Like | undefined;
898
- /** The world the chunk belongs to. */
899
- get world(): World | undefined;
872
+ get originCoordinate(): Vector3Like;
900
873
  /**
901
874
  * Convert a block index to a local coordinate.
902
875
  * @param index - The index of the block to convert.
@@ -915,22 +888,6 @@ export declare class Chunk extends EventRouter implements protocol.Serializable
915
888
  * @returns The origin coordinate.
916
889
  */
917
890
  static globalCoordinateToOriginCoordinate(globalCoordinate: Vector3Like): Vector3Like;
918
- /**
919
- * Check if an origin coordinate is valid.
920
- * @param coordinate - The coordinate to check.
921
- * @returns Whether the coordinate is valid.
922
- */
923
- static isValidOriginCoordinate(coordinate: Vector3Like): boolean;
924
- /**
925
- * Spawn the chunk in the world.
926
- * @param world - The world to spawn the chunk in.
927
- * @param originCoordinate - The origin coordinate of the chunk.
928
- */
929
- spawn(world: World, originCoordinate: Vector3Like): void;
930
- /**
931
- * Despawn the chunk from the world.
932
- */
933
- despawn(): void;
934
891
  /**
935
892
  * Get the block type id at a specific local coordinate.
936
893
  * @param localCoordinate - The local coordinate of the block to get.
@@ -943,46 +900,10 @@ export declare class Chunk extends EventRouter implements protocol.Serializable
943
900
  * @returns Whether a block exists.
944
901
  */
945
902
  hasBlock(localCoordinate: Vector3Like): boolean;
946
- /**
947
- * Set the block at a specific local coordinate by block type id.
948
- * @param localCoordinate - The local coordinate of the block to set.
949
- * @param blockTypeId - The block type id to set.
950
- */
951
- setBlock(localCoordinate: Vector3Like, blockTypeId: number): void;
952
-
953
-
954
-
955
- private _meshColliders;
956
903
 
957
904
 
958
905
 
959
906
 
960
- }
961
-
962
- /** Event types a Chunk instance can emit. See {@link ChunkEventPayloads} for the payloads. @public */
963
- export declare enum ChunkEvent {
964
- DESPAWN = "CHUNK.DESPAWN",
965
- SET_BLOCK = "CHUNK.SET_BLOCK",
966
- SPAWN = "CHUNK.SPAWN"
967
- }
968
-
969
- /** Event payloads for Chunk emitted events. @public */
970
- export declare interface ChunkEventPayloads {
971
- /** Emitted when a chunk is despawned. */
972
- [ChunkEvent.DESPAWN]: {
973
- chunk: Chunk;
974
- };
975
- /** Emitted when a block is set in a chunk. */
976
- [ChunkEvent.SET_BLOCK]: {
977
- chunk: Chunk;
978
- globalCoordinate: Vector3Like;
979
- localCoordinate: Vector3Like;
980
- blockTypeId: number;
981
- };
982
- /** Emitted when a chunk is spawned. */
983
- [ChunkEvent.SPAWN]: {
984
- chunk: Chunk;
985
- };
986
907
  }
987
908
 
988
909
  /**
@@ -994,7 +915,10 @@ export declare interface ChunkEventPayloads {
994
915
  *
995
916
  * @public
996
917
  */
997
- export declare class ChunkLattice {
918
+ export declare class ChunkLattice extends EventRouter {
919
+
920
+
921
+
998
922
 
999
923
 
1000
924
  /**
@@ -1004,10 +928,8 @@ export declare class ChunkLattice {
1004
928
  constructor(world: World);
1005
929
  /** The number of chunks in the lattice. */
1006
930
  get chunkCount(): number;
1007
-
1008
-
1009
931
  /**
1010
- * Despawns and clears all chunks in the lattice.
932
+ * Removes and clears all chunks and their blocks from the lattice.
1011
933
  */
1012
934
  clear(): void;
1013
935
  /**
@@ -1016,6 +938,7 @@ export declare class ChunkLattice {
1016
938
  * @returns The block type id, 0 if no block is set.
1017
939
  */
1018
940
  getBlockId(globalCoordinate: Vector3Like): number;
941
+
1019
942
  /**
1020
943
  * Get the block type at a specific global coordinate.
1021
944
  * @param globalCoordinate - The global coordinate of the block to get.
@@ -1023,11 +946,24 @@ export declare class ChunkLattice {
1023
946
  */
1024
947
  getBlockType(globalCoordinate: Vector3Like): BlockType | null;
1025
948
  /**
1026
- * Get a chunk by its origin coordinate.
1027
- * @param originCoordinate - The origin coordinate of the chunk to get.
1028
- * @returns The chunk at the given origin coordinate or undefined if not found.
949
+ * Get the number of blocks of a specific block type in the lattice.
950
+ * @param blockTypeId - The block type id to get the count of.
951
+ * @returns The number of blocks of the block type.
952
+ */
953
+ getBlockTypeCount(blockTypeId: number): number;
954
+ /**
955
+ * Get the chunk that contains the given global coordinate.
956
+ * @param globalCoordinate - The global coordinate to get the chunk for.
957
+ * @returns The chunk that contains the given global coordinate or undefined if not found.
958
+ */
959
+ getChunk(globalCoordinate: Vector3Like): Chunk | undefined;
960
+
961
+ /**
962
+ * Get the chunk for a given global coordinate.
963
+ * @param globalCoordinate - The global coordinate of the chunk to get.
964
+ * @returns The chunk at the given global coordinate or undefined if not found.
1029
965
  */
1030
- getChunk(originCoordinate: Vector3Like): Chunk | undefined;
966
+ getOrCreateChunk(globalCoordinate: Vector3Like): Chunk;
1031
967
  /**
1032
968
  * Get all chunks in the lattice.
1033
969
  * @returns An array of all chunks in the lattice.
@@ -1040,20 +976,44 @@ export declare class ChunkLattice {
1040
976
  */
1041
977
  hasBlock(globalCoordinate: Vector3Like): boolean;
1042
978
  /**
1043
- * Check if a chunk exists by its origin coordinate.
1044
- * @param originCoordinate - The origin coordinate of the chunk to check.
979
+ * Check if a chunk exists for a given global coordinate.
980
+ * @param globalCoordinate - The global coordinate of the chunk to check.
1045
981
  * @returns Whether the chunk exists.
1046
982
  */
1047
- hasChunk(originCoordinate: Vector3Like): boolean;
983
+ hasChunk(globalCoordinate: Vector3Like): boolean;
1048
984
  /**
1049
985
  * Set the block at a global coordinate by block type id, automatically
1050
- * creating a chunk if it doesn't exist. Use block type id 0 for air.
986
+ * creating a chunk if it doesn't exist. Use block type id 0 for air (to remove a block).
1051
987
  * @param globalCoordinate - The global coordinate of the block to set.
1052
988
  * @param blockTypeId - The block type id to set. Use 0 to remove the block and replace with air.
1053
989
  */
1054
990
  setBlock(globalCoordinate: Vector3Like, blockTypeId: number): void;
1055
991
 
1056
992
 
993
+
994
+ }
995
+
996
+ /** Event types a ChunkLattice instance can emit. See {@link ChunkLatticeEventPayloads} for the payloads. @public */
997
+ export declare enum ChunkLatticeEvent {
998
+ REMOVE_CHUNK = "CHUNK_LATTICE.REMOVE_CHUNK",
999
+ SET_BLOCK = "CHUNK_LATTICE.SET_BLOCK"
1000
+ }
1001
+
1002
+ /** Event payloads for ChunkLattice emitted events. @public */
1003
+ export declare interface ChunkLatticeEventPayloads {
1004
+ /** Emitted when a chunk is removed from the lattice. */
1005
+ [ChunkLatticeEvent.REMOVE_CHUNK]: {
1006
+ chunkLattice: ChunkLattice;
1007
+ chunk: Chunk;
1008
+ };
1009
+ /** Emitted when a block is set in the lattice. */
1010
+ [ChunkLatticeEvent.SET_BLOCK]: {
1011
+ chunkLattice: ChunkLattice;
1012
+ chunk: Chunk;
1013
+ globalCoordinate: Vector3Like;
1014
+ localCoordinate: Vector3Like;
1015
+ blockTypeId: number;
1016
+ };
1057
1017
  }
1058
1018
 
1059
1019
  /** The coefficient for friction or bounciness combine rule. @public */
@@ -1207,13 +1167,19 @@ export declare class Collider extends EventRouter {
1207
1167
  * @param tag - The tag of the collider.
1208
1168
  */
1209
1169
  setTag(tag: string): void;
1170
+ /**
1171
+ * Sets the voxel at the given coordinate as filled or not filled.
1172
+ * @param coordinate - The coordinate of the voxel to set.
1173
+ * @param filled - True if the voxel at the coordinate should be filled, false if it should be removed.
1174
+ */
1175
+ setVoxel(coordinate: Vector3Like, filled: boolean): void;
1210
1176
  /**
1211
1177
  * Adds the collider to the simulation.
1212
1178
  * @param simulation - The simulation to add the collider to.
1213
1179
  * @param parentRigidBody - The parent rigid body of the collider.
1214
1180
  */
1215
1181
  addToSimulation(simulation: Simulation, parentRigidBody?: RigidBody): void;
1216
- scale(scalar: number): void;
1182
+
1217
1183
  /**
1218
1184
  * Enables or disables collision events for the collider.
1219
1185
  * This is automatically enabled if an on collision callback is set.
@@ -1226,10 +1192,18 @@ export declare class Collider extends EventRouter {
1226
1192
  * @param enabled - Whether contact force events are enabled.
1227
1193
  */
1228
1194
  enableContactForceEvents(enabled: boolean): void;
1195
+
1229
1196
  /**
1230
1197
  * Removes the collider from the simulation.
1231
1198
  */
1232
1199
  removeFromSimulation(): void;
1200
+ /**
1201
+ * Scales the collider by the given scalar. Only
1202
+ * ball, block, capsule, cone, cylinder, round cylinder
1203
+ * are supported.
1204
+ * @param scalar - The scalar to scale the collider by.
1205
+ */
1206
+ scale(scalar: number): void;
1233
1207
 
1234
1208
 
1235
1209
  private _buildWedgeConvexHullVertices;
@@ -1238,10 +1212,11 @@ export declare class Collider extends EventRouter {
1238
1212
 
1239
1213
 
1240
1214
 
1215
+
1241
1216
  }
1242
1217
 
1243
1218
  /** The options for a collider. @public */
1244
- export declare type ColliderOptions = BallColliderOptions | BlockColliderOptions | CapsuleColliderOptions | ConeColliderOptions | CylinderColliderOptions | RoundCylinderColliderOptions | TrimeshColliderOptions | WedgeColliderOptions | NoneColliderOptions;
1219
+ export declare type ColliderOptions = BallColliderOptions | BlockColliderOptions | CapsuleColliderOptions | ConeColliderOptions | CylinderColliderOptions | RoundCylinderColliderOptions | TrimeshColliderOptions | VoxelsColliderOptions | WedgeColliderOptions | NoneColliderOptions;
1245
1220
 
1246
1221
  /** The shapes a collider can be. @public */
1247
1222
  export declare enum ColliderShape {
@@ -1253,6 +1228,7 @@ export declare enum ColliderShape {
1253
1228
  CYLINDER = "cylinder",
1254
1229
  ROUND_CYLINDER = "round-cylinder",
1255
1230
  TRIMESH = "trimesh",
1231
+ VOXELS = "voxels",
1256
1232
  WEDGE = "wedge"
1257
1233
  }
1258
1234
 
@@ -2212,7 +2188,7 @@ export declare class ErrorHandler {
2212
2188
  *
2213
2189
  * @public
2214
2190
  */
2215
- export declare interface EventPayloads extends AudioEventPayloads, BaseEntityControllerEventPayloads, BlockTypeEventPayloads, BlockTypeRegistryEventPayloads, ChatEventPayloads, ChunkEventPayloads, ConnectionEventPayloads, EntityEventPayloads, GameServerEventPayloads, ParticleEmitterEventPayloads, PlayerCameraEventPayloads, PlayerEventPayloads, PlayerManagerEventPayloads, PlayerUIEventPayloads, SceneUIEventPayloads, SimulationEventPayloads, SocketEventPayloads, LightEventPayloads, WebServerEventPayloads, WorldEventPayloads, WorldLoopEventPayloads, WorldManagerEventPayloads {
2191
+ export declare interface EventPayloads extends AudioEventPayloads, BaseEntityControllerEventPayloads, BlockTypeEventPayloads, BlockTypeRegistryEventPayloads, ChatEventPayloads, ChunkLatticeEventPayloads, ConnectionEventPayloads, EntityEventPayloads, GameServerEventPayloads, ParticleEmitterEventPayloads, PlayerCameraEventPayloads, PlayerEventPayloads, PlayerManagerEventPayloads, PlayerUIEventPayloads, SceneUIEventPayloads, SimulationEventPayloads, SocketEventPayloads, LightEventPayloads, WebServerEventPayloads, WorldEventPayloads, WorldLoopEventPayloads, WorldManagerEventPayloads {
2216
2192
  }
2217
2193
 
2218
2194
  /**
@@ -3887,7 +3863,7 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3887
3863
 
3888
3864
  }
3889
3865
 
3890
- /** Event types a ParticleEmitter instance can emit. See {@link ParticleEmitterEventPayloads} */
3866
+ /** Event types a ParticleEmitter instance can emit. See {@link ParticleEmitterEventPayloads} @public */
3891
3867
  export declare enum ParticleEmitterEvent {
3892
3868
  DESPAWN = "PARTICLE_EMITTER.DESPAWN",
3893
3869
  SET_ALPHA_TEST = "PARTICLE_EMITTER.SET_ALPHA_TEST",
@@ -4097,6 +4073,7 @@ export declare class ParticleEmitterManager {
4097
4073
 
4098
4074
  }
4099
4075
 
4076
+ /** Options for creating a ParticleEmitter instance. @public */
4100
4077
  export declare interface ParticleEmitterOptions {
4101
4078
  /** The URI or path to the texture to be used for the particles. */
4102
4079
  textureUri: string;
@@ -6578,6 +6555,15 @@ export declare interface Vector3Like {
6578
6555
  z: number;
6579
6556
  }
6580
6557
 
6558
+ /** The options for a voxels collider. @public */
6559
+ export declare interface VoxelsColliderOptions extends BaseColliderOptions {
6560
+ shape: ColliderShape.VOXELS;
6561
+ /** The coordinate of each voxel in the collider. */
6562
+ coordinates?: Vector3Like[];
6563
+ /** The size of each voxel in the collider. */
6564
+ size?: Vector3Like;
6565
+ }
6566
+
6581
6567
  /**
6582
6568
  * A callback function called when the entity associated with the
6583
6569
  * PathfindingEntityController finishes moving to a calculate waypoint
@@ -6737,8 +6723,9 @@ export declare class World extends EventRouter implements protocol.Serializable
6737
6723
  */
6738
6724
  setDirectionalLightIntensity(intensity: number): void;
6739
6725
  /**
6740
- * Sets the position the world's directional light originates from.
6741
- * @param position - The position in the world.
6726
+ * Sets the position the world's directional light originates
6727
+ * from relative to a player's camera position.
6728
+ * @param position - The position the directional light originates from relative to the player's camera position.
6742
6729
  */
6743
6730
  setDirectionalLightPosition(position: Vector3Like): void;
6744
6731
  /**
@@ -1,17 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [Chunk](./server.chunk.md) &gt; [despawn](./server.chunk.despawn.md)
4
-
5
- ## Chunk.despawn() method
6
-
7
- Despawn the chunk from the world.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- despawn(): void;
13
- ```
14
- **Returns:**
15
-
16
- void
17
-
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [Chunk](./server.chunk.md) &gt; [isSimulated](./server.chunk.issimulated.md)
4
-
5
- ## Chunk.isSimulated property
6
-
7
- Whether the chunk is actively simulated in the internal physics engine.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- get isSimulated(): boolean;
13
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [Chunk](./server.chunk.md) &gt; [isSpawned](./server.chunk.isspawned.md)
4
-
5
- ## Chunk.isSpawned property
6
-
7
- Whether the chunk has been spawned.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- get isSpawned(): boolean;
13
- ```
@@ -1,55 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [Chunk](./server.chunk.md) &gt; [isValidOriginCoordinate](./server.chunk.isvalidorigincoordinate.md)
4
-
5
- ## Chunk.isValidOriginCoordinate() method
6
-
7
- Check if an origin coordinate is valid.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- static isValidOriginCoordinate(coordinate: Vector3Like): 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
- coordinate
36
-
37
-
38
- </td><td>
39
-
40
- [Vector3Like](./server.vector3like.md)
41
-
42
-
43
- </td><td>
44
-
45
- The coordinate to check.
46
-
47
-
48
- </td></tr>
49
- </tbody></table>
50
- **Returns:**
51
-
52
- boolean
53
-
54
- Whether the coordinate is valid.
55
-
@@ -1,69 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [Chunk](./server.chunk.md) &gt; [setBlock](./server.chunk.setblock.md)
4
-
5
- ## Chunk.setBlock() method
6
-
7
- Set the block at a specific local coordinate by block type id.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- setBlock(localCoordinate: Vector3Like, blockTypeId: 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
- localCoordinate
36
-
37
-
38
- </td><td>
39
-
40
- [Vector3Like](./server.vector3like.md)
41
-
42
-
43
- </td><td>
44
-
45
- The local coordinate of the block to set.
46
-
47
-
48
- </td></tr>
49
- <tr><td>
50
-
51
- blockTypeId
52
-
53
-
54
- </td><td>
55
-
56
- number
57
-
58
-
59
- </td><td>
60
-
61
- The block type id to set.
62
-
63
-
64
- </td></tr>
65
- </tbody></table>
66
- **Returns:**
67
-
68
- void
69
-
@@ -1,69 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [Chunk](./server.chunk.md) &gt; [spawn](./server.chunk.spawn.md)
4
-
5
- ## Chunk.spawn() method
6
-
7
- Spawn the chunk in the world.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- spawn(world: World, originCoordinate: Vector3Like): 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
- world
36
-
37
-
38
- </td><td>
39
-
40
- [World](./server.world.md)
41
-
42
-
43
- </td><td>
44
-
45
- The world to spawn the chunk in.
46
-
47
-
48
- </td></tr>
49
- <tr><td>
50
-
51
- originCoordinate
52
-
53
-
54
- </td><td>
55
-
56
- [Vector3Like](./server.vector3like.md)
57
-
58
-
59
- </td><td>
60
-
61
- The origin coordinate of the chunk.
62
-
63
-
64
- </td></tr>
65
- </tbody></table>
66
- **Returns:**
67
-
68
- void
69
-
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [Chunk](./server.chunk.md) &gt; [world](./server.chunk.world.md)
4
-
5
- ## Chunk.world property
6
-
7
- The world the chunk belongs to.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- get world(): World | undefined;
13
- ```