hytopia 0.6.31 → 0.6.33

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 (134) hide show
  1. package/bun-server.mjs +162 -162
  2. package/docs/server.eventpayloads.md +2 -2
  3. package/docs/server.light.md +1 -1
  4. package/docs/server.light.spawn.md +2 -2
  5. package/docs/server.md +53 -0
  6. package/docs/server.particleemitter._constructor_.md +47 -0
  7. package/docs/server.particleemitter.alphatest.md +13 -0
  8. package/docs/server.particleemitter.attachedtoentity.md +13 -0
  9. package/docs/server.particleemitter.attachedtoentitynodename.md +13 -0
  10. package/docs/server.particleemitter.colorend.md +13 -0
  11. package/docs/server.particleemitter.colorendvariance.md +13 -0
  12. package/docs/server.particleemitter.colorstart.md +13 -0
  13. package/docs/server.particleemitter.colorstartvariance.md +13 -0
  14. package/docs/server.particleemitter.despawn.md +17 -0
  15. package/docs/server.particleemitter.gravity.md +13 -0
  16. package/docs/server.particleemitter.id.md +13 -0
  17. package/docs/server.particleemitter.isspawned.md +13 -0
  18. package/docs/server.particleemitter.isstopped.md +13 -0
  19. package/docs/server.particleemitter.lifetime.md +13 -0
  20. package/docs/server.particleemitter.lifetimevariance.md +13 -0
  21. package/docs/server.particleemitter.maxparticles.md +13 -0
  22. package/docs/server.particleemitter.md +1164 -0
  23. package/docs/server.particleemitter.offset.md +13 -0
  24. package/docs/server.particleemitter.opacityend.md +13 -0
  25. package/docs/server.particleemitter.opacityendvariance.md +13 -0
  26. package/docs/server.particleemitter.opacitystart.md +13 -0
  27. package/docs/server.particleemitter.opacitystartvariance.md +13 -0
  28. package/docs/server.particleemitter.position.md +13 -0
  29. package/docs/server.particleemitter.positionvariance.md +13 -0
  30. package/docs/server.particleemitter.rate.md +13 -0
  31. package/docs/server.particleemitter.ratevariance.md +13 -0
  32. package/docs/server.particleemitter.restart.md +17 -0
  33. package/docs/server.particleemitter.setalphatest.md +53 -0
  34. package/docs/server.particleemitter.setattachedtoentity.md +53 -0
  35. package/docs/server.particleemitter.setattachedtoentitynodename.md +53 -0
  36. package/docs/server.particleemitter.setcolorend.md +53 -0
  37. package/docs/server.particleemitter.setcolorendvariance.md +53 -0
  38. package/docs/server.particleemitter.setcolorstart.md +53 -0
  39. package/docs/server.particleemitter.setcolorstartvariance.md +53 -0
  40. package/docs/server.particleemitter.setgravity.md +53 -0
  41. package/docs/server.particleemitter.setlifetime.md +53 -0
  42. package/docs/server.particleemitter.setlifetimevariance.md +53 -0
  43. package/docs/server.particleemitter.setmaxparticles.md +53 -0
  44. package/docs/server.particleemitter.setoffset.md +53 -0
  45. package/docs/server.particleemitter.setopacityend.md +53 -0
  46. package/docs/server.particleemitter.setopacityendvariance.md +53 -0
  47. package/docs/server.particleemitter.setopacitystart.md +53 -0
  48. package/docs/server.particleemitter.setopacitystartvariance.md +53 -0
  49. package/docs/server.particleemitter.setposition.md +53 -0
  50. package/docs/server.particleemitter.setpositionvariance.md +53 -0
  51. package/docs/server.particleemitter.setrate.md +53 -0
  52. package/docs/server.particleemitter.setratevariance.md +53 -0
  53. package/docs/server.particleemitter.setsize.md +53 -0
  54. package/docs/server.particleemitter.setsizevariance.md +53 -0
  55. package/docs/server.particleemitter.settextureuri.md +53 -0
  56. package/docs/server.particleemitter.settransparent.md +53 -0
  57. package/docs/server.particleemitter.setvelocity.md +53 -0
  58. package/docs/server.particleemitter.setvelocityvariance.md +53 -0
  59. package/docs/server.particleemitter.size.md +13 -0
  60. package/docs/server.particleemitter.sizevariance.md +13 -0
  61. package/docs/server.particleemitter.spawn.md +53 -0
  62. package/docs/server.particleemitter.stop.md +17 -0
  63. package/docs/server.particleemitter.textureuri.md +13 -0
  64. package/docs/server.particleemitter.transparent.md +13 -0
  65. package/docs/server.particleemitter.velocity.md +13 -0
  66. package/docs/server.particleemitter.velocityvariance.md +13 -0
  67. package/docs/server.particleemitter.world.md +13 -0
  68. package/docs/server.particleemitterevent.md +425 -0
  69. package/docs/server.particleemittereventpayloads._particle_emitter.despawn_.md +15 -0
  70. package/docs/server.particleemittereventpayloads._particle_emitter.set_alpha_test_.md +16 -0
  71. package/docs/server.particleemittereventpayloads._particle_emitter.set_attached_to_entity_.md +16 -0
  72. package/docs/server.particleemittereventpayloads._particle_emitter.set_attached_to_entity_node_name_.md +16 -0
  73. package/docs/server.particleemittereventpayloads._particle_emitter.set_color_end_.md +16 -0
  74. package/docs/server.particleemittereventpayloads._particle_emitter.set_color_end_variance_.md +16 -0
  75. package/docs/server.particleemittereventpayloads._particle_emitter.set_color_start_.md +16 -0
  76. package/docs/server.particleemittereventpayloads._particle_emitter.set_color_start_variance_.md +16 -0
  77. package/docs/server.particleemittereventpayloads._particle_emitter.set_gravity_.md +16 -0
  78. package/docs/server.particleemittereventpayloads._particle_emitter.set_lifetime_.md +16 -0
  79. package/docs/server.particleemittereventpayloads._particle_emitter.set_lifetime_variance_.md +16 -0
  80. package/docs/server.particleemittereventpayloads._particle_emitter.set_max_particles_.md +16 -0
  81. package/docs/server.particleemittereventpayloads._particle_emitter.set_offset_.md +16 -0
  82. package/docs/server.particleemittereventpayloads._particle_emitter.set_opacity_end_.md +16 -0
  83. package/docs/server.particleemittereventpayloads._particle_emitter.set_opacity_end_variance_.md +16 -0
  84. package/docs/server.particleemittereventpayloads._particle_emitter.set_opacity_start_.md +16 -0
  85. package/docs/server.particleemittereventpayloads._particle_emitter.set_opacity_start_variance_.md +16 -0
  86. package/docs/server.particleemittereventpayloads._particle_emitter.set_position_.md +16 -0
  87. package/docs/server.particleemittereventpayloads._particle_emitter.set_position_variance_.md +16 -0
  88. package/docs/server.particleemittereventpayloads._particle_emitter.set_rate_.md +16 -0
  89. package/docs/server.particleemittereventpayloads._particle_emitter.set_rate_variance_.md +16 -0
  90. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_.md +16 -0
  91. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_variance_.md +16 -0
  92. package/docs/server.particleemittereventpayloads._particle_emitter.set_texture_uri_.md +16 -0
  93. package/docs/server.particleemittereventpayloads._particle_emitter.set_transparent_.md +16 -0
  94. package/docs/server.particleemittereventpayloads._particle_emitter.set_velocity_.md +16 -0
  95. package/docs/server.particleemittereventpayloads._particle_emitter.set_velocity_variance_.md +16 -0
  96. package/docs/server.particleemittereventpayloads._particle_emitter.spawn_.md +15 -0
  97. package/docs/server.particleemittereventpayloads.md +570 -0
  98. package/docs/server.particleemittermanager.getallentityattachedparticleemitters.md +55 -0
  99. package/docs/server.particleemittermanager.getallparticleemitters.md +19 -0
  100. package/docs/server.particleemittermanager.md +113 -0
  101. package/docs/server.particleemittermanager.world.md +13 -0
  102. package/docs/server.particleemitteroptions.alphatest.md +13 -0
  103. package/docs/server.particleemitteroptions.attachedtoentity.md +13 -0
  104. package/docs/server.particleemitteroptions.attachedtoentitynodename.md +13 -0
  105. package/docs/server.particleemitteroptions.colorend.md +13 -0
  106. package/docs/server.particleemitteroptions.colorendvariance.md +13 -0
  107. package/docs/server.particleemitteroptions.colorstart.md +13 -0
  108. package/docs/server.particleemitteroptions.colorstartvariance.md +13 -0
  109. package/docs/server.particleemitteroptions.gravity.md +13 -0
  110. package/docs/server.particleemitteroptions.lifetime.md +13 -0
  111. package/docs/server.particleemitteroptions.lifetimevariance.md +13 -0
  112. package/docs/server.particleemitteroptions.maxparticles.md +13 -0
  113. package/docs/server.particleemitteroptions.md +530 -0
  114. package/docs/server.particleemitteroptions.offset.md +13 -0
  115. package/docs/server.particleemitteroptions.opacityend.md +13 -0
  116. package/docs/server.particleemitteroptions.opacityendvariance.md +13 -0
  117. package/docs/server.particleemitteroptions.opacitystart.md +13 -0
  118. package/docs/server.particleemitteroptions.opacitystartvariance.md +13 -0
  119. package/docs/server.particleemitteroptions.position.md +13 -0
  120. package/docs/server.particleemitteroptions.positionvariance.md +13 -0
  121. package/docs/server.particleemitteroptions.rate.md +13 -0
  122. package/docs/server.particleemitteroptions.ratevariance.md +13 -0
  123. package/docs/server.particleemitteroptions.size.md +13 -0
  124. package/docs/server.particleemitteroptions.sizevariance.md +13 -0
  125. package/docs/server.particleemitteroptions.textureuri.md +13 -0
  126. package/docs/server.particleemitteroptions.transparent.md +13 -0
  127. package/docs/server.particleemitteroptions.velocity.md +13 -0
  128. package/docs/server.particleemitteroptions.velocityvariance.md +13 -0
  129. package/docs/server.world.md +21 -0
  130. package/docs/server.world.particleemittermanager.md +13 -0
  131. package/node-server.mjs +155 -155
  132. package/package.json +1 -1
  133. package/server.api.json +5557 -220
  134. package/server.d.ts +566 -3
