hytopia 0.7.1 → 0.7.3-dev1

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 (69) hide show
  1. package/bun-server.mjs +159 -159
  2. package/docs/server.array3number.md +13 -0
  3. package/docs/server.array4number.md +13 -0
  4. package/docs/server.audiomanager.getallaudios.md +37 -1
  5. package/docs/server.audiomanager.md +1 -1
  6. package/docs/server.blocktype._constructor_.md +15 -1
  7. package/docs/server.blocktype.blocktyperegistry.md +13 -0
  8. package/docs/server.blocktype.md +22 -1
  9. package/docs/server.blocktyperegistry.getallblocktypes.md +37 -1
  10. package/docs/server.blocktyperegistry.md +1 -1
  11. package/docs/server.chunk._constructor_.md +15 -1
  12. package/docs/server.chunk.chunklattice.md +13 -0
  13. package/docs/server.chunk.md +22 -1
  14. package/docs/server.chunklattice.getallchunks.md +37 -1
  15. package/docs/server.chunklattice.md +22 -1
  16. package/docs/server.chunklattice.world.md +13 -0
  17. package/docs/server.entitymanager.getallentities.md +37 -1
  18. package/docs/server.entitymanager.md +1 -1
  19. package/docs/server.lightmanager.getalllights.md +37 -1
  20. package/docs/server.lightmanager.md +1 -1
  21. package/docs/server.md +33 -0
  22. package/docs/server.particleemitter.md +120 -29
  23. package/docs/server.particleemitter.paused.md +13 -0
  24. package/docs/server.particleemitter.restart.md +1 -1
  25. package/docs/{server.particleemitter.setsize.md → server.particleemitter.setsizeend.md} +6 -6
  26. package/docs/server.particleemitter.setsizeendvariance.md +53 -0
  27. package/docs/{server.particleemitter.setsizevariance.md → server.particleemitter.setsizestart.md} +6 -6
  28. package/docs/server.particleemitter.setsizestartvariance.md +53 -0
  29. package/docs/server.particleemitter.sizeend.md +13 -0
  30. package/docs/server.particleemitter.sizeendvariance.md +13 -0
  31. package/docs/server.particleemitter.sizestart.md +13 -0
  32. package/docs/server.particleemitter.sizestartvariance.md +13 -0
  33. package/docs/server.particleemitter.stop.md +1 -1
  34. package/docs/server.particleemitterevent.md +46 -4
  35. package/docs/server.particleemittereventpayloads._particle_emitter.set_paused_.md +16 -0
  36. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_end_.md +16 -0
  37. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_end_variance_.md +16 -0
  38. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_start_.md +16 -0
  39. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_start_variance_.md +16 -0
  40. package/docs/server.particleemittereventpayloads.md +63 -6
  41. package/docs/server.particleemittermanager.getallparticleemitters.md +37 -1
  42. package/docs/server.particleemittermanager.md +1 -1
  43. package/docs/server.particleemitteroptions.md +42 -4
  44. package/docs/server.particleemitteroptions.sizeend.md +13 -0
  45. package/docs/server.particleemitteroptions.sizeendvariance.md +13 -0
  46. package/docs/server.particleemitteroptions.sizestart.md +13 -0
  47. package/docs/server.particleemitteroptions.sizestartvariance.md +13 -0
  48. package/docs/server.sceneuimanager.getallsceneuis.md +37 -1
  49. package/docs/server.sceneuimanager.md +1 -1
  50. package/docs/server.tickallocator.getarray.md +71 -0
  51. package/docs/server.tickallocator.getarray3number.md +55 -0
  52. package/docs/server.tickallocator.getarray4number.md +55 -0
  53. package/docs/server.tickallocator.getobject.md +71 -0
  54. package/docs/server.tickallocator.getset.md +71 -0
  55. package/docs/server.tickallocator.map.md +71 -0
  56. package/docs/server.tickallocator.md +148 -0
  57. package/docs/server.tickallocator.reset.md +17 -0
  58. package/docs/server.world.md +21 -0
  59. package/docs/server.world.tickallocator.md +13 -0
  60. package/node-server.mjs +163 -163
  61. package/package.json +1 -1
  62. package/server.api.json +1442 -113
  63. package/server.d.ts +230 -52
  64. package/docs/server.particleemitter.isstopped.md +0 -13
  65. package/docs/server.particleemitter.size.md +0 -13
  66. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_.md +0 -16
  67. package/docs/server.particleemittereventpayloads._particle_emitter.set_size_variance_.md +0 -16
  68. package/docs/server.particleemitteroptions.size.md +0 -13
  69. package/docs/server.particleemitteroptions.sizevariance.md +0 -13
