hytopia 0.6.6 → 0.6.7

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
@@ -1287,19 +1287,19 @@ export declare enum CollisionGroup {
1287
1287
  BLOCK = 1,
1288
1288
  ENTITY = 2,
1289
1289
  ENTITY_SENSOR = 4,
1290
- PLAYER = 8,
1291
- GROUP_1 = 16,
1292
- GROUP_2 = 32,
1293
- GROUP_3 = 64,
1294
- GROUP_4 = 128,
1295
- GROUP_5 = 256,
1296
- GROUP_6 = 512,
1297
- GROUP_7 = 1024,
1298
- GROUP_8 = 2048,
1299
- GROUP_9 = 4096,
1300
- GROUP_10 = 8192,
1301
- GROUP_11 = 16384,
1302
- GROUP_12 = 32768,
1290
+ ENVIRONMENT_ENTITY = 8,
1291
+ PLAYER = 16,
1292
+ GROUP_1 = 32,
1293
+ GROUP_2 = 64,
1294
+ GROUP_3 = 128,
1295
+ GROUP_4 = 256,
1296
+ GROUP_5 = 512,
1297
+ GROUP_6 = 1024,
1298
+ GROUP_7 = 2048,
1299
+ GROUP_8 = 4096,
1300
+ GROUP_9 = 8192,
1301
+ GROUP_10 = 16384,
1302
+ GROUP_11 = 32768,
1303
1303
  ALL = 65535
1304
1304
  }
1305
1305
 
@@ -3362,6 +3362,8 @@ export declare type MoveOptions = {
3362
3362
  };
3363
3363
  /** Whether to start the idle animations when the entity finishes moving. Defaults to true. */
3364
3364
  moveStartIdleAnimationsOnCompletion?: boolean;
3365
+ /** The distance from the target at which the entity will stop moving and consider movement complete. Defaults to 0.316~ blocks away from target. */
3366
+ moveStoppingDistance?: number;
3365
3367
  };
3366
3368
 
3367
3369
  /** The options for an error type "none" collider. @public */
@@ -3409,6 +3411,10 @@ export declare class PathfindingEntityController extends SimpleEntityController
3409
3411
 
3410
3412
 
3411
3413
 
3414
+ /**
3415
+ * @param options - Options for the controller.
3416
+ */
3417
+ constructor(options?: PathfindingEntityControllerOptions);
3412
3418
  /** Whether to enable debug mode or not. When debug mode is enabled, the pathfinding algorithm will log debug information to the console. Defaults to false. */
3413
3419
  get debug(): boolean;
3414
3420
  /** The maximum fall distance the entity can fall. */
@@ -3446,7 +3452,10 @@ export declare class PathfindingEntityController extends SimpleEntityController
3446
3452
 
3447
3453
 
3448
3454
 
3455
+ }
3449
3456
 
3457
+ /** Options for creating a PathfindingEntityController instance. @public */
3458
+ declare interface PathfindingEntityControllerOptions extends SimpleEntityControllerOptions {
3450
3459
  }
3451
3460
 
3452
3461
  /**
@@ -3646,6 +3655,7 @@ export declare class PlayerCamera extends EventRouter implements protocol.Serial
3646
3655
 
3647
3656
 
3648
3657
 
3658
+
3649
3659
  /** The entity the camera is attached to. */
3650
3660
  get attachedToEntity(): Entity | undefined;
3651
3661
  /** The position the camera is attached to. */
@@ -3666,6 +3676,8 @@ export declare class PlayerCamera extends EventRouter implements protocol.Serial
3666
3676
  get offset(): Vector3Like;
3667
3677
  /** The current orientation of the camera. */
3668
3678
  get orientation(): PlayerCameraOrientation;
3679
+ /** The shoulder angle of the camera in degrees. */
3680
+ get shoulderAngle(): number;
3669
3681
  /** The entity the camera will constantly look at, even if the camera attached or tracked entity moves. */
3670
3682
  get trackedEntity(): Entity | undefined;
3671
3683
  /** The position the camera will constantly look at, even if the camera attached entity moves. */
@@ -3739,6 +3751,14 @@ export declare class PlayerCamera extends EventRouter implements protocol.Serial
3739
3751
  setOffset(offset: Vector3Like): void;
3740
3752
 
3741
3753
 