package/server.d.ts CHANGED
@@ -2212,7 +2212,7 @@ export declare class ErrorHandler {
2212
2212
  *
2213
2213
  * @public
2214
2214
  */
2215
- export declare interface EventPayloads extends AudioEventPayloads, BaseEntityControllerEventPayloads, BlockTypeEventPayloads, BlockTypeRegistryEventPayloads, ChatEventPayloads, ChunkEventPayloads, ConnectionEventPayloads, EntityEventPayloads, GameServerEventPayloads, PlayerCameraEventPayloads, PlayerEventPayloads, PlayerManagerEventPayloads, PlayerUIEventPayloads, SceneUIEventPayloads, SimulationEventPayloads, SocketEventPayloads, LightEventPayloads, WebServerEventPayloads, WorldEventPayloads, WorldLoopEventPayloads, WorldManagerEventPayloads {
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 {
2216
2216
  }
2217
2217
 
2218
2218
  /**
@@ -2676,9 +2676,9 @@ export declare class Light extends EventRouter implements protocol.Serializable
2676
2676
  */
2677
2677
  despawn(): void;
2678
2678
  /**
2679
- * Spawns the Light into the world.
2679
+ * Spawns the Light in the world.
2680
2680
  *
2681
- * @param world - The world to spawn the Light into.
2681
+ * @param world - The world to spawn the Light in.
2682
2682
  */
2683
2683
  spawn(world: World): void;
2684
2684
 
@@ -3592,6 +3592,566 @@ export declare interface NoneColliderOptions extends BaseColliderOptions {
3592
3592
  shape: ColliderShape.NONE;
3593
3593
  }
3594
3594
 
3595
+ /**
3596
+ * Represents a particle emitter in the world. Emit 2D
3597
+ * particles that always face the camera.
3598
+ *
3599
+ * @remarks
3600
+ * Particle emitters are created directly as instances. They support a
3601
+ * variety of configuration options through the {@link ParticleEmitterOptions}
3602
+ * constructor argument.
3603
+ *
3604
+ * <h2>Events</h2>
3605
+ *
3606
+ * This class is an EventRouter, and instance of it emit
3607
+ * events with payloads listed under {@link ParticleEmitterEventPayloads}.
3608
+ *
3609
+ * @example
3610
+ * ```typescript
3611
+ * const particleEmitter = new ParticleEmitter({
3612
+ * textureUri: 'textures/particles/smoke.png',
3613
+ * });
3614
+ *
3615
+ * particleEmitter.spawn(world);
3616
+ * ```
3617
+ *
3618
+ * @public
3619
+ */
3620
+ export declare class ParticleEmitter extends EventRouter implements protocol.Serializable {
3621
+
3622
+
3623
+
3624
+
3625
+
3626
+
3627
+
3628
+
3629
+
3630
+
3631
+
3632
+
3633
+
3634
+
3635
+
3636
+
3637
+
3638
+
3639
+
3640
+
3641
+
3642
+
3643
+
3644
+
3645
+
3646
+
3647
+
3648
+
3649
+
3650
+ constructor(options: ParticleEmitterOptions);
3651
+ /** The unique identifier for the ParticlEmitter. */
3652
+ get id(): number | undefined;
3653
+ /** The alpha test value, discards particle texture pixels with alpha opacity less than this value. */
3654
+ get alphaTest(): number | undefined;
3655
+ /** The entity to which the ParticleEmitter is attached if explicitly set. */
3656
+ get attachedToEntity(): Entity | undefined;
3657
+ /** The name of the node of the attached entity (if the attached entity is a model entity) to attach the particle emitter to. */
3658
+ get attachedToEntityNodeName(): string | undefined;
3659
+ /** The color of an emitted particle at the end of its lifetime. */
3660
+ get colorEnd(): RgbColor | undefined;
3661
+ /** The color variance of an emitted particle at the end of its lifetime. */
3662
+ get colorEndVariance(): RgbColor | undefined;
3663
+ /** The color of an emitted particle at the start of its lifetime. */
3664
+ get colorStart(): RgbColor | undefined;
3665
+ /** The color variance of an emitted particle at the start of its lifetime. */
3666
+ get colorStartVariance(): RgbColor | undefined;
3667
+ /** The gravity vector for an emitted particle. */
3668
+ get gravity(): Vector3Like | undefined;
3669
+ /** Whether the ParticleEmitter is spawned in the world. */
3670
+ get isSpawned(): boolean;
3671
+ /** Whether the ParticleEmitter is stopped. */
3672
+ get isStopped(): boolean;
3673
+ /** The lifetime of an emitted particle in seconds. */
3674
+ get lifetime(): number | undefined;
3675
+ /** The lifetime variance of an emitted particle in seconds. */
3676
+ get lifetimeVariance(): number | undefined;
3677
+ /** The maximum number of live particles. */
3678
+ get maxParticles(): number | undefined;
3679
+ /** The offset of the particle emitter from the attached entity or position. */
3680
+ get offset(): Vector3Like | undefined;
3681
+ /** The opacity of an emitted particle at the end of its lifetime. */
3682
+ get opacityEnd(): number | undefined;
3683
+ /** The opacity variance of an emitted particle at the end of its lifetime. */
3684
+ get opacityEndVariance(): number | undefined;
3685
+ /** The opacity of an emitted particle at the start of its lifetime. */
3686
+ get opacityStart(): number | undefined;
3687
+ /** The opacity variance of an emitted particle at the start of its lifetime. */
3688
+ get opacityStartVariance(): number | undefined;
3689
+ /** The position of the particle emitter in the world if explicitly set. */
3690
+ get position(): Vector3Like | undefined;
3691
+ /** The position variance of an emitted particle. */
3692
+ get positionVariance(): Vector3Like | undefined;
3693
+ /** The rate per second at which particles are emitted. */
3694
+ get rate(): number | undefined;
3695
+ /** The rate per second variance of the particle emission rate. */
3696
+ get rateVariance(): number | undefined;
3697
+ /** The size of an emitted particle. */
3698
+ get size(): number | undefined;
3699
+ /** The size variance of an emitted particle. */
3700
+ get sizeVariance(): number | undefined;
3701
+ /** The URI or path to the texture to be used for the particles. */
3702
+ get textureUri(): string;
3703
+ /** Whether an emitted particle is transparent, resulting in smoother transparency blending. */
3704
+ get transparent(): boolean | undefined;
3705
+ /** The velocity of an emitted particle. */
3706
+ get velocity(): Vector3Like | undefined;
3707
+ /** The velocity variance of an emitted particle. */
3708
+ get velocityVariance(): Vector3Like | undefined;
3709
+ /** The world the ParticleEmitter is in. */
3710
+ get world(): World | undefined;
3711
+ /**
3712
+ * Sets the alpha test value, discards particle texture pixels with alpha opacity less than this value.
3713
+ *
3714
+ * @param alphaTest - The alpha test value, discards particle texture pixels with alpha opacity less than this value.
3715
+ */
3716
+ setAlphaTest(alphaTest: number): void;
3717
+ /**
3718
+ * Sets the entity to which the ParticleEmitter is attached.
3719
+ *
3720
+ * @param entity - The entity to attach the ParticleEmitter to.
3721
+ */
3722
+ setAttachedToEntity(entity: Entity): void;
3723
+ /**
3724
+ * Sets the name of the node of the attached entity (if the attached entity is a model entity) to attach the particle emitter to.
3725
+ *
3726
+ * @param attachedToEntityNodeName - The name of the node of the attached entity (if the attached entity is a model entity) to attach the particle emitter to.
3727
+ */
3728
+ setAttachedToEntityNodeName(attachedToEntityNodeName: string): void;
3729
+ /**
3730
+ * Sets the color of an emitted particle at the end of its lifetime.
3731
+ *
3732
+ * @param colorEnd - The color of an emitted particle at the end of its lifetime.
3733
+ */
3734
+ setColorEnd(colorEnd: RgbColor): void;
3735
+ /**
3736
+ * Sets the color variance of an emitted particle at the end of its lifetime.
3737
+ *
3738
+ * @param colorEndVariance - The color variance of an emitted particle at the end of its lifetime.
3739
+ */
3740
+ setColorEndVariance(colorEndVariance: RgbColor): void;
3741
+ /**
3742
+ * Sets the color of an emitted particle at the start of its lifetime.
3743
+ *
3744
+ * @param colorStart - The color of an emitted particle at the start of its lifetime.
3745
+ */
3746
+ setColorStart(colorStart: RgbColor): void;
3747
+ /**
3748
+ * Sets the color variance of an emitted particle at the start of its lifetime.
3749
+ *
3750
+ * @param colorStartVariance - The color variance of an emitted particle at the start of its lifetime.
3751
+ */
3752
+ setColorStartVariance(colorStartVariance: RgbColor): void;
3753
+ /**
3754
+ * Sets the gravity vector for an emitted particle.
3755
+ *
3756
+ * @param gravity - The gravity vector for an emitted particle.
3757
+ */
3758
+ setGravity(gravity: Vector3Like): void;
3759
+ /**
3760
+ * Sets the lifetime of an emitted particle in seconds.
3761
+ *
3762
+ * @param lifetime - The lifetime of an emitted particle in seconds.
3763
+ */
3764
+ setLifetime(lifetime: number): void;
3765
+ /**
3766
+ * Sets the lifetime variance of an emitted particle in seconds.
3767
+ *
3768
+ * @param lifetimeVariance - The lifetime variance of an emitted particle in seconds.
3769
+ */
3770
+ setLifetimeVariance(lifetimeVariance: number): void;
3771
+ /**
3772
+ * Sets the maximum number of live particles.
3773
+ *
3774
+ * @param maxParticles - The maximum number of live particles.
3775
+ */
3776
+ setMaxParticles(maxParticles: number): void;
3777
+ /**
3778
+ * Sets the offset of the particle emitter from the attached entity or position.
3779
+ *
3780
+ * @param offset - The offset of the particle emitter from the attached entity or position.
3781
+ */
3782
+ setOffset(offset: Vector3Like): void;
3783
+ /**
3784
+ * Sets the opacity of an emitted particle at the end of its lifetime.
3785
+ *
3786
+ * @param opacityEnd - The opacity of an emitted particle at the end of its lifetime.
3787
+ */
3788
+ setOpacityEnd(opacityEnd: number): void;
3789
+ /**
3790
+ * Sets the opacity variance of an emitted particle at the end of its lifetime.
3791
+ *
3792
+ * @param opacityEndVariance - The opacity variance of an emitted particle at the end of its lifetime.
3793
+ */
3794
+ setOpacityEndVariance(opacityEndVariance: number): void;
3795
+ /**
3796
+ * Sets the opacity of an emitted particle at the start of its lifetime.
3797
+ *
3798
+ * @param opacityStart - The opacity of an emitted particle at the start of its lifetime.
3799
+ */
3800
+ setOpacityStart(opacityStart: number): void;
3801
+ /**
3802
+ * Sets the opacity variance of an emitted particle at the start of its lifetime.
3803
+ *
3804
+ * @param opacityStartVariance - The opacity variance of an emitted particle at the start of its lifetime.
3805
+ */
3806
+ setOpacityStartVariance(opacityStartVariance: number): void;
3807
+ /**
3808
+ * Sets the position of the particle emitter.
3809
+ *
3810
+ * @param position - The position of the particle emitter.
3811
+ */
3812
+ setPosition(position: Vector3Like): void;
3813
+ /**
3814
+ * Sets the position variance of an emitted particle.
3815
+ *
3816
+ * @param positionVariance - The position variance of an emitted particle.
3817
+ */
3818
+ setPositionVariance(positionVariance: Vector3Like): void;
3819
+ /**
3820
+ * Sets the rate per second at which particles are emitted.
3821
+ *
3822
+ * @param rate - The rate per second at which particles are emitted.
3823
+ */
3824
+ setRate(rate: number): void;
3825
+ /**
3826
+ * Sets the rate variance of the particle emission rate.
3827
+ *
3828
+ * @param rateVariance - The rate variance of the particle emission rate.
3829
+ */
3830
+ setRateVariance(rateVariance: number): void;
3831
+ /**
3832
+ * Sets the size of an emitted particle.
3833
+ *
3834
+ * @param size - The size of an emitted particle.
3835
+ */
3836
+ setSize(size: number): void;
3837
+ /**
3838
+ * Sets the size variance of an emitted particle.
3839
+ *
3840
+ * @param sizeVariance - The size variance of an emitted particle.
3841
+ */
3842
+ setSizeVariance(sizeVariance: number): void;
3843
+ /**
3844
+ * Sets the texture URI of the particles emitted.
3845
+ *
3846
+ * @param textureUri - The texture URI of the particles emitted.
3847
+ */
3848
+ setTextureUri(textureUri: string): void;
3849
+ /**
3850
+ * Sets the transparency of the particle emitter.
3851
+ *
3852
+ * @param transparent - The transparency of the particle emitter.
3853
+ */
3854
+ setTransparent(transparent: boolean): void;
3855
+ /**
3856
+ * Sets the velocity of an emitted particle.
3857
+ *
3858
+ * @param velocity - The velocity of an emitted particle.
3859
+ */
3860
+ setVelocity(velocity: Vector3Like): void;
3861
+ /**
3862
+ * Sets the velocity variance of an emitted particle.
3863
+ *
3864
+ * @param velocityVariance - The velocity variance of an emitted particle.
3865
+ */
3866
+ setVelocityVariance(velocityVariance: Vector3Like): void;
3867
+ /**
3868
+ * Despawns the ParticleEmitter from the world.
3869
+ */
3870
+ despawn(): void;
3871
+ /**
3872
+ * Restarts the particle emission if it was previously stopped.
3873
+ * Internally, this sets the rate to the value it was before being stopped.
3874
+ */
3875
+ restart(): void;
3876
+ /**
3877
+ * Stops the particle emission if it was previously started.
3878
+ * Internally, this sets the rate to 0.
3879
+ */
3880
+ stop(): void;
3881
+ /**
3882
+ * Spawns the ParticleEmitter in the world.
3883
+ *
3884
+ * @param world - The world to spawn the ParticleEmitter in.
3885
+ */
3886
+ spawn(world: World): void;
3887
+
3888
+ }
3889
+
3890
+ /** Event types a ParticleEmitter instance can emit. See {@link ParticleEmitterEventPayloads} */
3891
+ export declare enum ParticleEmitterEvent {
3892
+ DESPAWN = "PARTICLE_EMITTER.DESPAWN",
3893
+ SET_ALPHA_TEST = "PARTICLE_EMITTER.SET_ALPHA_TEST",
3894
+ SET_ATTACHED_TO_ENTITY = "PARTICLE_EMITTER.SET_ATTACHED_TO_ENTITY",
3895
+ SET_ATTACHED_TO_ENTITY_NODE_NAME = "PARTICLE_EMITTER.SET_ATTACHED_TO_ENTITY_NODE_NAME",
3896
+ SET_COLOR_END = "PARTICLE_EMITTER.SET_COLOR_END",
3897
+ SET_COLOR_END_VARIANCE = "PARTICLE_EMITTER.SET_COLOR_END_VARIANCE",
3898
+ SET_COLOR_START = "PARTICLE_EMITTER.SET_COLOR_START",
3899
+ SET_COLOR_START_VARIANCE = "PARTICLE_EMITTER.SET_COLOR_START_VARIANCE",
3900
+ SET_GRAVITY = "PARTICLE_EMITTER.SET_GRAVITY",
3901
+ SET_LIFETIME = "PARTICLE_EMITTER.SET_LIFETIME",
3902
+ SET_LIFETIME_VARIANCE = "PARTICLE_EMITTER.SET_LIFETIME_VARIANCE",
3903
+ SET_MAX_PARTICLES = "PARTICLE_EMITTER.SET_MAX_PARTICLES",
3904
+ SET_OFFSET = "PARTICLE_EMITTER.SET_OFFSET",
3905
+ SET_OPACITY_END = "PARTICLE_EMITTER.SET_OPACITY_END",
3906
+ SET_OPACITY_END_VARIANCE = "PARTICLE_EMITTER.SET_OPACITY_END_VARIANCE",
3907
+ SET_OPACITY_START = "PARTICLE_EMITTER.SET_OPACITY_START",
3908
+ SET_OPACITY_START_VARIANCE = "PARTICLE_EMITTER.SET_OPACITY_START_VARIANCE",
3909
+ SET_POSITION = "PARTICLE_EMITTER.SET_POSITION",
3910
+ SET_POSITION_VARIANCE = "PARTICLE_EMITTER.SET_POSITION_VARIANCE",
3911
+ SET_RATE = "PARTICLE_EMITTER.SET_RATE",
3912
+ SET_RATE_VARIANCE = "PARTICLE_EMITTER.SET_RATE_VARIANCE",
3913
+ SET_SIZE = "PARTICLE_EMITTER.SET_SIZE",
3914
+ SET_SIZE_VARIANCE = "PARTICLE_EMITTER.SET_SIZE_VARIANCE",
3915
+ SET_TEXTURE_URI = "PARTICLE_EMITTER.SET_TEXTURE_URI",
3916
+ SET_TRANSPARENT = "PARTICLE_EMITTER.SET_TRANSPARENT",
3917
+ SET_VELOCITY = "PARTICLE_EMITTER.SET_VELOCITY",
3918
+ SET_VELOCITY_VARIANCE = "PARTICLE_EMITTER.SET_VELOCITY_VARIANCE",
3919
+ SPAWN = "PARTICLE_EMITTER.SPAWN"
3920
+ }
3921
+
3922
+ /** Event payloads for ParticleEmitter emitted events. @public */
3923
+ export declare interface ParticleEmitterEventPayloads {
3924
+ /** Emitted when a ParticleEmitter is despawned. */
3925
+ [ParticleEmitterEvent.DESPAWN]: {
3926
+ particleEmitter: ParticleEmitter;
3927
+ };
3928
+ /** Emitted when the alpha test value is set. */
3929
+ [ParticleEmitterEvent.SET_ALPHA_TEST]: {
3930
+ particleEmitter: ParticleEmitter;
3931
+ alphaTest: number;
3932
+ };
3933
+ /** Emitted when the ParticleEmitter is attached to an entity. */
3934
+ [ParticleEmitterEvent.SET_ATTACHED_TO_ENTITY]: {
3935
+ particleEmitter: ParticleEmitter;
3936
+ entity: Entity;
3937
+ };
3938
+ /** Emitted when the name of the node of the attached entity the particle emitter is attached to is set. */
3939
+ [ParticleEmitterEvent.SET_ATTACHED_TO_ENTITY_NODE_NAME]: {
3940
+ particleEmitter: ParticleEmitter;
3941
+ attachedToEntityNodeName: string;
3942
+ };
3943
+ /** Emitted when the color of an emitted particle at the end of its lifetime is set. */
3944
+ [ParticleEmitterEvent.SET_COLOR_END]: {
3945
+ particleEmitter: ParticleEmitter;
3946
+ colorEnd: RgbColor;
3947
+ };
3948
+ /** Emitted when the color variance of an emitted particle at the end of its lifetime is set. */
3949
+ [ParticleEmitterEvent.SET_COLOR_END_VARIANCE]: {
3950
+ particleEmitter: ParticleEmitter;
3951
+ colorEndVariance: RgbColor;
3952
+ };
3953
+ /** Emitted when the color of an emitted particle at the start of its lifetime is set. */
3954
+ [ParticleEmitterEvent.SET_COLOR_START]: {
3955
+ particleEmitter: ParticleEmitter;
3956
+ colorStart: RgbColor;
3957
+ };
3958
+ /** Emitted when the color variance of an emitted particle at the start of its lifetime is set. */
3959
+ [ParticleEmitterEvent.SET_COLOR_START_VARIANCE]: {
3960
+ particleEmitter: ParticleEmitter;
3961
+ colorStartVariance: RgbColor;
3962
+ };
3963
+ /** Emitted when the gravity vector for an emitted particle is set. */
3964
+ [ParticleEmitterEvent.SET_GRAVITY]: {
3965
+ particleEmitter: ParticleEmitter;
3966
+ gravity: Vector3Like;
3967
+ };
3968
+ /** Emitted when the lifetime of an emitted particle is set. */
3969
+ [ParticleEmitterEvent.SET_LIFETIME]: {
3970
+ particleEmitter: ParticleEmitter;
3971
+ lifetime: number;
3972
+ };
3973
+ /** Emitted when the lifetime variance of an emitted particle is set. */
3974
+ [ParticleEmitterEvent.SET_LIFETIME_VARIANCE]: {
3975
+ particleEmitter: ParticleEmitter;
3976
+ lifetimeVariance: number;
3977
+ };
3978
+ /** Emitted when the maximum number of live particles is set. */
3979
+ [ParticleEmitterEvent.SET_MAX_PARTICLES]: {
3980
+ particleEmitter: ParticleEmitter;
3981
+ maxParticles: number;
3982
+ };
3983
+ /** Emitted when the offset of the particle emitter is set. */
3984
+ [ParticleEmitterEvent.SET_OFFSET]: {
3985
+ particleEmitter: ParticleEmitter;
3986
+ offset: Vector3Like;
3987
+ };
3988
+ /** Emitted when the opacity of an emitted particle at the end of its lifetime is set. */
3989
+ [ParticleEmitterEvent.SET_OPACITY_END]: {
3990
+ particleEmitter: ParticleEmitter;
3991
+ opacityEnd: number;
3992
+ };
3993
+ /** Emitted when the opacity variance of an emitted particle at the end of its lifetime is set. */
3994
+ [ParticleEmitterEvent.SET_OPACITY_END_VARIANCE]: {
3995
+ particleEmitter: ParticleEmitter;
3996
+ opacityEndVariance: number;
3997
+ };
3998
+ /** Emitted when the opacity of an emitted particle at the start of its lifetime is set. */
3999
+ [ParticleEmitterEvent.SET_OPACITY_START]: {
4000
+ particleEmitter: ParticleEmitter;
4001
+ opacityStart: number;
4002
+ };
4003
+ /** Emitted when the opacity variance of an emitted particle at the start of its lifetime is set. */
4004
+ [ParticleEmitterEvent.SET_OPACITY_START_VARIANCE]: {
4005
+ particleEmitter: ParticleEmitter;
4006
+ opacityStartVariance: number;
4007
+ };
4008
+ /** Emitted when the position of the particle emitter is set. */
4009
+ [ParticleEmitterEvent.SET_POSITION]: {
4010
+ particleEmitter: ParticleEmitter;
4011
+ position: Vector3Like;
4012
+ };
4013
+ /** Emitted when the position variance of an emitted particle is set. */
4014
+ [ParticleEmitterEvent.SET_POSITION_VARIANCE]: {
4015
+ particleEmitter: ParticleEmitter;
4016
+ positionVariance: Vector3Like;
4017
+ };
4018
+ /** Emitted when the rate per second at which particles are emitted is set. */
4019
+ [ParticleEmitterEvent.SET_RATE]: {
4020
+ particleEmitter: ParticleEmitter;
4021
+ rate: number;
4022
+ };
4023
+ /** Emitted when the rate per second variance of the particle emission rate is set. */
4024
+ [ParticleEmitterEvent.SET_RATE_VARIANCE]: {
4025
+ particleEmitter: ParticleEmitter;
4026
+ rateVariance: number;
4027
+ };
4028
+ /** Emitted when the size of an emitted particle is set. */
4029
+ [ParticleEmitterEvent.SET_SIZE]: {
4030
+ particleEmitter: ParticleEmitter;
4031
+ size: number;
4032
+ };
4033
+ /** Emitted when the size variance of an emitted particle is set. */
4034
+ [ParticleEmitterEvent.SET_SIZE_VARIANCE]: {
4035
+ particleEmitter: ParticleEmitter;
4036
+ sizeVariance: number;
4037
+ };
4038
+ /** Emitted when the texture URI is set. */
4039
+ [ParticleEmitterEvent.SET_TEXTURE_URI]: {
4040
+ particleEmitter: ParticleEmitter;
4041
+ textureUri: string;
4042
+ };
4043
+ /** Emitted when the transparency of an emitted particle is set. */
4044
+ [ParticleEmitterEvent.SET_TRANSPARENT]: {
4045
+ particleEmitter: ParticleEmitter;
4046
+ transparent: boolean;
4047
+ };
4048
+ /** Emitted when the velocity of an emitted particle is set. */
4049
+ [ParticleEmitterEvent.SET_VELOCITY]: {
4050
+ particleEmitter: ParticleEmitter;
4051
+ velocity: Vector3Like;
4052
+ };
4053
+ /** Emitted when the velocity variance of an emitted particle is set. */
4054
+ [ParticleEmitterEvent.SET_VELOCITY_VARIANCE]: {
4055
+ particleEmitter: ParticleEmitter;
4056
+ velocityVariance: Vector3Like;
4057
+ };
4058
+ /** Emitted when a ParticleEmitter is spawned. */
4059
+ [ParticleEmitterEvent.SPAWN]: {
4060
+ particleEmitter: ParticleEmitter;
4061
+ };
4062
+ }
4063
+
4064
+ /**
4065
+ * Manages ParticleEmitter instances in a world.
4066
+ *
4067
+ * @remarks
4068
+ * The ParticleEmitterManager is created internally as a singleton
4069
+ * for each {@link World} instance in a game server.
4070
+ * It allows retrieval of all loaded ParticleEmitter instances,
4071
+ * entity attached ParticleEmitter instances, and more.
4072
+ *
4073
+ * @public
4074
+ */
4075
+ export declare class ParticleEmitterManager {
4076
+
4077
+
4078
+
4079
+
4080
+ /** The world the ParticleEmitterManager is for. */
4081
+ get world(): World;
4082
+
4083
+ /**
4084
+ * Retrieves all spawned ParticleEmitter instances for the world.
4085
+ *
4086
+ * @returns An array of ParticleEmitter instances.
4087
+ */
4088
+ getAllParticleEmitters(): ParticleEmitter[];
4089
+ /**
4090
+ * Retrieves all spawned ParticleEmitter instances attached to a specific entity.
4091
+ *
4092
+ * @param entity - The entity to get attached ParticleEmitter instances for.
4093
+ * @returns An array of ParticleEmitter instances.
4094
+ */
4095
+ getAllEntityAttachedParticleEmitters(entity: Entity): ParticleEmitter[];
4096
+
4097
+
4098
+ }
4099
+
4100
+ export declare interface ParticleEmitterOptions {
4101
+ /** The URI or path to the texture to be used for the particles. */
4102
+ textureUri: string;
4103
+ /** The alpha test value, discards particle texture pixels with alpha opacity less than this value. Defaults to 0.5. */
4104
+ alphaTest?: number;
4105
+ /** If set, the ParticleEmitter will be attached to this entity. */
4106
+ attachedToEntity?: Entity;
4107
+ /** The name of the node of the attached entity (if the attached entity is a model entity) to attach the particle emitter to. */
4108
+ attachedToEntityNodeName?: string;
4109
+ /** The color of an emitted particle at the end of its lifetime. */
4110
+ colorEnd?: RgbColor;
4111
+ /** The color variance of an emitted particle at the end of its lifetime. */
4112
+ colorEndVariance?: RgbColor;
4113
+ /** The color of an emitted particle at the start of its lifetime. */
4114
+ colorStart?: RgbColor;
4115
+ /** The color variance of an emitted particle at the start of its lifetime. */
4116
+ colorStartVariance?: RgbColor;
4117
+ /** The gravity vector for an emitted particle. */
4118
+ gravity?: Vector3Like;
4119
+ /** The lifetime of an emitted particle in seconds. */
4120
+ lifetime?: number;
4121
+ /** The lifetime variance of an emitted particle in seconds. */
4122
+ lifetimeVariance?: number;
4123
+ /** The maximum number of live particles. */
4124
+ maxParticles?: number;
4125
+ /** The offset of the particle emitter from the attached entity or position. */
4126
+ offset?: Vector3Like;
4127
+ /** The opacity of an emitted particle at the end of its lifetime. */
4128
+ opacityEnd?: number;
4129
+ /** The opacity variance of an emitted particle at the end of its lifetime. */
4130
+ opacityEndVariance?: number;
4131
+ /** The opacity of an emitted particle at the start of its lifetime. */
4132
+ opacityStart?: number;
4133
+ /** The opacity variance of an emitted particle at the start of its lifetime. */
4134
+ opacityStartVariance?: number;
4135
+ /** The position of the particle emitter in the world if explicitly set. */
4136
+ position?: Vector3Like;
4137
+ /** The position variance of an emitted particle. */
4138
+ positionVariance?: Vector3Like;
4139
+ /** The rate per second at which particles are emitted. */
4140
+ rate?: number;
4141
+ /** The rate per second variance of the particle emission rate. */
4142
+ rateVariance?: number;
4143
+ /** The size of an emitted particle. */
4144
+ size?: number;
4145
+ /** The size variance of an emitted particle. */
4146
+ sizeVariance?: number;
4147
+ /** Whether an emitted particle is transparent, resulting in smoother transparency blending. */
4148
+ transparent?: boolean;
4149
+ /** The velocity of an emitted particle. */
4150
+ velocity?: Vector3Like;
4151
+ /** The velocity variance of an emitted particle. */
4152
+ velocityVariance?: Vector3Like;
4153
+ }
4154
+
3595
4155
  /**
3596
4156
  * A callback function called when the pathfinding algorithm aborts.
3597
4157
  * @public
@@ -6097,6 +6657,7 @@ export declare class World extends EventRouter implements protocol.Serializable
6097
6657
 
6098
6658
 
6099
6659
 
6660
+
6100
6661
 
6101
6662
 
6102
6663
  /**
@@ -6144,6 +6705,8 @@ export declare class World extends EventRouter implements protocol.Serializable
6144
6705
  /** The world loop for the world. */
6145
6706
  get loop(): WorldLoop;
6146
6707
 
6708
+ /** The particle emitter manager for the world. */
6709
+ get particleEmitterManager(): ParticleEmitterManager;
6147
6710
  /** The scene UI manager for the world. */
6148
6711
  get sceneUIManager(): SceneUIManager;
6149
6712
  /** The simulation for the world. */