package/server.d.ts CHANGED
@@ -12,6 +12,12 @@ import { SdpMatrix3 } from '@dimforge/rapier3d-simd-compat';
12
12
  import type { Socket } from 'net';
13
13
  import { WebSocket as WebSocket_2 } from 'ws';
14
14
 
15
+ /** A 3-element number array. @public */
16
+ export declare type Array3Number = [number, number, number];
17
+
18
+ /** A 4-element number array. @public */
19
+ export declare type Array4Number = [number, number, number, number];
20
+
15
21
  /**
16
22
  * Represents a audio playback in a world.
17
23
  *
@@ -272,9 +278,14 @@ export declare class AudioManager {
272
278
  /**
273
279
  * Retrieves all loaded audio instances for the world.
274
280
  *
281
+ * @param tickAllocated - Whether to use the tick allocator to allocate the
282
+ * returned array of Audio instances. The allocated array will be collected
283
+ * and released at the end of the current tick if true. Only use this if
284
+ * you know what you're doing.
285
+ *
275
286
  * @returns An array of audio instances.
276
287
  */
277
- getAllAudios(): Audio[];
288
+ getAllAudios(tickAllocated?: boolean): Audio[];
278
289
  /**
279
290
  * Retrieves all loaded audio instances attached to a specific entity.
280
291
  *
@@ -603,14 +614,17 @@ export declare class BlockType extends EventRouter implements protocol.Serializa
603
614
 
604
615
 
605
616
 
617
+
606
618
  /**
607
619
  * Creates a new block type instance.
608
620
  * @param world - The world the block type is for.
609
621
  * @param options - The options for the block type.
610
622
  */
611
- constructor(options?: BlockTypeOptions);
623
+ constructor(blockTypeRegistry: BlockTypeRegistry, options?: BlockTypeOptions);
612
624
  /** The unique identifier for the block type. */
613
625
  get id(): number;
626
+ /** The block type registry that the block type belongs to. */
627
+ get blockTypeRegistry(): BlockTypeRegistry;
614
628
  /** The collider options for the block type. */
615
629
  get colliderOptions(): VoxelsColliderOptions;
616
630
  /** The half extents size of the block type. */
@@ -702,9 +716,15 @@ export declare class BlockTypeRegistry extends EventRouter implements protocol.S
702
716
  get world(): World;
703
717
  /**
704
718
  * Get all registered block types.
719
+ *
720
+ * @param tickAllocated - Whether to use the tick allocator to allocate the
721
+ * returned array of BlockType instances. The allocated array will be collected
722
+ * and released at the end of the current tick if true. Only use this if
723
+ * you know what you're doing.
724
+ *
705
725
  * @returns An array of all registered block types.
706
726
  */
707
- getAllBlockTypes(): BlockType[];
727
+ getAllBlockTypes(tickAllocated?: boolean): BlockType[];
708
728
  /**
709
729
  * Get a registered block type by its id.
710
730
  * @param id - The id of the block type to get.
@@ -862,12 +882,15 @@ export declare class ChatManager extends EventRouter {
862
882
  export declare class Chunk implements protocol.Serializable {
863
883
 
864
884
 
885
+
865
886
  /**
866
887
  * Creates a new chunk instance.
867
888
  */
868
- constructor(originCoordinate: Vector3Like);
889
+ constructor(chunkLattice: ChunkLattice, originCoordinate: Vector3Like);
869
890
  /** The blocks in the chunk as a flat Uint8Array[4096], each index as 0 or a block type id. */
870
891
  get blocks(): Readonly<Uint8Array>;
892
+ /** The chunk lattice that the chunk belongs to. */
893
+ get chunkLattice(): ChunkLattice;
871
894
  /** The origin coordinate of the chunk. */
872
895
  get originCoordinate(): Vector3Like;
