hytopia 0.6.34 → 0.7.2

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 (81) hide show
  1. package/bun-server.mjs +169 -169
  2. package/docs/server.blocktype.collideroptions.md +1 -1
  3. package/docs/server.blocktype.halfextents.md +13 -0
  4. package/docs/server.blocktype.md +43 -1
  5. package/docs/server.blocktype.size.md +13 -0
  6. package/docs/server.blocktypeoptions.customcollideroptions.md +1 -1
  7. package/docs/server.blocktypeoptions.halfextents.md +13 -0
  8. package/docs/server.blocktypeoptions.md +20 -1
  9. package/docs/server.chunk._constructor_.md +35 -1
  10. package/docs/server.chunk.md +4 -147
  11. package/docs/server.chunk.origincoordinate.md +1 -1
  12. package/docs/server.chunklattice.clear.md +1 -1
  13. package/docs/server.chunklattice.getblocktypecount.md +55 -0
  14. package/docs/server.chunklattice.getchunk.md +5 -5
  15. package/docs/server.chunklattice.getorcreatechunk.md +55 -0
  16. package/docs/server.chunklattice.haschunk.md +4 -4
  17. package/docs/server.chunklattice.md +36 -7
  18. package/docs/server.chunklattice.setblock.md +1 -1
  19. package/docs/server.chunklatticeevent.md +61 -0
  20. package/docs/server.chunklatticeeventpayloads._chunk_lattice.remove_chunk_.md +16 -0
  21. package/docs/server.chunklatticeeventpayloads._chunk_lattice.set_block_.md +19 -0
  22. package/docs/server.chunklatticeeventpayloads.md +76 -0
  23. package/docs/server.collider.md +16 -0
  24. package/docs/server.collider.scale.md +4 -0
  25. package/docs/server.collider.setvoxel.md +69 -0
  26. package/docs/server.collideroptions.md +2 -2
  27. package/docs/server.collidershape.md +14 -0
  28. package/docs/server.eventpayloads.md +2 -2
  29. package/docs/server.md +17 -4
  30. package/docs/server.particleemitter.md +120 -29
  31. package/docs/server.particleemitter.paused.md +13 -0
  32. package/docs/server.particleemitter.restart.md +1 -1
  33. package/docs/{server.particleemitter.setsize.md → server.particleemitter.setsizeend.md} +6 -6
  34. package/docs/server.particleemitter.setsizeendvariance.md +53 -0
  35. package/docs/{server.particleemitter.setsizevariance.md → server.particleemitter.setsizestart.md} +6 -6
  36. package/docs/server.particleemitter.setsizestartvariance.md +53 -0
  37. package/docs/server.particleemitter.sizeend.md +13 -0
  38. package/docs/server.particleemitter.sizeendvariance.md +13 -0
  39. package/docs/server.particleemitter.sizestart.md +13 -0
  40. package/docs/server.particleemitter.sizestartvariance.md +13 -0
  41. package/docs/server.particleemitter.stop.md +1 -1
  42. package/docs/server.particleemitterevent.md +46 -4
  43. package/docs/server.particleemittereventpayloads._particle_emitter.set_paused_.md +16 -0
  44. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_end_.md +16 -0
  45. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_end_variance_.md +16 -0
  46. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_start_.md +16 -0
  47. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_start_variance_.md +16 -0
  48. package/docs/server.particleemittereventpayloads.md +63 -6
  49. package/docs/server.particleemitteroptions.md +44 -4
  50. package/docs/server.particleemitteroptions.sizeend.md +13 -0
  51. package/docs/server.particleemitteroptions.sizeendvariance.md +13 -0
  52. package/docs/server.particleemitteroptions.sizestart.md +13 -0
  53. package/docs/server.particleemitteroptions.sizestartvariance.md +13 -0
  54. package/docs/server.voxelscollideroptions.coordinates.md +13 -0
  55. package/docs/server.voxelscollideroptions.md +94 -0
  56. package/docs/server.voxelscollideroptions.shape.md +11 -0
  57. package/docs/server.voxelscollideroptions.size.md +13 -0
  58. package/docs/server.world.md +1 -1
  59. package/docs/server.world.setdirectionallightposition.md +2 -2
  60. package/node-server.mjs +165 -165
  61. package/package.json +1 -1
  62. package/server.api.json +1368 -867
  63. package/server.d.ts +166 -138
  64. package/docs/server.chunk.despawn.md +0 -17
  65. package/docs/server.chunk.issimulated.md +0 -13
  66. package/docs/server.chunk.isspawned.md +0 -13
  67. package/docs/server.chunk.isvalidorigincoordinate.md +0 -55
  68. package/docs/server.chunk.setblock.md +0 -69
  69. package/docs/server.chunk.spawn.md +0 -69
  70. package/docs/server.chunk.world.md +0 -13
  71. package/docs/server.chunkevent.md +0 -75
  72. package/docs/server.chunkeventpayloads._chunk.despawn_.md +0 -15
  73. package/docs/server.chunkeventpayloads._chunk.set_block_.md +0 -18
  74. package/docs/server.chunkeventpayloads._chunk.spawn_.md +0 -15
  75. package/docs/server.chunkeventpayloads.md +0 -95
  76. package/docs/server.particleemitter.isstopped.md +0 -13
  77. package/docs/server.particleemitter.size.md +0 -13
  78. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_.md +0 -16
  79. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_variance_.md +0 -16
  80. package/docs/server.particleemitteroptions.size.md +0 -13
  81. package/docs/server.particleemitteroptions.sizevariance.md +0 -13
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
903
 
