hytopia 0.6.11 → 0.6.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/server.d.ts CHANGED
@@ -491,6 +491,8 @@ export declare interface BaseEntityOptions {
491
491
  controller?: BaseEntityController;
492
492
  /** The opacity of the entity between 0 and 1. 0 is fully transparent, 1 is fully opaque. */
493
493
  opacity?: number;
494
+ /** Whether the entity is environmental, if true it will not invoke its tick function or change position. Defaults to false. */
495
+ isEnvironmental?: boolean;
494
496
  /** The parent entity of the entity, entities with a parent will ignore creating their own colliders. */
495
497
  parent?: Entity;
496
498
  /** The name of the parent's node (if parent is a model entity) to attach the entity to. */
@@ -1757,6 +1759,7 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
1757
1759
 
1758
1760
 
1759
1761
 
1762
+
1760
1763
 
1761
1764
 
1762
1765
  /**
@@ -1803,6 +1806,8 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
1803
1806
  get tintColor(): RgbColor | undefined;
1804
1807
  /** Whether the entity is a block entity. */
1805
1808
  get isBlockEntity(): boolean;
1809
+ /** Whether the entity is environmental, if true it will not invoke its tick function or change position. */
1810
+ get isEnvironmental(): boolean;
1806
1811
  /** Whether the entity is a model entity. */
1807
1812
  get isModelEntity(): boolean;
1808
1813
  /** Whether the entity is spawned. */
@@ -2097,6 +2102,7 @@ export declare class EntityManager {
2097
2102
 
2098
2103
 
2099
2104
 
2105
+
2100
2106
  /** The number of spawned entities in the world. */
2101
2107
  get entityCount(): number;
2102
2108
  /** The world the entity manager is for. */
@@ -2394,6 +2400,108 @@ export declare type IntersectionResult = {
2394
2400
  intersectedEntity?: Entity;
2395
2401
  };
2396
2402
 
2403
+ /**
2404
+ * A high-performance Map-like data structure optimized for frequent iteration.
2405
+ *
2406
+ * @remarks
2407
+ * IterationMap maintains both a Map for O(1) lookups and an Array for fast iteration,
2408
+ * eliminating the need for Array.from() calls and providing ~2x faster iteration
2409
+ * than Map.values(). Optimized for "build up, iterate, clear" usage patterns
2410
+ * common in game loops.
2411
+ *
2412
+ * @example
2413
+ * ```typescript
2414
+ * const iterationMap = new IterationMap<number, string>();
2415
+ * iterationMap.set(1, 'hello');
2416
+ * iterationMap.set(2, 'world');
2417
+ *
2418
+ * // Fast O(1) lookup
2419
+ * const value = iterationMap.get(1);
2420
+ *
2421
+ * // Fast array iteration (no Map.values() overhead)
2422
+ * for (const item of iterationMap.valuesArray) {
2423
+ * console.log(item);
2424
+ * }
2425
+ *
2426
+ * // Efficient bulk clear
2427
+ * iterationMap.clear();
2428
+ * ```
2429
+ *
2430
+ * @public
2431
+ */
2432
+ export declare class IterationMap<K, V> {
2433
+
2434
+
2435
+
2436
+ /**
2437
+ * Returns the number of key-value pairs in the IterationMap.
2438
+ */
2439
+ get size(): number;
2440
+ /**
2441
+ * Returns a readonly array of all values for fast iteration.
2442
+ * This is the key performance feature - use this instead of .values() for iteration.
2443
+ */
2444
+ get valuesArray(): readonly V[];
2445
+ /**
2446
+ * Returns the value associated with the key, or undefined if the key doesn't exist.
2447
+ * @param key - The key to look up.
2448
+ * @returns The value associated with the key, or undefined.
2449
+ */
2450
+ get(key: K): V | undefined;
2451
+ /**
2452
+ * Sets the value for the key in the IterationMap.
2453
+ * @param key - The key to set.
2454
+ * @param value - The value to set.
2455
+ * @returns The IterationMap instance for chaining.
2456
+ */
2457
+ set(key: K, value: V): this;
2458
+ /**
2459
+ * Returns true if the key exists in the IterationMap.
2460
+ * @param key - The key to check.
2461
+ * @returns True if the key exists, false otherwise.
2462
+ */
2463
+ has(key: K): boolean;
2464
+ /**
2465
+ * Removes the key-value pair from the IterationMap.
2466
+ * @param key - The key to delete.
2467
+ * @returns True if the key existed and was deleted, false otherwise.
2468
+ */
2469
+ delete(key: K): boolean;
2470
+ /**
2471
+ * Removes all key-value pairs from the IterationMap.
2472
+ * Highly optimized for the common "build up, iterate, clear" pattern.
2473
+ */
2474
+ clear(): void;
2475
+ /**
2476
+ * Executes a provided function once for each key-value pair.
2477
+ * @param callbackfn - Function to execute for each element.
2478
+ * @param thisArg - Value to use as this when executing callback.
2479
+ */
2480
+ forEach(callbackfn: (value: V, key: K, map: IterationMap<K, V>) => void, thisArg?: any): void;
2481
+ /**
2482
+ * Returns an iterator for the keys in the IterationMap.
2483
+ * @returns An iterator for the keys.
2484
+ */
2485
+ keys(): IterableIterator<K>;
2486
+ /**
2487
+ * Returns an iterator for the values in the IterationMap.
2488
+ * Note: For performance-critical iteration, use .valuesArray instead.
2489
+ * @returns An iterator for the values.
2490
+ */
2491
+ values(): IterableIterator<V>;
2492
+ /**
2493
+ * Returns an iterator for the key-value pairs in the IterationMap.
2494
+ * @returns An iterator for the entries.
2495
+ */
2496
+ entries(): IterableIterator<[K, V]>;
2497
+ /**
2498
+ * Returns an iterator for the key-value pairs in the IterationMap.
2499
+ * @returns An iterator for the entries.
2500
+ */
2501
+ [Symbol.iterator](): IterableIterator<[K, V]>;
2502
+
2503
+ }
2504
+
2397
2505
  /** The options for a kinematic position rigid body. @public */
2398
2506
  export declare interface KinematicPositionRigidBodyOptions extends BaseRigidBodyOptions {
2399
2507
  type: RigidBodyType.KINEMATIC_POSITION;