873
896
  /**
@@ -928,6 +951,8 @@ export declare class ChunkLattice extends EventRouter {
928
951
  constructor(world: World);
929
952
  /** The number of chunks in the lattice. */
930
953
  get chunkCount(): number;
954
+ /** The world that the chunk lattice belongs to. */
955
+ get world(): World;
931
956
  /**
932
957
  * Removes and clears all chunks and their blocks from the lattice.
933
958
  */
@@ -966,9 +991,15 @@ export declare class ChunkLattice extends EventRouter {
966
991
  getOrCreateChunk(globalCoordinate: Vector3Like): Chunk;
967
992
  /**
968
993
  * Get all chunks in the lattice.
994
+ *
995
+ * @param tickAllocated - Whether to use the tick allocator to allocate the
996
+ * returned array of Chunk instances. The allocated array will be collected
997
+ * and released at the end of the current tick if true. Only use this if
998
+ * you know what you're doing.
999
+ *
969
1000
  * @returns An array of all chunks in the lattice.
970
1001
  */
971
- getAllChunks(): Chunk[];
1002
+ getAllChunks(tickAllocated?: boolean): Chunk[];
972
1003
  /**
973
1004
  * Check if a block exists at a specific global coordinate.
974
1005
  * @param globalCoordinate - The global coordinate of the block to check.
@@ -2108,9 +2139,15 @@ export declare class EntityManager {
2108
2139
 
2109
2140
  /**
2110
2141
  * Gets all spawned entities in the world.
2142
+ *
2143
+ * @param tickAllocated - Whether to use the tick allocator to allocate the
2144
+ * returned array of Entity instances. The allocated array will be collected
2145
+ * and released at the end of the current tick if true. Only use this if
2146
+ * you know what you're doing.
2147
+ *
2111
2148
  * @returns All spawned entities in the world.
2112
2149
  */
2113
- getAllEntities(): Entity[];
2150
+ getAllEntities(tickAllocated?: boolean): Entity[];
2114
2151
  /**
2115
2152
  * Gets all spawned player entities in the world.
2116
2153
  * @returns All spawned player entities in the world.
@@ -2760,9 +2797,14 @@ export declare class LightManager {
2760
2797
  /**
2761
2798
  * Retrieves all spawned Light instances for the world.
2762
2799
  *
2800
+ * @param tickAllocated - Whether to use the tick allocator to allocate the
2801
+ * returned array of Light instances. The allocated array will be collected
2802
+ * and released at the end of the current tick if true. Only use this if
2803
+ * you know what you're doing.
2804
+ *
2763
2805
  * @returns An array of Light instances.
2764
2806
  */
2765
- getAllLights(): Light[];
2807
+ getAllLights(tickAllocated?: boolean): Light[];
2766
2808
  /**
2767
2809
  * Retrieves all spawned Light instances attached to a specific entity.
2768
2810
  *
@@ -3619,6 +3661,9 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3619
3661
 
3620
3662
 
3621
3663
 
3664
+
3665
+
3666
+
3622
3667
 
3623
3668
 
3624
3669
 
@@ -3644,8 +3689,6 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3644
3689
  get gravity(): Vector3Like | undefined;
3645
3690
  /** Whether the ParticleEmitter is spawned in the world. */
3646
3691
  get isSpawned(): boolean;
3647
- /** Whether the ParticleEmitter is stopped. */
3648
- get isStopped(): boolean;
3649
3692
  /** The lifetime of an emitted particle in seconds. */
3650
3693
  get lifetime(): number | undefined;
3651
3694
  /** The lifetime variance of an emitted particle in seconds. */
@@ -3662,6 +3705,8 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3662
3705
  get opacityStart(): number | undefined;
3663
3706
  /** The opacity variance of an emitted particle at the start of its lifetime. */
3664
3707
  get opacityStartVariance(): number | undefined;
3708
+ /** Whether an emitted particle is being paused. */
3709
+ get paused(): boolean | undefined;
3665
3710
  /** The position of the particle emitter in the world if explicitly set. */
3666
3711
  get position(): Vector3Like | undefined;
3667
3712
  /** The position variance of an emitted particle. */
@@ -3670,8 +3715,14 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3670
3715
  get rate(): number | undefined;
3671
3716
  /** The rate per second variance of the particle emission rate. */
3672
3717
  get rateVariance(): number | undefined;
3673
- /** The size of an emitted particle. */
3674
- get size(): number | undefined;
3718
+ /** The size at the end of an emitted particle's lifetime. */
3719
+ get sizeEnd(): number | undefined;
3720
+ /** The size variance at the end of an emitted particle's lifetime. */
3721
+ get sizeEndVariance(): number | undefined;
3722
+ /** The size at the start of an emitted particle's lifetime. */
3723
+ get sizeStart(): number | undefined;
3724
+ /** The size variance at the start of an emitted particle's lifetime. */
3725
+ get sizeStartVariance(): number | undefined;
3675
3726
  /** The size variance of an emitted particle. */
3676
3727
  get sizeVariance(): number | undefined;
3677
3728
  /** The URI or path to the texture to be used for the particles. */
@@ -3805,17 +3856,29 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3805
3856
  */
3806
3857
  setRateVariance(rateVariance: number): void;
3807
3858
  /**
3808
- * Sets the size of an emitted particle.
3859
+ * Sets the size at the end of an emitted particle's lifetime.
3860
+ *
3861
+ * @param sizeEnd - The size at the end of an emitted particle's lifetime.
3862
+ */
3863
+ setSizeEnd(sizeEnd: number): void;
3864
+ /**
3865
+ * Sets the size variance at the end of an emitted particle's lifetime.
3809
3866
  *
3810
- * @param size - The size of an emitted particle.
3867
+ * @param sizeEndVariance - The size variance at the end of an emitted particle's lifetime.
3811
3868
  */
3812
- setSize(size: number): void;
3869
+ setSizeEndVariance(sizeEndVariance: number): void;
3813
3870
  /**
3814
- * Sets the size variance of an emitted particle.
3871
+ * Sets the size at the start of an emitted particle's lifetime.
3815
3872
  *
3816
- * @param sizeVariance - The size variance of an emitted particle.
3873
+ * @param sizeStart - The size at the start of an emitted particle's lifetime.
3817
3874
  */
3818
- setSizeVariance(sizeVariance: number): void;
3875
+ setSizeStart(sizeStart: number): void;
3876
+ /**
3877
+ * Sets the size variance at the start of an emitted particle's lifetime.
3878
+ *
3879
+ * @param sizeStartVariance - The size variance at the start of an emitted particle's lifetime.
3880
+ */
3881
+ setSizeStartVariance(sizeStartVariance: number): void;
3819
3882
  /**
3820
3883
  * Sets the texture URI of the particles emitted.
3821
3884
  *
@@ -3846,12 +3909,10 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3846
3909
  despawn(): void;
3847
3910
  /**
3848
3911
  * Restarts the particle emission if it was previously stopped.
3849
- * Internally, this sets the rate to the value it was before being stopped.
3850
3912
  */
3851
3913
  restart(): void;
3852
3914
  /**
3853
- * Stops the particle emission if it was previously started.
3854
- * Internally, this sets the rate to 0.
3915
+ * Stops the particle emission.
3855
3916
  */
3856
3917
  stop(): void;
3857
3918
  /**
@@ -3882,12 +3943,15 @@ export declare enum ParticleEmitterEvent {
3882
3943
  SET_OPACITY_END_VARIANCE = "PARTICLE_EMITTER.SET_OPACITY_END_VARIANCE",
3883
3944
  SET_OPACITY_START = "PARTICLE_EMITTER.SET_OPACITY_START",
3884
3945
  SET_OPACITY_START_VARIANCE = "PARTICLE_EMITTER.SET_OPACITY_START_VARIANCE",
3946
+ SET_PAUSED = "PARTICLE_EMITTER.SET_PAUSED",
3885
3947
  SET_POSITION = "PARTICLE_EMITTER.SET_POSITION",
3886
3948
  SET_POSITION_VARIANCE = "PARTICLE_EMITTER.SET_POSITION_VARIANCE",
3887
3949
  SET_RATE = "PARTICLE_EMITTER.SET_RATE",
3888
3950
  SET_RATE_VARIANCE = "PARTICLE_EMITTER.SET_RATE_VARIANCE",
3889
- SET_SIZE = "PARTICLE_EMITTER.SET_SIZE",
3890
- SET_SIZE_VARIANCE = "PARTICLE_EMITTER.SET_SIZE_VARIANCE",
3951
+ SET_SIZE_END = "PARTICLE_EMITTER.SET_SIZE_END",
3952
+ SET_SIZE_END_VARIANCE = "PARTICLE_EMITTER.SET_SIZE_END_VARIANCE",
3953
+ SET_SIZE_START = "PARTICLE_EMITTER.SET_SIZE_START",
3954
+ SET_SIZE_START_VARIANCE = "PARTICLE_EMITTER.SET_SIZE_START_VARIANCE",
3891
3955
  SET_TEXTURE_URI = "PARTICLE_EMITTER.SET_TEXTURE_URI",
3892
3956
  SET_TRANSPARENT = "PARTICLE_EMITTER.SET_TRANSPARENT",
3893
3957
  SET_VELOCITY = "PARTICLE_EMITTER.SET_VELOCITY",
@@ -3981,6 +4045,11 @@ export declare interface ParticleEmitterEventPayloads {
3981
4045
  particleEmitter: ParticleEmitter;
3982
4046
  opacityStartVariance: number;
3983
4047
  };
4048
+ /** Emitted when the paused state of an emitted particle is set. */
4049
+ [ParticleEmitterEvent.SET_PAUSED]: {
4050
+ particleEmitter: ParticleEmitter;
4051
+ paused: boolean;
4052
+ };
3984
4053
  /** Emitted when the position of the particle emitter is set. */
3985
4054
  [ParticleEmitterEvent.SET_POSITION]: {
3986
4055
  particleEmitter: ParticleEmitter;
@@ -4001,15 +4070,25 @@ export declare interface ParticleEmitterEventPayloads {
4001
4070
  particleEmitter: ParticleEmitter;
4002
4071
  rateVariance: number;
4003
4072
  };
4004
- /** Emitted when the size of an emitted particle is set. */
4005
- [ParticleEmitterEvent.SET_SIZE]: {
4073
+ /** Emitted when the size at the end of an emitted particle's lifetime is set. */
4074
+ [ParticleEmitterEvent.SET_SIZE_END]: {
4075
+ particleEmitter: ParticleEmitter;
4076
+ sizeEnd: number;
4077
+ };
4078
+ /** Emitted when the size variance at the end of an emitted particle's lifetime is set. */
4079
+ [ParticleEmitterEvent.SET_SIZE_END_VARIANCE]: {
4080
+ particleEmitter: ParticleEmitter;
4081
+ sizeEndVariance: number;
4082
+ };
4083
+ /** Emitted when the size at the start of an emitted particle's lifetime is set. */
4084
+ [ParticleEmitterEvent.SET_SIZE_START]: {
4006
4085
  particleEmitter: ParticleEmitter;
4007
- size: number;
4086
+ sizeStart: number;
4008
4087
  };
4009
- /** Emitted when the size variance of an emitted particle is set. */
4010
- [ParticleEmitterEvent.SET_SIZE_VARIANCE]: {
4088
+ /** Emitted when the size variance at the start of an emitted particle's lifetime is set. */
4089
+ [ParticleEmitterEvent.SET_SIZE_START_VARIANCE]: {
4011
4090
  particleEmitter: ParticleEmitter;
4012
- sizeVariance: number;
4091
+ sizeStartVariance: number;
4013
4092
  };
4014
4093
  /** Emitted when the texture URI is set. */
4015
4094
  [ParticleEmitterEvent.SET_TEXTURE_URI]: {
@@ -4059,9 +4138,14 @@ export declare class ParticleEmitterManager {
4059
4138
  /**
4060
4139
  * Retrieves all spawned ParticleEmitter instances for the world.
4061
4140
  *
4141
+ * @param tickAllocated - Whether to use the tick allocator to allocate the
4142
+ * returned array of ParticleEmitter instances. The allocated array will be collected
4143
+ * and released at the end of the current tick if true. Only use this if
4144
+ * you know what you're doing.
4145
+ *
4062
4146
  * @returns An array of ParticleEmitter instances.
4063
4147
  */
4064
- getAllParticleEmitters(): ParticleEmitter[];
4148
+ getAllParticleEmitters(tickAllocated?: boolean): ParticleEmitter[];
4065
4149
  /**
4066
4150
  * Retrieves all spawned ParticleEmitter instances attached to a specific entity.
4067
4151
  *
@@ -4117,10 +4201,14 @@ export declare interface ParticleEmitterOptions {
4117
4201
  rate?: number;
4118
4202
  /** The rate per second variance of the particle emission rate. */
4119
4203
  rateVariance?: number;
4120
- /** The size of an emitted particle. */
4121
- size?: number;
4122
- /** The size variance of an emitted particle. */
4123
- sizeVariance?: number;
4204
+ /** The size at the end of an emitted particle's lifetime. */
4205
+ sizeEnd?: number;
4206
+ /** The size variance at the end of an emitted particle's lifetime. */
4207
+ sizeEndVariance?: number;
4208
+ /** The size at the start of an emitted particle's lifetime. */
4209
+ sizeStart?: number;
4210
+ /** The size variance at the start of an emitted particle's lifetime. */
4211
+ sizeStartVariance?: number;
4124
4212
  /** Whether an emitted particle is transparent, resulting in smoother transparency blending. */
4125
4213
  transparent?: boolean;
4126
4214
  /** The velocity of an emitted particle. */
@@ -5688,9 +5776,14 @@ export declare class SceneUIManager {
5688
5776
  /**
5689
5777
  * Retrieves all loaded SceneUI instances for the world.
5690
5778
  *
5779
+ * @param tickAllocated - Whether to use the tick allocator to allocate the
5780
+ * returned array of SceneUI instances. The allocated array will be collected
5781
+ * and released at the end of the current tick if true. Only use this if
5782
+ * you know what you're doing.
5783
+ *
5691
5784
  * @returns An array of SceneUI instances.
5692
5785
  */
5693
- getAllSceneUIs(): SceneUI[];
5786
+ getAllSceneUIs(tickAllocated?: boolean): SceneUI[];
5694
5787
  /**
5695
5788
  * Retrieves all loaded SceneUI instances attached to a specific entity.
5696
5789
  *
@@ -6030,6 +6123,88 @@ export declare function startServer(init: ((() => void) | ((world: World) => voi
6030
6123
  /** The input keys that are included in the PlayerInput. @public */
6031
6124
  export declare const SUPPORTED_INPUT_KEYS: readonly ["w", "a", "s", "d", "sp", "sh", "tb", "ml", "mr", "q", "e", "r", "f", "z", "x", "c", "v", "u", "i", "o", "j", "k", "l", "n", "m", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
6032
6125
 
6126
+ /**
6127
+ * High-performance tick-scoped allocator for temporary objects, arrays, and buffers.
6128
+ * All allocations are automatically bulk-released when reset() is called.
6129
+ *
6130
+ * @remarks
6131
+ * TickAllocator maintains separate pools for different data types and tracks all
6132
+ * allocations made during a tick cycle. Objects are reused across ticks to eliminate
6133
+ * garbage collection overhead in hot paths like network synchronization.
6134
+ *
6135
+ * @example
6136
+ * ```typescript
6137
+ * // Allocate during tick
6138
+ * const position = tickAllocator.getArray3Number();
6139
+ * const rotation = tickAllocator.getArray4Number();
6140
+ * const data = tickAllocator.getObject<EntitySchema>();
6141
+ *
6142
+ * // At end of tick - bulk release everything
6143
+ * tickAllocator.reset();
6144
+ * ```
6145
+ *
6146
+ * @public
6147
+ */
6148
+ export declare class TickAllocator {
6149
+
6150
+
6151
+
6152
+
6153
+
6154
+
6155
+
6156
+
6157
+
6158
+
6159
+ /**
6160
+ * Gets a generic array from the pool.
6161
+ * Array is reset to empty state and ready for use.
6162
+ * @typeParam T - The array type.
6163
+ * @returns A reusable array.
6164
+ */
6165
+ getArray<T extends unknown[] = unknown[]>(copyFromA?: Iterable<unknown>, copyFromB?: Iterable<unknown>): T;
6166
+ /**
6167
+ * Gets a 3-element number array from the pool.
6168
+ * Array is reset to [0, 0, 0] and ready for use.
6169
+ * @returns A reusable 3-element array.
6170
+ */
6171
+ getArray3Number(copyFrom?: Array3Number | Set<number>): Array3Number;
6172
+ /**
6173
+ * Gets a 4-element number array from the pool.
6174
+ * Array is reset to [0, 0, 0, 0] and ready for use.
6175
+ * @returns A reusable 4-element array.
6176
+ */
6177
+ getArray4Number(copyFrom?: Array4Number | Set<number>): Array4Number;
6178
+ /**
6179
+ * Gets a plain object from the pool.
6180
+ * Object is reset to empty state and ready for use.
6181
+ * @typeParam T - The type interface for the object.
6182
+ * @returns A reusable plain object.
6183
+ */
6184
+ getObject<T extends Record<string, unknown> = Record<string, unknown>>(copyFromA?: T, copyFromB?: T): T;
6185
+ /**
6186
+ * Gets a set from the pool.
6187
+ * Set is reset to empty state and ready for use.
6188
+ * @typeParam T - The type of the set.
6189
+ * @returns A reusable set.
6190
+ */
6191
+ getSet<T>(copyFromA?: Set<T> | T[], copyFromB?: Set<T> | T[]): Set<T>;
6192
+ /**
6193
+ * Maps an array to a new array using a callback function.
6194
+ * @typeParam T - The type of the array.
6195
+ * @typeParam U - The type of the resulting array.
6196
+ * @param array - The array to map.
6197
+ * @param callback - The callback function to map the array.
6198
+ * @returns A new array with the mapped values.
6199
+ */
6200
+ map<T, U>(array: T[], callback: (value: T, index: number, array: T[]) => U): U[];
6201
+ /**
6202
+ * Releases all allocated objects back to their respective pools.
6203
+ * This is intended to be called at the end of a tick.
6204
+ */
6205
+ reset(): void;
6206
+ }
6207
+
6033
6208
  /** The options for a trimesh collider. @public */
6034
6209
  export declare interface TrimeshColliderOptions extends BaseColliderOptions {
6035
6210
  shape: ColliderShape.TRIMESH;
@@ -6644,6 +6819,7 @@ export declare class World extends EventRouter implements protocol.Serializable
6644
6819
 
6645
6820
 
6646
6821
 
6822
+
6647
6823
 
6648
6824
 
6649
6825
  /**
@@ -6656,40 +6832,32 @@ export declare class World extends EventRouter implements protocol.Serializable
6656
6832
  get ambientLightColor(): RgbColor;
6657
6833
  /** The intensity of the ambient light. */
6658
6834
  get ambientLightIntensity(): number;
6835
+ /** The block type registry for the world. */
6836
+ get blockTypeRegistry(): BlockTypeRegistry;
6837
+ /** The chat manager for the world. */
6838
+ get chatManager(): ChatManager;
6839
+ /** The chunk lattice for the world. */
6840
+ get chunkLattice(): ChunkLattice;
6659
6841
  /** The color of the directional light. */
6660
6842
  get directionalLightColor(): RgbColor;
6661
6843
  /** The intensity of the directional light. */
6662
6844
  get directionalLightIntensity(): number;
6663
6845
  /** The position the directional light originates from. */
6664
6846
  get directionalLightPosition(): Vector3Like;
6847
+ /** The entity manager for the world. */
6848
+ get entityManager(): EntityManager;
6665
6849
  /** The color of the fog, if not explicitly set, defaults to ambient light color. */
6666
6850
  get fogColor(): RgbColor | undefined;
6667
6851
  /** The maximum distance from the camera at which fog stops being applied. */
6668
6852
  get fogFar(): number;
6669
6853
  /** The minimum distance from the camera to start applying fog. */
6670
6854
  get fogNear(): number;
6671
- /** The name of the world. */
6672
- get name(): string;
6673
- /** The intensity of the world's skybox brightness. */
6674
- get skyboxIntensity(): number;
6675
- /** The URI of the skybox cubemap for the world. */
6676
- get skyboxUri(): string;
6677
- /** The audio manager for the world. */
6678
- get audioManager(): AudioManager;
6679
- /** An arbitrary identifier tag of the world. Useful for your own logic. */
6680
- get tag(): string | undefined;
6681
- /** The block type registry for the world. */
6682
- get blockTypeRegistry(): BlockTypeRegistry;
6683
- /** The chat manager for the world. */
6684
- get chatManager(): ChatManager;
6685
- /** The chunk lattice for the world. */
6686
- get chunkLattice(): ChunkLattice;
6687
- /** The entity manager for the world. */
6688
- get entityManager(): EntityManager;
6689
6855
  /** The light manager for the world. */
6690
6856
  get lightManager(): LightManager;
6691
6857
  /** The world loop for the world. */
6692
6858
  get loop(): WorldLoop;
6859
+ /** The name of the world. */
6860
+ get name(): string;
6693
6861
 
6694
6862
  /** The particle emitter manager for the world. */
6695
6863
  get particleEmitterManager(): ParticleEmitterManager;
@@ -6697,6 +6865,16 @@ export declare class World extends EventRouter implements protocol.Serializable
6697
6865
  get sceneUIManager(): SceneUIManager;
6698
6866
  /** The simulation for the world. */
6699
6867
  get simulation(): Simulation;
6868
+ /** The intensity of the world's skybox brightness. */
6869
+ get skyboxIntensity(): number;
6870
+ /** The URI of the skybox cubemap for the world. */
6871
+ get skyboxUri(): string;
6872
+ /** The audio manager for the world. */
6873
+ get audioManager(): AudioManager;
6874
+ /** An arbitrary identifier tag of the world. Useful for your own logic. */
6875
+ get tag(): string | undefined;
6876
+ /** The tick allocator for the world. */
6877
+ get tickAllocator(): TickAllocator;
6700
6878
  /**
6701
6879
  * Loads a map into the world, clearing any prior map.
6702
6880
  * @param map - The map to load.
@@ -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; [ParticleEmitter](./server.particleemitter.md) &gt; [isStopped](./server.particleemitter.isstopped.md)
4
-
5
- ## ParticleEmitter.isStopped property
6
-
7
- Whether the ParticleEmitter is stopped.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- get isStopped(): 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; [ParticleEmitter](./server.particleemitter.md) &gt; [size](./server.particleemitter.size.md)
4
-
5
- ## ParticleEmitter.size property
6
-
7
- The size of an emitted particle.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- get size(): number | undefined;
13
- ```
@@ -1,16 +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; [ParticleEmitterEventPayloads](./server.particleemittereventpayloads.md) &gt; ["PARTICLE\_EMITTER.SET\_SIZE"](./server.particleemittereventpayloads._particle_emitter.set_size_.md)
4
-
5
- ## ParticleEmitterEventPayloads."PARTICLE\_EMITTER.SET\_SIZE" property
6
-
7
- Emitted when the size of an emitted particle is set.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- [ParticleEmitterEvent.SET_SIZE]: {
13
- particleEmitter: ParticleEmitter;
14
- size: number;
15
- };
16
- ```
@@ -1,16 +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; [ParticleEmitterEventPayloads](./server.particleemittereventpayloads.md) &gt; ["PARTICLE\_EMITTER.SET\_SIZE\_VARIANCE"](./server.particleemittereventpayloads._particle_emitter.set_size_variance_.md)
4
-
5
- ## ParticleEmitterEventPayloads."PARTICLE\_EMITTER.SET\_SIZE\_VARIANCE" property
6
-
7
- Emitted when the size variance of an emitted particle is set.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- [ParticleEmitterEvent.SET_SIZE_VARIANCE]: {
13
- particleEmitter: ParticleEmitter;
14
- sizeVariance: number;
15
- };
16
- ```
@@ -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; [ParticleEmitterOptions](./server.particleemitteroptions.md) &gt; [size](./server.particleemitteroptions.size.md)
4
-
5
- ## ParticleEmitterOptions.size property
6
-
7
- The size of an emitted particle.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- size?: number;
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; [ParticleEmitterOptions](./server.particleemitteroptions.md) &gt; [sizeVariance](./server.particleemitteroptions.sizevariance.md)
4
-
5
- ## ParticleEmitterOptions.sizeVariance property
6
-
7
- The size variance of an emitted particle.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- sizeVariance?: number;
13
- ```