954
904
 
955
- private _meshColliders;
956
905
 
957
906
 
958
-
959
-
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
  /**
@@ -3643,6 +3619,9 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3643
3619
 
3644
3620
 
3645
3621
 
3622
+
3623
+
3624
+
3646
3625
 
3647
3626
 
3648
3627
 
@@ -3668,8 +3647,6 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3668
3647
  get gravity(): Vector3Like | undefined;
3669
3648
  /** Whether the ParticleEmitter is spawned in the world. */
3670
3649
  get isSpawned(): boolean;
3671
- /** Whether the ParticleEmitter is stopped. */
3672
- get isStopped(): boolean;
3673
3650
  /** The lifetime of an emitted particle in seconds. */
3674
3651
  get lifetime(): number | undefined;
3675
3652
  /** The lifetime variance of an emitted particle in seconds. */
@@ -3686,6 +3663,8 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3686
3663
  get opacityStart(): number | undefined;
3687
3664
  /** The opacity variance of an emitted particle at the start of its lifetime. */
3688
3665
  get opacityStartVariance(): number | undefined;
3666
+ /** Whether an emitted particle is being paused. */
3667
+ get paused(): boolean | undefined;
3689
3668
  /** The position of the particle emitter in the world if explicitly set. */
3690
3669
  get position(): Vector3Like | undefined;
3691
3670
  /** The position variance of an emitted particle. */
@@ -3694,8 +3673,14 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3694
3673
  get rate(): number | undefined;
3695
3674
  /** The rate per second variance of the particle emission rate. */
3696
3675
  get rateVariance(): number | undefined;
3697
- /** The size of an emitted particle. */
3698
- get size(): number | undefined;
3676
+ /** The size at the end of an emitted particle's lifetime. */
3677
+ get sizeEnd(): number | undefined;
3678
+ /** The size variance at the end of an emitted particle's lifetime. */
3679
+ get sizeEndVariance(): number | undefined;
3680
+ /** The size at the start of an emitted particle's lifetime. */
3681
+ get sizeStart(): number | undefined;
3682
+ /** The size variance at the start of an emitted particle's lifetime. */
3683
+ get sizeStartVariance(): number | undefined;
3699
3684
  /** The size variance of an emitted particle. */
3700
3685
  get sizeVariance(): number | undefined;
3701
3686
  /** The URI or path to the texture to be used for the particles. */
@@ -3829,17 +3814,29 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3829
3814
  */
3830
3815
  setRateVariance(rateVariance: number): void;
3831
3816
  /**
3832
- * Sets the size of an emitted particle.
3817
+ * Sets the size at the end of an emitted particle's lifetime.
3818
+ *
3819
+ * @param sizeEnd - The size at the end of an emitted particle's lifetime.
3820
+ */
3821
+ setSizeEnd(sizeEnd: number): void;
3822
+ /**
3823
+ * Sets the size variance at the end of an emitted particle's lifetime.
3824
+ *
3825
+ * @param sizeEndVariance - The size variance at the end of an emitted particle's lifetime.
3826
+ */
3827
+ setSizeEndVariance(sizeEndVariance: number): void;
3828
+ /**
3829
+ * Sets the size at the start of an emitted particle's lifetime.
3833
3830
  *
3834
- * @param size - The size of an emitted particle.
3831
+ * @param sizeStart - The size at the start of an emitted particle's lifetime.
3835
3832
  */
