hytopia 0.1.60 → 0.1.61
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/boilerplate/assets/map.json +2 -1
- package/docs/server.blocktypeoptions.customcollideroptions.md +2 -0
- package/docs/server.blocktypeoptions.id.md +2 -0
- package/docs/server.blocktypeoptions.isliquid.md +2 -0
- package/docs/server.blocktypeoptions.md +8 -2
- package/docs/server.blocktypeoptions.name.md +2 -0
- package/docs/server.blocktypeoptions.textureuri.md +2 -0
- package/docs/server.collisiongroup.md +168 -0
- package/docs/server.entity.md +35 -0
- package/docs/server.entity.opacity.md +13 -0
- package/docs/server.entity.setopacity.md +53 -0
- package/docs/server.entityeventpayload.md +9 -0
- package/docs/server.entityeventpayload.setopacity.entity.md +11 -0
- package/docs/server.entityeventpayload.setopacity.md +70 -0
- package/docs/server.entityeventpayload.setopacity.opacity.md +11 -0
- package/docs/server.entityeventtype.md +14 -0
- package/docs/server.entityoptions.md +19 -0
- package/docs/server.entityoptions.opacity.md +13 -0
- package/docs/server.playerentitycontroller.md +19 -0
- package/docs/server.playerentitycontroller.stickstoplatforms.md +13 -0
- package/docs/server.playerentitycontrolleroptions.md +19 -0
- package/docs/server.playerentitycontrolleroptions.stickstoplatforms.md +13 -0
- package/examples/wall-dodge-game/assets/map.json +3995 -0
- package/examples/wall-dodge-game/assets/textures/water.png +0 -0
- package/examples/wall-dodge-game/assets/ui/index.html +249 -0
- package/examples/wall-dodge-game/index.ts +336 -0
- package/examples/wall-dodge-game/package.json +15 -0
- package/package.json +1 -1
- package/server.api.json +512 -5
- package/server.d.ts +48 -12
- package/server.js +71 -71
package/server.d.ts
CHANGED
@@ -489,10 +489,15 @@ export declare class BlockType implements protocol.Serializable {
|
|
489
489
|
|
490
490
|
/** Options for creating a block type instance. @public */
|
491
491
|
export declare interface BlockTypeOptions {
|
492
|
+
/** The unique numeric identifier for the block type. */
|
492
493
|
id: number;
|
494
|
+
/** The custom collider options for the block type. */
|
493
495
|
customColliderOptions?: ColliderOptions;
|
496
|
+
/** Whether the block type is a liquid. */
|
494
497
|
isLiquid?: boolean;
|
498
|
+
/** The name of the block type. */
|
495
499
|
name: string;
|
500
|
+
/** The URI of the texture asset for the block type. */
|
496
501
|
textureUri: string;
|
497
502
|
}
|
498
503
|
|
@@ -1100,6 +1105,18 @@ export declare enum CollisionGroup {
|
|
1100
1105
|
ENTITY = 2,
|
1101
1106
|
ENTITY_SENSOR = 4,
|
1102
1107
|
PLAYER = 8,
|
1108
|
+
GROUP_1 = 16,
|
1109
|
+
GROUP_2 = 32,
|
1110
|
+
GROUP_3 = 64,
|
1111
|
+
GROUP_4 = 128,
|
1112
|
+
GROUP_5 = 256,
|
1113
|
+
GROUP_6 = 512,
|
1114
|
+
GROUP_7 = 1024,
|
1115
|
+
GROUP_8 = 2048,
|
1116
|
+
GROUP_9 = 4096,
|
1117
|
+
GROUP_10 = 8192,
|
1118
|
+
GROUP_11 = 16384,
|
1119
|
+
GROUP_12 = 32768,
|
1103
1120
|
ALL = 65535
|
1104
1121
|
}
|
1105
1122
|
|
@@ -1312,6 +1329,7 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1312
1329
|
|
1313
1330
|
|
1314
1331
|
|
1332
|
+
|
1315
1333
|
/**
|
1316
1334
|
* @param options - The options for the entity.
|
1317
1335
|
*/
|
@@ -1336,6 +1354,8 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1336
1354
|
get modelUri(): string | undefined;
|
1337
1355
|
/** The name of the entity. */
|
1338
1356
|
get name(): string;
|
1357
|
+
/** The opacity of the entity between 0 and 1. 0 is fully transparent, 1 is fully opaque. */
|
1358
|
+
get opacity(): number | undefined;
|
1339
1359
|
/** An arbitrary identifier tag of the entity. Useful for your own logic. */
|
1340
1360
|
get tag(): string | undefined;
|
1341
1361
|
/** The tint color of the entity. */
|
@@ -1381,6 +1401,11 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1381
1401
|
* @param modelHiddenNodes - The nodes to hide on the entity's model.
|
1382
1402
|
*/
|
1383
1403
|
setModelHiddenNodes(modelHiddenNodes: string[]): void;
|
1404
|
+
/**
|
1405
|
+
* Sets the opacity of the entity.
|
1406
|
+
* @param opacity - The opacity of the entity between 0 and 1. 0 is fully transparent, 1 is fully opaque.
|
1407
|
+
*/
|
1408
|
+
setOpacity(opacity: number): void;
|
1384
1409
|
/**
|
1385
1410
|
* Sets the tint color of the entity.
|
1386
1411
|
* @param tintColor - The tint color of the entity.
|
@@ -1439,6 +1464,10 @@ export declare namespace EntityEventPayload {
|
|
1439
1464
|
entity: Entity;
|
1440
1465
|
modelHiddenNodes: Set<string>;
|
1441
1466
|
}
|
1467
|
+
export interface SetOpacity {
|
1468
|
+
entity: Entity;
|
1469
|
+
opacity: number;
|
1470
|
+
}
|
1442
1471
|
export interface SetTintColor {
|
1443
1472
|
entity: Entity;
|
1444
1473
|
tintColor: RgbColor | undefined;
|
@@ -1473,6 +1502,7 @@ export declare enum EntityEventType {
|
|
1473
1502
|
DESPAWN = "ENTITY.DESPAWN",
|
1474
1503
|
SET_MODEL_ANIMATIONS_PLAYBACK_RATE = "ENTITY.SET_MODEL_ANIMATIONS_PLAYBACK_RATE",
|
1475
1504
|
SET_MODEL_HIDDEN_NODES = "ENTITY.SET_MODEL_HIDDEN_NODES",
|
1505
|
+
SET_OPACITY = "ENTITY.SET_OPACITY",
|
1476
1506
|
SET_TINT_COLOR = "ENTITY.SET_TINT_COLOR",
|
1477
1507
|
SPAWN = "ENTITY.SPAWN",
|
1478
1508
|
START_MODEL_LOOPED_ANIMATIONS = "ENTITY.START_MODEL_LOOPED_ANIMATIONS",
|
@@ -1562,6 +1592,8 @@ export declare interface EntityOptions {
|
|
1562
1592
|
modelUri?: string;
|
1563
1593
|
/** The name of the entity. */
|
1564
1594
|
name?: string;
|
1595
|
+
/** The opacity of the entity between 0 and 1. 0 is fully transparent, 1 is fully opaque. */
|
1596
|
+
opacity?: number;
|
1565
1597
|
/** The rigid body options for the entity. */
|
1566
1598
|
rigidBodyOptions?: RigidBodyOptions;
|
1567
1599
|
/** An arbitrary identifier tag of the entity. Useful for your own logic. */
|
@@ -2100,12 +2132,6 @@ export declare class PlayerEntity extends Entity {
|
|
2100
2132
|
* @public
|
2101
2133
|
*/
|
2102
2134
|
export declare class PlayerEntityController extends BaseEntityController {
|
2103
|
-
/** The upward velocity applied to the entity when it jumps. */
|
2104
|
-
jumpVelocity: number;
|
2105
|
-
/** The normalized horizontal velocity applied to the entity when it runs. */
|
2106
|
-
runVelocity: number;
|
2107
|
-
/** The normalized horizontal velocity applied to the entity when it walks. */
|
2108
|
-
walkVelocity: number;
|
2109
2135
|
/**
|
2110
2136
|
* A function allowing custom logic to determine if the entity can walk.
|
2111
2137
|
* @param playerEntityController - The entity controller instance.
|
@@ -2124,6 +2150,14 @@ export declare class PlayerEntityController extends BaseEntityController {
|
|
2124
2150
|
* @returns Whether the entity of the entity controller can jump.
|
2125
2151
|
*/
|
2126
2152
|
canJump: (playerEntityController: PlayerEntityController) => boolean;
|
2153
|
+
/** The upward velocity applied to the entity when it jumps. */
|
2154
|
+
jumpVelocity: number;
|
2155
|
+
/** The normalized horizontal velocity applied to the entity when it runs. */
|
2156
|
+
runVelocity: number;
|
2157
|
+
/** Whether the entity sticks to platforms. */
|
2158
|
+
sticksToPlatforms: boolean;
|
2159
|
+
/** The normalized horizontal velocity applied to the entity when it walks. */
|
2160
|
+
walkVelocity: number;
|
2127
2161
|
|
2128
2162
|
|
2129
2163
|
|
@@ -2163,18 +2197,20 @@ export declare class PlayerEntityController extends BaseEntityController {
|
|
2163
2197
|
|
2164
2198
|
/** Options for creating a PlayerEntityController instance. @public */
|
2165
2199
|
export declare interface PlayerEntityControllerOptions {
|
2166
|
-
/** The upward velocity applied to the entity when it jumps. */
|
2167
|
-
jumpVelocity?: number;
|
2168
|
-
/** The normalized horizontal velocity applied to the entity when it runs. */
|
2169
|
-
runVelocity?: number;
|
2170
|
-
/** The normalized horizontal velocity applied to the entity when it walks. */
|
2171
|
-
walkVelocity?: number;
|
2172
2200
|
/** A function allowing custom logic to determine if the entity can jump. */
|
2173
2201
|
canJump?: () => boolean;
|
2174
2202
|
/** A function allowing custom logic to determine if the entity can walk. */
|
2175
2203
|
canWalk?: () => boolean;
|
2176
2204
|
/** A function allowing custom logic to determine if the entity can run. */
|
2177
2205
|
canRun?: () => boolean;
|
2206
|
+
/** The upward velocity applied to the entity when it jumps. */
|
2207
|
+
jumpVelocity?: number;
|
2208
|
+
/** The normalized horizontal velocity applied to the entity when it runs. */
|
2209
|
+
runVelocity?: number;
|
2210
|
+
/** Whether the entity sticks to platforms, defaults to true. */
|
2211
|
+
sticksToPlatforms?: boolean;
|
2212
|
+
/** The normalized horizontal velocity applied to the entity when it walks. */
|
2213
|
+
walkVelocity?: number;
|
2178
2214
|
}
|
2179
2215
|
|
2180
2216
|
/** Options for creating a PlayerEntity instance. @public */
|