3754
+ /**
3755
+ * Only used in third-person mode. Sets the shoulder angle
3756
+ * of the camera in degrees. A positive value shifts the
3757
+ * camera to the right, a negative value shifts it to the
3758
+ * left.
3759
+ * @param shoulderAngle - The shoulder angle to set in degrees.
3760
+ */
3761
+ setShoulderAngle(shoulderAngle: number): void;
3742
3762
  /**
3743
3763
  * Sets the entity the camera will constantly look at,
3744
3764
  * even if the camera attached or tracked entity moves.
@@ -3772,6 +3792,7 @@ export declare enum PlayerCameraEvent {
3772
3792
  SET_MODEL_HIDDEN_NODES = "PLAYER_CAMERA.SET_MODEL_HIDDEN_NODES",
3773
3793
  SET_MODE = "PLAYER_CAMERA.SET_MODE",
3774
3794
  SET_OFFSET = "PLAYER_CAMERA.SET_OFFSET",
3795
+ SET_SHOULDER_ANGLE = "PLAYER_CAMERA.SET_SHOULDER_ANGLE",
3775
3796
  SET_TRACKED_ENTITY = "PLAYER_CAMERA.SET_TRACKED_ENTITY",
3776
3797
  SET_TRACKED_POSITION = "PLAYER_CAMERA.SET_TRACKED_POSITION",
3777
3798
  SET_ZOOM = "PLAYER_CAMERA.SET_ZOOM"
@@ -3829,6 +3850,11 @@ export declare interface PlayerCameraEventPayloads {
3829
3850
  playerCamera: PlayerCamera;
3830
3851
  offset: Vector3Like;
3831
3852
  };
3853
+ /** Emitted when the shoulder angle of the camera is set. */
3854
+ [PlayerCameraEvent.SET_SHOULDER_ANGLE]: {
3855
+ playerCamera: PlayerCamera;
3856
+ shoulderAngle: number;
3857
+ };
3832
3858
  /** Emitted when the tracked entity of the camera is set. */
3833
3859
  [PlayerCameraEvent.SET_TRACKED_ENTITY]: {
3834
3860
  playerCamera: PlayerCamera;
@@ -4631,10 +4657,15 @@ export declare class RigidBody extends EventRouter {
4631
4657
  createAndAddChildCollider(colliderOptions: ColliderOptions): Collider | null;
4632
4658
  /**
4633
4659
  * Creates and adds multiple child colliders to the rigid body for the simulation it belongs to.
4660
+ *
4661
+ * @remarks
4662
+ * If the rigid body is not simulated, the colliders will be added to the rigid body as pending child colliders
4663
+ * and also simulated when the rigid body is simulated.
4664
+ *
4634
4665
  * @param colliderOptions - The options for the child colliders to add to the rigid body.
4635
4666
  * @returns The child colliders that were added to the rigid body.
4636
4667
  */
4637
- createAndAddChildCollidersToSimulation(colliderOptions: ColliderOptions[]): Collider[];
4668
+ createAndAddChildColliders(colliderOptions: ColliderOptions[]): Collider[];
4638
4669
  /**
4639
4670
  * Gets the colliders of the rigid body by tag.
4640
4671
  * @param tag - The tag to filter by.
@@ -4990,6 +5021,13 @@ export declare class SimpleEntityController extends BaseEntityController {
4990
5021
 
4991
5022
 
4992
5023
 
5024
+
5025
+
5026
+
5027
+ /**
5028
+ * @param options - Options for the controller.
5029
+ */
5030
+ constructor(options?: SimpleEntityControllerOptions);
4993
5031
  /**
4994
5032
  * Override of the {@link BaseEntityController.spawn} method. Starts
4995
5033
  * the set idle animations (if any) when the entity is spawned.
@@ -5029,10 +5067,32 @@ export declare class SimpleEntityController extends BaseEntityController {
5029
5067
  * @param options - Additional options for the move operation, such as callbacks.
5030
5068
  */
5031
5069
  move(target: Vector3Like, speed: number, options?: MoveOptions): void;
5070
+ /**
5071
+ * Stops the entity from attempting to face a target coordinate.
5072
+ */
5073
+ stopFace(): void;
5074
+ /**
5075
+ * Stops the entity from continuing to move it's current target coordinate.
5076
+ */
5077
+ stopMove(): void;
5078
+
5032
5079
 
5033
5080
 
5034
5081
 
5082
+ }
5035
5083
 
5084
+ /** Options for creating a SimpleEntityController instance. @public */
5085
+ declare interface SimpleEntityControllerOptions {
5086
+ /** The animations to loop when the entity is idle. */
5087
+ idleLoopedAnimations?: string[];
5088
+ /** The speed at which to loop the idle animations. */
5089
+ idleLoopedAnimationsSpeed?: number;
5090
+ /** The animations to play when the entity jumps. */
5091
+ jumpOneshotAnimations?: string[];
5092
+ /** The animations to loop when the entity is moving. */
5093
+ moveLoopedAnimations?: string[];
5094
+ /** The speed at which to loop the move animations. */
5095
+ moveLoopedAnimationsSpeed?: number;
5036
5096
  }
5037
5097
 
5038
5098
  /**
@@ -5185,7 +5245,7 @@ export declare interface SpdMatrix3 extends SdpMatrix3 {
5185
5245
  export declare function startServer(init: ((() => void) | ((world: World) => void))): void;
5186
5246
 
5187
5247
  /** The input keys that are included in the PlayerInput. @public */
5188
- export declare const SUPPORTED_INPUT_KEYS: readonly ["w", "a", "s", "d", "sp", "sh", "tb", "ml", "mr", "q", "e", "r", "f", "z", "x", "c", "v", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
5248
+ 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"];
5189
5249
 
5190
5250
  /** The options for a trimesh collider. @public */
5191
5251
  export declare interface TrimeshColliderOptions extends BaseColliderOptions {