3836
- setSize(size: number): void;
3833
+ setSizeStart(sizeStart: number): void;
3837
3834
  /**
3838
- * Sets the size variance of an emitted particle.
3835
+ * Sets the size variance at the start of an emitted particle's lifetime.
3839
3836
  *
3840
- * @param sizeVariance - The size variance of an emitted particle.
3837
+ * @param sizeStartVariance - The size variance at the start of an emitted particle's lifetime.
3841
3838
  */
3842
- setSizeVariance(sizeVariance: number): void;
3839
+ setSizeStartVariance(sizeStartVariance: number): void;
3843
3840
  /**
3844
3841
  * Sets the texture URI of the particles emitted.
3845
3842
  *
@@ -3870,12 +3867,10 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3870
3867
  despawn(): void;
3871
3868
  /**
3872
3869
  * Restarts the particle emission if it was previously stopped.
3873
- * Internally, this sets the rate to the value it was before being stopped.
3874
3870
  */
3875
3871
  restart(): void;
3876
3872
  /**
3877
- * Stops the particle emission if it was previously started.
3878
- * Internally, this sets the rate to 0.
3873
+ * Stops the particle emission.
3879
3874
  */
3880
3875
  stop(): void;
3881
3876
  /**
@@ -3887,7 +3882,7 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3887
3882
 
3888
3883
  }
3889
3884
 
3890
- /** Event types a ParticleEmitter instance can emit. See {@link ParticleEmitterEventPayloads} */
3885
+ /** Event types a ParticleEmitter instance can emit. See {@link ParticleEmitterEventPayloads} @public */
3891
3886
  export declare enum ParticleEmitterEvent {
3892
3887
  DESPAWN = "PARTICLE_EMITTER.DESPAWN",
3893
3888
  SET_ALPHA_TEST = "PARTICLE_EMITTER.SET_ALPHA_TEST",
@@ -3906,12 +3901,15 @@ export declare enum ParticleEmitterEvent {
3906
3901
  SET_OPACITY_END_VARIANCE = "PARTICLE_EMITTER.SET_OPACITY_END_VARIANCE",
3907
3902
  SET_OPACITY_START = "PARTICLE_EMITTER.SET_OPACITY_START",
3908
3903
  SET_OPACITY_START_VARIANCE = "PARTICLE_EMITTER.SET_OPACITY_START_VARIANCE",
3904
+ SET_PAUSED = "PARTICLE_EMITTER.SET_PAUSED",
3909
3905
  SET_POSITION = "PARTICLE_EMITTER.SET_POSITION",
3910
3906
  SET_POSITION_VARIANCE = "PARTICLE_EMITTER.SET_POSITION_VARIANCE",
3911
3907
  SET_RATE = "PARTICLE_EMITTER.SET_RATE",
3912
3908
  SET_RATE_VARIANCE = "PARTICLE_EMITTER.SET_RATE_VARIANCE",
3913
- SET_SIZE = "PARTICLE_EMITTER.SET_SIZE",
3914
- SET_SIZE_VARIANCE = "PARTICLE_EMITTER.SET_SIZE_VARIANCE",
3909
+ SET_SIZE_END = "PARTICLE_EMITTER.SET_SIZE_END",
3910
+ SET_SIZE_END_VARIANCE = "PARTICLE_EMITTER.SET_SIZE_END_VARIANCE",
3911
+ SET_SIZE_START = "PARTICLE_EMITTER.SET_SIZE_START",
3912
+ SET_SIZE_START_VARIANCE = "PARTICLE_EMITTER.SET_SIZE_START_VARIANCE",
3915
3913
  SET_TEXTURE_URI = "PARTICLE_EMITTER.SET_TEXTURE_URI",
3916
3914
  SET_TRANSPARENT = "PARTICLE_EMITTER.SET_TRANSPARENT",
3917
3915
  SET_VELOCITY = "PARTICLE_EMITTER.SET_VELOCITY",
@@ -4005,6 +4003,11 @@ export declare interface ParticleEmitterEventPayloads {
4005
4003
  particleEmitter: ParticleEmitter;
4006
4004
  opacityStartVariance: number;
4007
4005
  };
4006
+ /** Emitted when the paused state of an emitted particle is set. */
4007
+ [ParticleEmitterEvent.SET_PAUSED]: {
4008
+ particleEmitter: ParticleEmitter;
4009
+ paused: boolean;
4010
+ };
4008
4011
  /** Emitted when the position of the particle emitter is set. */
4009
4012
  [ParticleEmitterEvent.SET_POSITION]: {
4010
4013
  particleEmitter: ParticleEmitter;
@@ -4025,15 +4028,25 @@ export declare interface ParticleEmitterEventPayloads {
4025
4028
  particleEmitter: ParticleEmitter;
4026
4029
  rateVariance: number;
4027
4030
  };
4028
- /** Emitted when the size of an emitted particle is set. */
4029
- [ParticleEmitterEvent.SET_SIZE]: {
4031
+ /** Emitted when the size at the end of an emitted particle's lifetime is set. */
4032
+ [ParticleEmitterEvent.SET_SIZE_END]: {
4033
+ particleEmitter: ParticleEmitter;
4034
+ sizeEnd: number;
4035
+ };
4036
+ /** Emitted when the size variance at the end of an emitted particle's lifetime is set. */
4037
+ [ParticleEmitterEvent.SET_SIZE_END_VARIANCE]: {
4030
4038
  particleEmitter: ParticleEmitter;
4031
- size: number;
4039
+ sizeEndVariance: number;
4032
4040
  };
4033
- /** Emitted when the size variance of an emitted particle is set. */
4034
- [ParticleEmitterEvent.SET_SIZE_VARIANCE]: {
4041
+ /** Emitted when the size at the start of an emitted particle's lifetime is set. */
4042
+ [ParticleEmitterEvent.SET_SIZE_START]: {
4035
4043
  particleEmitter: ParticleEmitter;
4036
- sizeVariance: number;
4044
+ sizeStart: number;
4045
+ };
4046
+ /** Emitted when the size variance at the start of an emitted particle's lifetime is set. */
4047
+ [ParticleEmitterEvent.SET_SIZE_START_VARIANCE]: {
4048
+ particleEmitter: ParticleEmitter;
4049
+ sizeStartVariance: number;
4037
4050
  };
4038
4051
  /** Emitted when the texture URI is set. */
4039
4052
  [ParticleEmitterEvent.SET_TEXTURE_URI]: {
@@ -4097,6 +4110,7 @@ export declare class ParticleEmitterManager {
4097
4110
 
4098
4111
  }
4099
4112
 
4113
+ /** Options for creating a ParticleEmitter instance. @public */
4100
4114
  export declare interface ParticleEmitterOptions {
4101
4115
  /** The URI or path to the texture to be used for the particles. */
4102
4116
  textureUri: string;
@@ -4140,10 +4154,14 @@ export declare interface ParticleEmitterOptions {
4140
4154
  rate?: number;
4141
4155
  /** The rate per second variance of the particle emission rate. */
4142
4156
  rateVariance?: number;
4143
- /** The size of an emitted particle. */
4144
- size?: number;
4145
- /** The size variance of an emitted particle. */
4146
- sizeVariance?: number;
4157
+ /** The size at the end of an emitted particle's lifetime. */
4158
+ sizeEnd?: number;
4159
+ /** The size variance at the end of an emitted particle's lifetime. */
4160
+ sizeEndVariance?: number;
4161
+ /** The size at the start of an emitted particle's lifetime. */
4162
+ sizeStart?: number;
4163
+ /** The size variance at the start of an emitted particle's lifetime. */
4164
+ sizeStartVariance?: number;
4147
4165
  /** Whether an emitted particle is transparent, resulting in smoother transparency blending. */
4148
4166
  transparent?: boolean;
4149
4167
  /** The velocity of an emitted particle. */
@@ -6578,6 +6596,15 @@ export declare interface Vector3Like {
6578
6596
  z: number;
6579
6597
  }
6580
6598
 
6599
+ /** The options for a voxels collider. @public */
6600
+ export declare interface VoxelsColliderOptions extends BaseColliderOptions {
6601
+ shape: ColliderShape.VOXELS;
6602
+ /** The coordinate of each voxel in the collider. */
6603
+ coordinates?: Vector3Like[];
6604
+ /** The size of each voxel in the collider. */
6605
+ size?: Vector3Like;
6606
+ }
6607
+
6581
6608
  /**
6582
6609
  * A callback function called when the entity associated with the
6583
6610
  * PathfindingEntityController finishes moving to a calculate waypoint
@@ -6737,8 +6764,9 @@ export declare class World extends EventRouter implements protocol.Serializable
6737
6764
  */
6738
6765
  setDirectionalLightIntensity(intensity: number): void;
6739
6766
  /**
6740
- * Sets the position the world's directional light originates from.
6741
- * @param position - The position in the world.
6767
+ * Sets the position the world's directional light originates
6768
+ * from relative to a player's camera position.
6769
+ * @param position - The position the directional light originates from relative to the player's camera position.
6742
6770
  */
6743
6771
  setDirectionalLightPosition(position: Vector3Like): void;
6744
6772
  /**
@@ -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
-