sapdon 3.3.3 → 3.5.0
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/README.md +17 -7
- package/doc/dev/architecture.md +418 -415
- package/doc/dev/cli.md +467 -467
- package/doc/dev/core.md +750 -717
- package/doc/dev/lr-paradigm.md +85 -0
- package/doc/dev/ui-architecture.md +274 -0
- package/doc/dev/ui-lessons.md +147 -0
- package/doc/dev/workflow.md +257 -0
- package/doc/guidebook.md +294 -0
- package/doc/hello_sapdon/hello_sapdon.md +3 -3
- package/doc/user/api/block.md +599 -14
- package/doc/user/api/item.md +284 -55
- package/doc/user/api/neo-guidebook.md +409 -0
- package/doc/user/api/sapdon-ui.md +189 -0
- package/doc/user/config/build-config.md +4 -5
- package/doc/user/quick-start.md +20 -6
- package/doc/user/tutorials/block.md +12 -1
- package/doc/user/tutorials/item.md +3 -3
- package/doc/user/tutorials/neo-guidebook-experience.md +381 -0
- package/doc/user/tutorials/neo-guidebook.md +640 -0
- package/doc/user/tutorials/sapdon-ui.md +204 -0
- package/package.json +5 -1
- package/prod/cli/index.js +1 -1
- package/prod/cli/start.js +1 -1
- package/prod/core/index.d.ts +2339 -937
- package/prod/core/index.js +1 -1
- package/prod/oc/index.d.ts +3 -1
- package/prod/oc/index.js +1 -1
- package/prod/utils/index.d.ts +0 -7
- package/prod/utils/index.js +1 -1
package/prod/core/index.d.ts
CHANGED
|
@@ -248,7 +248,7 @@ declare class AddonAttachable {
|
|
|
248
248
|
format_version: string;
|
|
249
249
|
definitions: AddonAttachableDefinition;
|
|
250
250
|
constructor(format_version: string, definitions: AddonAttachableDefinition);
|
|
251
|
-
toObject(): Record<string,
|
|
251
|
+
toObject(): Record<string, unknown>;
|
|
252
252
|
}
|
|
253
253
|
declare class AddonAttachableDefinition {
|
|
254
254
|
description: AddonAttachableDescription;
|
|
@@ -262,8 +262,8 @@ declare class AddonAttachableDescription {
|
|
|
262
262
|
animations?: Record<string, string>;
|
|
263
263
|
animation_controllers?: Record<string, string>[];
|
|
264
264
|
render_controllers?: string[];
|
|
265
|
-
locators?: Record<string,
|
|
266
|
-
scripts?: Record<string,
|
|
265
|
+
locators?: Record<string, unknown>;
|
|
266
|
+
scripts?: Record<string, unknown>;
|
|
267
267
|
constructor(identifier: string);
|
|
268
268
|
addMaterial(name: string, material: string): this;
|
|
269
269
|
addTexture(name: string, texture: string): this;
|
|
@@ -271,25 +271,25 @@ declare class AddonAttachableDescription {
|
|
|
271
271
|
addAnimation(name: string, animation: string): this;
|
|
272
272
|
addAnimationController(name: string, controller: string): this;
|
|
273
273
|
addRenderController(controller: string): this;
|
|
274
|
-
addLocator(name: string, locator:
|
|
275
|
-
setScript(key: string, value:
|
|
274
|
+
addLocator(name: string, locator: unknown): this;
|
|
275
|
+
setScript(key: string, value: unknown): this;
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
declare class AddonItem {
|
|
279
279
|
format_version: string;
|
|
280
280
|
definitions: AddonItemDefinition;
|
|
281
281
|
constructor(format_version: string, definitions: AddonItemDefinition);
|
|
282
|
-
toObject(): Record<string,
|
|
282
|
+
toObject(): Record<string, unknown>;
|
|
283
283
|
}
|
|
284
284
|
declare class AddonItemDefinition {
|
|
285
285
|
description: AddonItemDescription;
|
|
286
|
-
components: Record<string,
|
|
287
|
-
constructor(description: AddonItemDescription, components: Record<string,
|
|
286
|
+
components: Record<string, unknown>;
|
|
287
|
+
constructor(description: AddonItemDescription, components: Record<string, unknown>);
|
|
288
288
|
}
|
|
289
289
|
declare class AddonItemDescription {
|
|
290
290
|
identifier: string;
|
|
291
|
-
menu_category:
|
|
292
|
-
constructor(identifier: string, menu_category:
|
|
291
|
+
menu_category: AddonMenuCategory;
|
|
292
|
+
constructor(identifier: string, menu_category: AddonMenuCategory);
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
declare class AddonRecipe {
|
|
@@ -455,9 +455,9 @@ declare class BasicBlock {
|
|
|
455
455
|
/**
|
|
456
456
|
* 添加方块变体
|
|
457
457
|
* @param {string} condition 变体条件
|
|
458
|
-
* @param {Map}
|
|
458
|
+
* @param {Map|Object} component 组件 Map 或普通对象
|
|
459
459
|
*/
|
|
460
|
-
addPermutation(condition: string,
|
|
460
|
+
addPermutation(condition: string, component: Map<any, any> | Object): this;
|
|
461
461
|
/**
|
|
462
462
|
* 将方块对象转换为 JSON 格式
|
|
463
463
|
* @returns {Object} JSON 格式的方块对象
|
|
@@ -497,38 +497,37 @@ declare class Block extends BasicBlock {
|
|
|
497
497
|
#private;
|
|
498
498
|
}
|
|
499
499
|
|
|
500
|
-
|
|
500
|
+
/** @template T */
|
|
501
|
+
declare class BlockComponent<T> {
|
|
501
502
|
/**
|
|
502
|
-
*
|
|
503
|
-
* @param {string}
|
|
504
|
-
* @param {
|
|
505
|
-
* @
|
|
503
|
+
* @param {string} texture - 纹理短名
|
|
504
|
+
* @param {Object|string} [options] - 可选参数对象,或旧版 tint_method 字符串
|
|
505
|
+
* @param {number} [options.particle_count] - 粒子数量 (0-255,默认 100)
|
|
506
|
+
* @param {string} [options.tint_method] - 染色方法(如 "grass")
|
|
507
|
+
* @returns {Map<string, any>}
|
|
506
508
|
*/
|
|
507
|
-
static setDestructionParticles(texture: string,
|
|
508
|
-
texture: string;
|
|
509
|
-
tint_method: string | null;
|
|
510
|
-
}>;
|
|
509
|
+
static setDestructionParticles(texture: string, options?: Object | string): Map<string, any>;
|
|
511
510
|
/**
|
|
512
511
|
* 自定义方块组件
|
|
513
512
|
* [warning] 需要 Scripting V2.0.0
|
|
514
513
|
* @param {string} component_id 组件标识符
|
|
515
514
|
* @param {object} params 自定义参数接口对象
|
|
516
|
-
* @returns {Map} 物品组件Map
|
|
515
|
+
* @returns {Map<string, any>} 物品组件Map
|
|
517
516
|
*/
|
|
518
|
-
static setCustomComponentV2(component_id: string, params: object): Map<
|
|
517
|
+
static setCustomComponentV2(component_id: string, params: object): Map<string, any>;
|
|
519
518
|
/**
|
|
520
519
|
*
|
|
521
520
|
* @param {Array} interval_range
|
|
522
521
|
* @param {boolean} looping
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
static setTick(interval_range: any[], looping: boolean): Map<
|
|
522
|
+
* @returns {Map<string, any>}
|
|
523
|
+
*/
|
|
524
|
+
static setTick(interval_range: any[], looping: boolean): Map<string, any>;
|
|
526
525
|
/**
|
|
527
526
|
*
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
static setCustomComponents(custom_components: any[]): Map<
|
|
527
|
+
* @param {Array} custom_components
|
|
528
|
+
* @returns {Map<string, any>}
|
|
529
|
+
*/
|
|
530
|
+
static setCustomComponents(custom_components: any[]): Map<string, any>;
|
|
532
531
|
/**
|
|
533
532
|
* 创建一个用于 Minecraft 方块的变换对象,并返回一个 Map。
|
|
534
533
|
* @param {number[]} [translation=[0, 0, 0]] - 平移向量 [x, y, z]。
|
|
@@ -536,177 +535,299 @@ declare class BlockComponent {
|
|
|
536
535
|
* @param {number[]} [scale_pivot=[0, 0, 0]] - 缩放的枢轴点 [x, y, z]。
|
|
537
536
|
* @param {number[]} [rotation=[0, 0, 0]] - 旋转向量(角度)[x, y, z]。
|
|
538
537
|
* @param {number[]} [rotation_pivot=[0, 0, 0]] - 旋转的枢轴点 [x, y, z]。
|
|
539
|
-
* @returns {Map} - 一个包含变换数据的 Map 对象。
|
|
538
|
+
* @returns {Map<string, any>} - 一个包含变换数据的 Map 对象。
|
|
540
539
|
* @throws {Error} - 如果任何参数无效,则抛出错误。
|
|
541
540
|
*/
|
|
542
|
-
static setTransformation(translation?: number[], scale?: number[], scale_pivot?: number[], rotation?: number[], rotation_pivot?: number[]): Map<
|
|
541
|
+
static setTransformation(translation?: number[], scale?: number[], scale_pivot?: number[], rotation?: number[], rotation_pivot?: number[]): Map<string, any>;
|
|
543
542
|
/**
|
|
544
543
|
* 设置方块的呼吸行为。
|
|
545
544
|
* @param {String} value - 呼吸行为,可选值为 "solid" 或 "air"。
|
|
546
|
-
* @returns {Map} - 新的组件集合。
|
|
545
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
547
546
|
*/
|
|
548
|
-
static setBreathability(value: string): Map<
|
|
547
|
+
static setBreathability(value: string): Map<string, any>;
|
|
549
548
|
/**
|
|
550
549
|
* 启用或禁用方块的碰撞箱。
|
|
551
550
|
* @param {Boolean} enabled - 是否启用碰撞箱。
|
|
552
|
-
* @returns {Map} - 新的组件集合。
|
|
551
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
553
552
|
*/
|
|
554
|
-
static setCollisionBoxEnabled(enabled: boolean): Map<
|
|
553
|
+
static setCollisionBoxEnabled(enabled: boolean): Map<string, any>;
|
|
555
554
|
/**
|
|
556
555
|
* 设置自定义的碰撞箱。
|
|
557
556
|
* @param {Array} origin - 碰撞箱的起点坐标 [x, y, z]。
|
|
558
557
|
* @param {Array} size - 碰撞箱的大小 [width, height, depth]。
|
|
559
|
-
* @returns {Map} - 新的组件集合。
|
|
558
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
560
559
|
*/
|
|
561
|
-
static setCollisionBoxCustom(origin: any[], size: any[]): Map<
|
|
560
|
+
static setCollisionBoxCustom(origin: any[], size: any[]): Map<string, any>;
|
|
562
561
|
/**
|
|
563
562
|
* 设置方块的合成台属性。
|
|
564
563
|
* @param {Array} craftingTags - 合成标签。
|
|
565
564
|
* @param {String} tableName - 合成台名称。
|
|
566
|
-
* @returns {Map} - 新的组件集合。
|
|
565
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
567
566
|
*/
|
|
568
|
-
static setCraftingTable(craftingTags: any[], tableName: string): Map<
|
|
567
|
+
static setCraftingTable(craftingTags: any[], tableName: string): Map<string, any>;
|
|
569
568
|
/**
|
|
570
569
|
* 启用或禁用方块的爆炸抗性。
|
|
571
570
|
* @param {Boolean} enabled - 是否启用爆炸抗性。
|
|
572
|
-
* @returns {Map} - 新的组件集合。
|
|
571
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
573
572
|
*/
|
|
574
|
-
static setDestructibleByExplosionEnabled(enabled: boolean): Map<
|
|
573
|
+
static setDestructibleByExplosionEnabled(enabled: boolean): Map<string, any>;
|
|
575
574
|
/**
|
|
576
575
|
* 设置自定义的爆炸抗性。
|
|
577
576
|
* @param {Number} explosionResistance - 爆炸抗性值。
|
|
578
|
-
* @returns {Map} - 新的组件集合。
|
|
577
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
579
578
|
*/
|
|
580
|
-
static setDestructibleByExplosionCustom(explosionResistance: number): Map<
|
|
579
|
+
static setDestructibleByExplosionCustom(explosionResistance: number): Map<string, any>;
|
|
581
580
|
/**
|
|
582
581
|
* 启用或禁用方块的挖掘抗性。
|
|
583
582
|
* @param {Boolean} enabled - 是否启用挖掘抗性。
|
|
584
|
-
* @returns {Map} - 新的组件集合。
|
|
583
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
585
584
|
*/
|
|
586
|
-
static setDestructibleByMiningEnabled(enabled: boolean): Map<
|
|
585
|
+
static setDestructibleByMiningEnabled(enabled: boolean): Map<string, any>;
|
|
587
586
|
/**
|
|
588
587
|
* 设置自定义的挖掘抗性。
|
|
589
588
|
* @param {Number} secondsToDestroy - 破坏所需时间(秒)。
|
|
590
589
|
* @param {Array} itemSpecificSpeeds - 特定工具的挖掘速度。
|
|
591
|
-
* @returns {Map} - 新的组件集合。
|
|
590
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
592
591
|
*/
|
|
593
|
-
static setDestructibleByMiningCustom(secondsToDestroy: number, itemSpecificSpeeds: any[]): Map<
|
|
592
|
+
static setDestructibleByMiningCustom(secondsToDestroy: number, itemSpecificSpeeds: any[]): Map<string, any>;
|
|
594
593
|
/**
|
|
595
594
|
* 设置方块的显示名称。
|
|
596
595
|
* @param {String} displayName - 显示名称。
|
|
597
|
-
* @returns {Map} - 新的组件集合。
|
|
596
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
598
597
|
*/
|
|
599
|
-
static setDisplayName(displayName: string): Map<
|
|
598
|
+
static setDisplayName(displayName: string): Map<string, any>;
|
|
600
599
|
/**
|
|
601
600
|
* 启用或禁用方块的易燃性。
|
|
602
601
|
* @param {Boolean} enabled - 是否启用易燃性。
|
|
603
|
-
* @returns {Map} - 新的组件集合。
|
|
602
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
604
603
|
*/
|
|
605
|
-
static setFlammableEnabled(enabled: boolean): Map<
|
|
604
|
+
static setFlammableEnabled(enabled: boolean): Map<string, any>;
|
|
606
605
|
/**
|
|
607
606
|
* 设置自定义的易燃性。
|
|
608
607
|
* @param {Number} catchChanceModifier - 着火概率。
|
|
609
608
|
* @param {Number} destroyChanceModifier - 被火焰摧毁的概率。
|
|
610
|
-
* @
|
|
609
|
+
* @param {String} [lava_flammable] - 岩浆能否点燃该方块 ("always"|"never",默认 "never")
|
|
610
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
611
611
|
*/
|
|
612
|
-
static setFlammableCustom(catchChanceModifier: number, destroyChanceModifier: number): Map<
|
|
612
|
+
static setFlammableCustom(catchChanceModifier: number, destroyChanceModifier: number, lava_flammable?: string): Map<string, any>;
|
|
613
613
|
/**
|
|
614
614
|
* 设置方块的摩擦力。
|
|
615
615
|
* @param {Number} value - 摩擦力值,范围为 0.0 到 0.9。
|
|
616
|
-
* @returns {Map} - 新的组件集合。
|
|
616
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
617
617
|
*/
|
|
618
|
-
static setFriction(value: number): Map<
|
|
618
|
+
static setFriction(value: number): Map<string, any>;
|
|
619
619
|
/**
|
|
620
620
|
* 设置方块的几何模型。
|
|
621
621
|
* @param {String} identifier - 几何模型标识符。
|
|
622
|
-
* @param {Object}
|
|
623
|
-
* @
|
|
624
|
-
|
|
625
|
-
|
|
622
|
+
* @param {Object} [options] - 可选参数。
|
|
623
|
+
* @param {Object} [options.bone_visibility] - 骨骼可见性配置。
|
|
624
|
+
* @param {String} [options.culling] - 裁剪规则标识符(格式: <namespace>:culling.<name>)。
|
|
625
|
+
* @param {String} [options.culling_layer] - 裁剪层标识符(如 "minecraft:culling_layer.leaves")。
|
|
626
|
+
* @param {String} [options.culling_shape] - 体素形状(仅支持 "minecraft:unit_cube")。
|
|
627
|
+
* @param {Boolean|String[]} [options.uv_lock] - 是否锁定 UV 旋转,或指定骨骼名称数组。
|
|
628
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
629
|
+
*/
|
|
630
|
+
static setGeometry(identifier: string, options?: {
|
|
631
|
+
bone_visibility?: Object | undefined;
|
|
632
|
+
culling?: string | undefined;
|
|
633
|
+
culling_layer?: string | undefined;
|
|
634
|
+
culling_shape?: string | undefined;
|
|
635
|
+
uv_lock?: boolean | string[] | undefined;
|
|
636
|
+
}): Map<string, any>;
|
|
626
637
|
/**
|
|
627
638
|
* 设置方块的骨骼可见性。
|
|
628
639
|
* @param {Object} bone_visibility - 骨骼可见性配置。
|
|
629
|
-
* @returns {Map} - 新的组件集合。
|
|
640
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
630
641
|
*/
|
|
631
|
-
static setBoneVisibility(bone_visibility: Object): Map<
|
|
642
|
+
static setBoneVisibility(bone_visibility: Object): Map<string, any>;
|
|
632
643
|
/**
|
|
633
644
|
* 设置方块的物品视觉属性。
|
|
634
645
|
* @param {String} geometry - 几何模型标识符。
|
|
635
646
|
* @param {Object} materialInstances - 材质实例配置。
|
|
636
|
-
* @returns {Map} - 新的组件集合。
|
|
647
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
637
648
|
*/
|
|
638
|
-
static setItemVisual(geometry: string, materialInstances: Object): Map<
|
|
649
|
+
static setItemVisual(geometry: string, materialInstances: Object): Map<string, any>;
|
|
639
650
|
/**
|
|
640
651
|
* 设置方块的光衰减值。
|
|
641
652
|
* @param {Number} value - 光的衰减值,范围为 0 到 15。
|
|
642
|
-
* @returns {Map} - 新的组件集合。
|
|
653
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
643
654
|
*/
|
|
644
|
-
static setLightDampening(value: number): Map<
|
|
655
|
+
static setLightDampening(value: number): Map<string, any>;
|
|
645
656
|
/**
|
|
646
657
|
* 设置方块的光照强度。
|
|
647
658
|
* @param {Number} value - 光照强度,范围为 0 到 15。
|
|
648
|
-
* @returns {Map} - 新的组件集合。
|
|
659
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
649
660
|
*/
|
|
650
|
-
static setLightEmission(value: number): Map<
|
|
661
|
+
static setLightEmission(value: number): Map<string, any>;
|
|
651
662
|
/**
|
|
652
663
|
* 设置方块的液体检测属性。
|
|
653
|
-
* @param {Boolean} canContainLiquid -
|
|
654
|
-
* @param {String} liquidType -
|
|
655
|
-
* @param {String} onLiquidTouches -
|
|
656
|
-
* @param {Array} stopsLiquidFlowingFromDirection -
|
|
657
|
-
* @returns {Map} - 新的组件集合。
|
|
664
|
+
* @param {Boolean|Object} canContainLiquid - 是否可容纳液体,或是完整选项对象
|
|
665
|
+
* @param {String} [liquidType] - 液体类型
|
|
666
|
+
* @param {String} [onLiquidTouches] - 对液体的反应方式
|
|
667
|
+
* @param {Array} [stopsLiquidFlowingFromDirection] - 阻止液体流动的方向
|
|
668
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
658
669
|
*/
|
|
659
|
-
static setLiquidDetection(canContainLiquid: boolean, liquidType
|
|
670
|
+
static setLiquidDetection(canContainLiquid: boolean | Object, liquidType?: string, onLiquidTouches?: string, stopsLiquidFlowingFromDirection?: any[]): Map<string, any>;
|
|
660
671
|
/**
|
|
661
672
|
* 设置方块的战利品表路径。
|
|
662
673
|
* @param {String} path - 战利品表路径。
|
|
663
|
-
* @returns {Map} - 新的组件集合。
|
|
674
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
664
675
|
*/
|
|
665
|
-
static setLoot(path: string): Map<
|
|
676
|
+
static setLoot(path: string): Map<string, any>;
|
|
666
677
|
/**
|
|
667
678
|
* 设置方块的地图颜色。
|
|
668
|
-
* @param {String|Array} value -
|
|
669
|
-
* @returns {Map} - 新的组件集合。
|
|
679
|
+
* @param {String|Array|Object} value - 地图颜色,可以是十六进制字符串、RGB 数组或对象格式。
|
|
680
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
670
681
|
*/
|
|
671
|
-
static setMapColor(value: string | any[]): Map<
|
|
682
|
+
static setMapColor(value: string | any[] | Object): Map<string, any>;
|
|
672
683
|
/**
|
|
673
684
|
* 设置方块的材质实例。
|
|
674
685
|
* @param {Object} instances - 材质实例配置。
|
|
675
|
-
* @returns {Map} - 新的组件集合。
|
|
686
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
676
687
|
*/
|
|
677
|
-
static setMaterialInstances(instances: Object): Map<
|
|
688
|
+
static setMaterialInstances(instances: Object): Map<string, any>;
|
|
678
689
|
/**
|
|
679
690
|
* 设置方块的放置过滤条件。
|
|
680
691
|
* @param {Array} conditions - 放置条件列表。
|
|
681
|
-
* @returns {Map} - 新的组件集合。
|
|
692
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
682
693
|
*/
|
|
683
|
-
static setPlacementFilter(conditions: any[]): Map<
|
|
694
|
+
static setPlacementFilter(conditions: any[]): Map<string, any>;
|
|
684
695
|
/**
|
|
685
696
|
* 设置方块的红石导电性。
|
|
686
697
|
* @param {Boolean} allowsWireToStepDown - 是否允许红石线向下阶梯连接。
|
|
687
698
|
* @param {Boolean} redstoneConductor - 方块是否可以被红石信号激活。
|
|
688
|
-
* @returns {Map} - 新的组件集合。
|
|
699
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
689
700
|
*/
|
|
690
|
-
static setRedstoneConductivity(allowsWireToStepDown: boolean, redstoneConductor: boolean): Map<
|
|
701
|
+
static setRedstoneConductivity(allowsWireToStepDown: boolean, redstoneConductor: boolean): Map<string, any>;
|
|
691
702
|
/**
|
|
692
703
|
* 启用或禁用方块的选择框。
|
|
693
704
|
* @param {Boolean} enabled - 是否启用选择框。
|
|
694
|
-
* @returns {Map} - 新的组件集合。
|
|
705
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
695
706
|
*/
|
|
696
|
-
static setSelectionBoxEnabled(enabled: boolean): Map<
|
|
707
|
+
static setSelectionBoxEnabled(enabled: boolean): Map<string, any>;
|
|
697
708
|
/**
|
|
698
709
|
* 设置自定义的选择框。
|
|
699
710
|
* @param {Array} origin - 选择框的起点坐标 [x, y, z]。
|
|
700
711
|
* @param {Array} size - 选择框的大小 [width, height, depth]。
|
|
701
|
-
* @returns {Map} - 新的组件集合。
|
|
712
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
713
|
+
*/
|
|
714
|
+
static setSelectionBoxCustom(origin: any[], size: any[]): Map<string, any>;
|
|
715
|
+
/**
|
|
716
|
+
* 设置方块实体(Block Entity,实验性功能,需开启 Upcoming Creator Features)。
|
|
717
|
+
* @param {Boolean} [dynamic_properties=false] - 是否启用动态属性存储。
|
|
718
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
719
|
+
*/
|
|
720
|
+
static setBlockEntity(dynamic_properties?: boolean): Map<string, any>;
|
|
721
|
+
/**
|
|
722
|
+
* 设置方块的活塞移动行为。
|
|
723
|
+
* @param {String} movement_type - 移动类型: "immovable" | "popped" | "push" | "push_pull"。
|
|
724
|
+
* @param {String} [sticky] - 黏性行为: "same" 可复制黏液块/蜂蜜块功能。
|
|
725
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
726
|
+
*/
|
|
727
|
+
static setMovable(movement_type: string, sticky?: string): Map<string, any>;
|
|
728
|
+
/**
|
|
729
|
+
* 设置方块的监听红石信号行为(配合自定义组件 onRedstoneUpdate 使用)。
|
|
730
|
+
* @param {Number} min_power - 最小触发红石信号强度 (0-15)。
|
|
731
|
+
* @param {Boolean} [propagates_power] - 是否传导红石信号。
|
|
732
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
733
|
+
*/
|
|
734
|
+
static setRedstoneConsumer(min_power: number, propagates_power?: boolean): Map<string, any>;
|
|
735
|
+
/**
|
|
736
|
+
* 设置方块产生红石信号。
|
|
737
|
+
* @param {Number} power - 信号强度 (0-15)。
|
|
738
|
+
* @param {String} strongly_powered_face - 强充能方向: "up" | "down" | "north" | "south" | "east" | "west"。
|
|
739
|
+
* @param {String[]} [connected_faces] - 连接的方向数组。
|
|
740
|
+
* @param {Boolean} [transform_relative] - 面方向是否相对于变换组件的旋转。
|
|
741
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
742
|
+
*/
|
|
743
|
+
static setRedstoneProducer(power: number, strongly_powered_face: string, connected_faces?: string[], transform_relative?: boolean): Map<string, any>;
|
|
744
|
+
/**
|
|
745
|
+
* 设置方块可被替换(放置其他方块时替换此方块)。
|
|
746
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
747
|
+
*/
|
|
748
|
+
static setReplaceable(): Map<string, any>;
|
|
749
|
+
/**
|
|
750
|
+
* 设置方块的支撑形状。
|
|
751
|
+
* @param {String} shape - 支撑形状: "fence" | "stair"。
|
|
752
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
753
|
+
*/
|
|
754
|
+
static setSupport(shape: string): Map<string, any>;
|
|
755
|
+
/**
|
|
756
|
+
* 设置方块标签。
|
|
757
|
+
* @param {String[]} tags - 标签数组。
|
|
758
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
702
759
|
*/
|
|
703
|
-
static
|
|
760
|
+
static setTags(tags: string[]): Map<string, any>;
|
|
761
|
+
/**
|
|
762
|
+
* 设置方块可被拴绳拴住(类似栅栏)。
|
|
763
|
+
* @param {Number[]} [offset=[0, 12, 0]] - 拴绳结位置偏移 [x, y, z]。
|
|
764
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
765
|
+
*/
|
|
766
|
+
static setLeashable(offset?: number[]): Map<string, any>;
|
|
767
|
+
/**
|
|
768
|
+
* 设置方块对实体坠落事件的触发。
|
|
769
|
+
* @param {Number} min_fall_distance - 最小坠落距离(方块数)。
|
|
770
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
771
|
+
*/
|
|
772
|
+
static setEntityFallOn(min_fall_distance: number): Map<string, any>;
|
|
773
|
+
/**
|
|
774
|
+
* 设置方块可放入花盆(配合 setEmbeddedVisual 使用)。
|
|
775
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
776
|
+
*/
|
|
777
|
+
static setFlowerPottable(): Map<string, any>;
|
|
778
|
+
/**
|
|
779
|
+
* 设置方块与降水(雨/雪)的交互行为。
|
|
780
|
+
* @param {String} behavior - 降水行为: "obstruct_rain_accumulate_snow" | "obstruct_rain" | "snowlogging" | "none"。
|
|
781
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
782
|
+
*/
|
|
783
|
+
static setPrecipitationInteractions(behavior: string): Map<string, any>;
|
|
784
|
+
/**
|
|
785
|
+
* 设置方块的随机偏移(碰撞箱/选择框/几何)。
|
|
786
|
+
* @param {Object} axis_config - 每个轴的偏移配置。
|
|
787
|
+
* @param {Object} [axis_config.x] - X 轴配置。
|
|
788
|
+
* @param {Object} [axis_config.y] - Y 轴配置。
|
|
789
|
+
* @param {Object} [axis_config.z] - Z 轴配置。
|
|
790
|
+
* @param {Object} axis_config.x.range - 范围 {min, max}。
|
|
791
|
+
* @param {Number} [axis_config.x.steps=0] - 步数(0=任意值)。
|
|
792
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
793
|
+
*/
|
|
794
|
+
static setRandomOffset(axis_config: {
|
|
795
|
+
x?: Object | undefined;
|
|
796
|
+
y?: Object | undefined;
|
|
797
|
+
z?: Object | undefined;
|
|
798
|
+
}): Map<string, any>;
|
|
799
|
+
/**
|
|
800
|
+
* 设置方块对箱子开启的遮挡行为。
|
|
801
|
+
* @param {String} rule - 遮挡规则: "always" | "never" | "shape"。
|
|
802
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
803
|
+
*/
|
|
804
|
+
static setChestObstruction(rule: string): Map<string, any>;
|
|
805
|
+
/**
|
|
806
|
+
* 设置方块在花盆中的显示外观。
|
|
807
|
+
* @param {String|Object} geometry - 几何标识符或几何对象。
|
|
808
|
+
* @param {Object} material_instances - 材质实例。
|
|
809
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
810
|
+
*/
|
|
811
|
+
static setEmbeddedVisual(geometry: string | Object, material_instances: Object): Map<string, any>;
|
|
812
|
+
/**
|
|
813
|
+
* 设置方块与栅栏/墙等方块的连接规则。
|
|
814
|
+
* @param {String} [accepts_from="all"] - 连接来源: "all" | "only_fences" | "none"。
|
|
815
|
+
* @param {String[]} [enabled_directions] - 允许连接的方向数组。
|
|
816
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
817
|
+
*/
|
|
818
|
+
static setConnectionRule(accepts_from?: string, enabled_directions?: string[]): Map<string, any>;
|
|
819
|
+
/**
|
|
820
|
+
* 设置方块的声音。
|
|
821
|
+
* @param {String} sound - 声音名称。
|
|
822
|
+
* @returns {Map<string, any>} - 新的组件集合。
|
|
823
|
+
*/
|
|
824
|
+
static setSound(sound: string): Map<string, any>;
|
|
704
825
|
/**
|
|
705
826
|
* 将多个组件集合合并为一个。
|
|
706
827
|
* @param {...Map} componentMaps - 多个组件集合。
|
|
707
|
-
* @returns {Map} - 合并后的组件集合。
|
|
828
|
+
* @returns {Map<string, any>} - 合并后的组件集合。
|
|
708
829
|
*/
|
|
709
|
-
static combineComponents(...componentMaps: Map<any, any>[]): Map<
|
|
830
|
+
static combineComponents(...componentMaps: Map<any, any>[]): Map<string, any>;
|
|
710
831
|
/**
|
|
711
832
|
* 获取当前组件的 JSON 表示。
|
|
712
833
|
* @param {Map} components - 组件集合。
|
|
@@ -715,6 +836,144 @@ declare class BlockComponent {
|
|
|
715
836
|
static toJSON(components: Map<any, any>): Object;
|
|
716
837
|
}
|
|
717
838
|
|
|
839
|
+
interface BeforeOnPlayerPlaceEvent {
|
|
840
|
+
block: any;
|
|
841
|
+
cancel: boolean;
|
|
842
|
+
dimension: any;
|
|
843
|
+
face: string;
|
|
844
|
+
permutationToPlace: any;
|
|
845
|
+
player?: any;
|
|
846
|
+
}
|
|
847
|
+
interface OnBlockStateChangeEvent {
|
|
848
|
+
block: any;
|
|
849
|
+
dimension: any;
|
|
850
|
+
previousPermutation: any;
|
|
851
|
+
}
|
|
852
|
+
interface OnBreakEvent {
|
|
853
|
+
block: any;
|
|
854
|
+
dimension: any;
|
|
855
|
+
blockDestructionSource?: any;
|
|
856
|
+
brokenBlockPermutation: any;
|
|
857
|
+
entitySource?: any;
|
|
858
|
+
}
|
|
859
|
+
interface OnEntityEvent {
|
|
860
|
+
block: any;
|
|
861
|
+
blockPermutation: any;
|
|
862
|
+
dimension: any;
|
|
863
|
+
entitySource: any;
|
|
864
|
+
name: string;
|
|
865
|
+
}
|
|
866
|
+
interface OnEntityFallOnEvent {
|
|
867
|
+
block: any;
|
|
868
|
+
dimension: any;
|
|
869
|
+
entity?: any;
|
|
870
|
+
fallDistance: number;
|
|
871
|
+
}
|
|
872
|
+
interface OnPlaceEvent {
|
|
873
|
+
block: any;
|
|
874
|
+
dimension: any;
|
|
875
|
+
previousBlock: any;
|
|
876
|
+
}
|
|
877
|
+
interface OnPlayerBreakEvent {
|
|
878
|
+
block: any;
|
|
879
|
+
brokenBlockPermutation: any;
|
|
880
|
+
dimension: any;
|
|
881
|
+
player?: any;
|
|
882
|
+
}
|
|
883
|
+
interface OnPlayerInteractEvent {
|
|
884
|
+
block: any;
|
|
885
|
+
dimension: any;
|
|
886
|
+
face: string;
|
|
887
|
+
faceLocation: any;
|
|
888
|
+
player?: any;
|
|
889
|
+
}
|
|
890
|
+
interface OnRandomTickEvent {
|
|
891
|
+
block: any;
|
|
892
|
+
dimension: any;
|
|
893
|
+
}
|
|
894
|
+
interface OnRedstoneUpdateEvent {
|
|
895
|
+
block: any;
|
|
896
|
+
dimension: any;
|
|
897
|
+
power: number;
|
|
898
|
+
}
|
|
899
|
+
interface OnStepOffEvent {
|
|
900
|
+
block: any;
|
|
901
|
+
dimension: any;
|
|
902
|
+
entity?: any;
|
|
903
|
+
}
|
|
904
|
+
interface OnStepOnEvent {
|
|
905
|
+
block: any;
|
|
906
|
+
dimension: any;
|
|
907
|
+
entity?: any;
|
|
908
|
+
}
|
|
909
|
+
interface OnTickEvent {
|
|
910
|
+
block: any;
|
|
911
|
+
dimension: any;
|
|
912
|
+
}
|
|
913
|
+
interface BlockCustomComponentHandlers {
|
|
914
|
+
beforeOnPlayerPlace?: (event: BeforeOnPlayerPlaceEvent) => void;
|
|
915
|
+
onBlockStateChange?: (event: OnBlockStateChangeEvent) => void;
|
|
916
|
+
onBreak?: (event: OnBreakEvent) => void;
|
|
917
|
+
onEntity?: (event: OnEntityEvent) => void;
|
|
918
|
+
onEntityFallOn?: (event: OnEntityFallOnEvent) => void;
|
|
919
|
+
onPlace?: (event: OnPlaceEvent) => void;
|
|
920
|
+
onPlayerBreak?: (event: OnPlayerBreakEvent) => void;
|
|
921
|
+
onPlayerInteract?: (event: OnPlayerInteractEvent) => void;
|
|
922
|
+
onRandomTick?: (event: OnRandomTickEvent) => void;
|
|
923
|
+
onRedstoneUpdate?: (event: OnRedstoneUpdateEvent) => void;
|
|
924
|
+
onStepOff?: (event: OnStepOffEvent) => void;
|
|
925
|
+
onStepOn?: (event: OnStepOnEvent) => void;
|
|
926
|
+
onTick?: (event: OnTickEvent) => void;
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* 块自定义组件构建器 - 提供流式 API 定义块事件处理器,
|
|
930
|
+
* 并提供类型安全的事件参数绑定。
|
|
931
|
+
*
|
|
932
|
+
* @example
|
|
933
|
+
* ```ts
|
|
934
|
+
* const comp = new BlockCustomComponentBuilder('wiki:my_comp')
|
|
935
|
+
* .onTick() // 只声明事件类型,生成骨架代码
|
|
936
|
+
* .onPlayerInteract(({ player }) => { ... }) // 带完整 handler
|
|
937
|
+
*
|
|
938
|
+
* // 在 block JSON 中注册组件 ID
|
|
939
|
+
* block.addComponent(BlockComponent.setCustomComponents([comp.id()]))
|
|
940
|
+
* ```
|
|
941
|
+
*/
|
|
942
|
+
declare class BlockCustomComponentBuilder {
|
|
943
|
+
private static allInstances;
|
|
944
|
+
private componentId;
|
|
945
|
+
private handlers;
|
|
946
|
+
private declaredEvents;
|
|
947
|
+
constructor(componentId: string);
|
|
948
|
+
/** 返回所有已创建的构建器实例 */
|
|
949
|
+
static getAllInstances(): BlockCustomComponentBuilder[];
|
|
950
|
+
/** 重置实例列表(用于测试/热重载) */
|
|
951
|
+
static resetInstances(): void;
|
|
952
|
+
/** 返回组件标识符,用于 setCustomComponents */
|
|
953
|
+
id(): string;
|
|
954
|
+
/** 返回已声明(含 handler)的事件名称列表 */
|
|
955
|
+
declaredEventNames(): string[];
|
|
956
|
+
/** 返回已注册的事件处理器数量 */
|
|
957
|
+
handlerCount(): number;
|
|
958
|
+
beforeOnPlayerPlace(handler?: (event: BeforeOnPlayerPlaceEvent) => void): this;
|
|
959
|
+
onBlockStateChange(handler?: (event: OnBlockStateChangeEvent) => void): this;
|
|
960
|
+
onBreak(handler?: (event: OnBreakEvent) => void): this;
|
|
961
|
+
onEntity(handler?: (event: OnEntityEvent) => void): this;
|
|
962
|
+
onEntityFallOn(handler?: (event: OnEntityFallOnEvent) => void): this;
|
|
963
|
+
onPlace(handler?: (event: OnPlaceEvent) => void): this;
|
|
964
|
+
onPlayerBreak(handler?: (event: OnPlayerBreakEvent) => void): this;
|
|
965
|
+
onPlayerInteract(handler?: (event: OnPlayerInteractEvent) => void): this;
|
|
966
|
+
onRandomTick(handler?: (event: OnRandomTickEvent) => void): this;
|
|
967
|
+
onRedstoneUpdate(handler?: (event: OnRedstoneUpdateEvent) => void): this;
|
|
968
|
+
onStepOff(handler?: (event: OnStepOffEvent) => void): this;
|
|
969
|
+
onStepOn(handler?: (event: OnStepOnEvent) => void): this;
|
|
970
|
+
onTick(handler?: (event: OnTickEvent) => void): this;
|
|
971
|
+
/** 构建处理器对象,可用于 runtime 的 registerCustomComponent */
|
|
972
|
+
build(): BlockCustomComponentHandlers;
|
|
973
|
+
/** 生成 runtime 脚本模块源码 */
|
|
974
|
+
generateRuntimeCode(): string;
|
|
975
|
+
}
|
|
976
|
+
|
|
718
977
|
declare class CropBlock extends Block {
|
|
719
978
|
stageNum: number;
|
|
720
979
|
}
|
|
@@ -855,9 +1114,8 @@ declare class FeatureRule {
|
|
|
855
1114
|
toObject(): any;
|
|
856
1115
|
}
|
|
857
1116
|
|
|
858
|
-
declare class OreBlock {
|
|
1117
|
+
declare class OreBlock extends BasicBlock {
|
|
859
1118
|
constructor(identifier: any, category: any, textures_arr: any, options?: {});
|
|
860
|
-
block: BasicBlock;
|
|
861
1119
|
feature: OreFeature;
|
|
862
1120
|
feature_rules: FeatureRule;
|
|
863
1121
|
}
|
|
@@ -878,7 +1136,7 @@ declare class RotatableBlock extends BasicBlock {
|
|
|
878
1136
|
* @param {string} options.group 分组,默认为 "construction"
|
|
879
1137
|
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
880
1138
|
* @param {string} options.rotationType 旋转类型,默认为 "cardinal"
|
|
881
|
-
* @param {number} options.yRotationOffset 初始旋转偏移量,默认为
|
|
1139
|
+
* @param {number} options.yRotationOffset 初始旋转偏移量,默认为 0
|
|
882
1140
|
*/
|
|
883
1141
|
constructor(identifier: string, category: string, textures_arr: any[], options?: {
|
|
884
1142
|
group: string;
|
|
@@ -1060,6 +1318,71 @@ declare class TileBlock {
|
|
|
1060
1318
|
setScript(key: any, value: any): void;
|
|
1061
1319
|
}
|
|
1062
1320
|
|
|
1321
|
+
declare class GlassBlock extends BasicBlock {
|
|
1322
|
+
constructor(identifier: any, category: any, texture: any, options?: {});
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
declare class HeadBlock extends BasicBlock {
|
|
1326
|
+
constructor(identifier: any, category: any, texture: any, options?: {});
|
|
1327
|
+
#private;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
declare class FenceBlock extends BasicBlock {
|
|
1331
|
+
constructor(identifier: any, category: any, textures_arr: any, options?: {});
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
declare class StairBlock extends BasicBlock {
|
|
1335
|
+
constructor(identifier: any, category: any, textures_arr: any, options?: {});
|
|
1336
|
+
#private;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
declare class TrapdoorBlock extends BasicBlock {
|
|
1340
|
+
constructor(identifier: any, category: any, texture: any, options?: {});
|
|
1341
|
+
#private;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
declare const TintMethod: {
|
|
1345
|
+
readonly GRASS: "grass";
|
|
1346
|
+
readonly WATER: "water";
|
|
1347
|
+
readonly DEFAULT_FOLIAGE: "default_foliage";
|
|
1348
|
+
readonly EVERGREEN_FOLIAGE: "evergreen_foliage";
|
|
1349
|
+
readonly DRY_FOLIAGE: "dry_foliage";
|
|
1350
|
+
readonly BIRCH_FOLIAGE: "birch_foliage";
|
|
1351
|
+
};
|
|
1352
|
+
type TintMethod = (typeof TintMethod)[keyof typeof TintMethod];
|
|
1353
|
+
|
|
1354
|
+
interface FlipbookEntry {
|
|
1355
|
+
flipbook_texture: string;
|
|
1356
|
+
atlas_tile?: string;
|
|
1357
|
+
ticks_per_frame?: number;
|
|
1358
|
+
blend_frames?: boolean;
|
|
1359
|
+
replicate?: number;
|
|
1360
|
+
}
|
|
1361
|
+
declare class FlipbookTextureConfig {
|
|
1362
|
+
private entries;
|
|
1363
|
+
addEntry(entry: FlipbookEntry): this;
|
|
1364
|
+
addEntries(entries: FlipbookEntry[]): this;
|
|
1365
|
+
toObject(): {
|
|
1366
|
+
flipbook_textures: FlipbookEntry[];
|
|
1367
|
+
};
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
interface TextureVariation {
|
|
1371
|
+
path: string;
|
|
1372
|
+
weight?: number;
|
|
1373
|
+
}
|
|
1374
|
+
interface TextureEntry {
|
|
1375
|
+
textures: string | TextureVariation[];
|
|
1376
|
+
}
|
|
1377
|
+
declare class TextureVariationConfig {
|
|
1378
|
+
private textureData;
|
|
1379
|
+
addTexture(name: string, path: string): this;
|
|
1380
|
+
addTextureWithVariations(name: string, variations: TextureVariation[]): this;
|
|
1381
|
+
toObject(): {
|
|
1382
|
+
texture_data: Record<string, TextureEntry>;
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1063
1386
|
declare class DummyEntity extends Entity {
|
|
1064
1387
|
constructor(identifier: any, texture: any, options: {} | undefined, behData: any, resData: any);
|
|
1065
1388
|
}
|
|
@@ -1306,6 +1629,62 @@ declare class PickupItemsBehavior {
|
|
|
1306
1629
|
toObject(): Map<string, object>;
|
|
1307
1630
|
}
|
|
1308
1631
|
|
|
1632
|
+
declare class MoveTowardsHomeRestrictionBehavior {
|
|
1633
|
+
/**
|
|
1634
|
+
* 创建 minecraft:behavior.move_towards_home_restriction 组件。
|
|
1635
|
+
* @param {number} priority 行为的优先级
|
|
1636
|
+
*/
|
|
1637
|
+
constructor(priority: number);
|
|
1638
|
+
priority: number;
|
|
1639
|
+
speed_multiplier: number;
|
|
1640
|
+
/**
|
|
1641
|
+
* 设置移动速度倍数。
|
|
1642
|
+
* @param {number} speedMultiplier 移动速度倍数
|
|
1643
|
+
* @returns {MoveTowardsHomeRestrictionBehavior} 返回当前实例以支持链式调用
|
|
1644
|
+
*/
|
|
1645
|
+
setSpeedMultiplier(speedMultiplier: number): MoveTowardsHomeRestrictionBehavior;
|
|
1646
|
+
/**
|
|
1647
|
+
* 将组件转换为 JSON 对象。
|
|
1648
|
+
* @returns {Object} minecraft:behavior.move_towards_home_restriction 组件的 JSON 对象
|
|
1649
|
+
*/
|
|
1650
|
+
toObject(): Object;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
declare class GoHomeBehavior {
|
|
1654
|
+
/**
|
|
1655
|
+
* 创建 minecraft:behavior.go_home 组件。
|
|
1656
|
+
* @param {number} priority 行为的优先级
|
|
1657
|
+
*/
|
|
1658
|
+
constructor(priority: number);
|
|
1659
|
+
priority: number;
|
|
1660
|
+
speed_multiplier: number;
|
|
1661
|
+
goal_radius: number;
|
|
1662
|
+
interval: number;
|
|
1663
|
+
/**
|
|
1664
|
+
* 设置移动速度倍数。
|
|
1665
|
+
* @param {number} speedMultiplier 移动速度倍数
|
|
1666
|
+
* @returns {GoHomeBehavior} 返回当前实例以支持链式调用
|
|
1667
|
+
*/
|
|
1668
|
+
setSpeedMultiplier(speedMultiplier: number): GoHomeBehavior;
|
|
1669
|
+
/**
|
|
1670
|
+
* 设置回家目标判定半径。
|
|
1671
|
+
* @param {number} goalRadius 判定半径(方块格)
|
|
1672
|
+
* @returns {GoHomeBehavior} 返回当前实例以支持链式调用
|
|
1673
|
+
*/
|
|
1674
|
+
setGoalRadius(goalRadius: number): GoHomeBehavior;
|
|
1675
|
+
/**
|
|
1676
|
+
* 设置回家行为执行的间隔时间(游戏刻)。
|
|
1677
|
+
* @param {number} interval 间隔时间(游戏刻)
|
|
1678
|
+
* @returns {GoHomeBehavior} 返回当前实例以支持链式调用
|
|
1679
|
+
*/
|
|
1680
|
+
setInterval(interval: number): GoHomeBehavior;
|
|
1681
|
+
/**
|
|
1682
|
+
* 将组件转换为 JSON 对象。
|
|
1683
|
+
* @returns {Object} minecraft:behavior.go_home 组件的 JSON 对象
|
|
1684
|
+
*/
|
|
1685
|
+
toObject(): Object;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1309
1688
|
declare class BasicBundle {
|
|
1310
1689
|
/**
|
|
1311
1690
|
* 添加组件到捆绑包
|
|
@@ -1807,6 +2186,53 @@ declare class EntityComponent {
|
|
|
1807
2186
|
uncertaintyBase: number;
|
|
1808
2187
|
uncertaintyMultiplier: number;
|
|
1809
2188
|
}): Map<any, any>;
|
|
2189
|
+
/**
|
|
2190
|
+
* 设置实体的家(工作站点)组件,用于限制实体的活动范围。
|
|
2191
|
+
* @param {Object} [options] - 配置选项
|
|
2192
|
+
* @param {number} [options.restriction_radius=16] - 限制半径(方块格)
|
|
2193
|
+
* @param {string[]} [options.home_block_list=["minecraft:chest"]] - 可绑定为家的方块列表
|
|
2194
|
+
* @param {string} [options.restriction_type] - 限制类型(可选,如 "limited"),需 format_version >= 1.21.40
|
|
2195
|
+
* @returns {Map} 返回 Minecraft home 组件
|
|
2196
|
+
*
|
|
2197
|
+
* @example // 基础用法 - 16格半径,箱子作为家
|
|
2198
|
+
* const home = EntityComponent.setHome();
|
|
2199
|
+
*
|
|
2200
|
+
* @example // 自定义配置
|
|
2201
|
+
* const customHome = EntityComponent.setHome({
|
|
2202
|
+
* restriction_radius: 32,
|
|
2203
|
+
* home_block_list: ["minecraft:chest", "minecraft:barrel"],
|
|
2204
|
+
* restriction_type: "limited"
|
|
2205
|
+
* });
|
|
2206
|
+
*/
|
|
2207
|
+
static setHome({ restriction_radius, home_block_list, restriction_type }?: {
|
|
2208
|
+
restriction_radius?: number | undefined;
|
|
2209
|
+
home_block_list?: string[] | undefined;
|
|
2210
|
+
restriction_type?: string | undefined;
|
|
2211
|
+
}): Map<any, any>;
|
|
2212
|
+
/**
|
|
2213
|
+
* 设置可分享物品列表(该实体感兴趣并会主动拾取的物品)
|
|
2214
|
+
* 与 minecraft:behavior.pickup_items 配合使用
|
|
2215
|
+
* @param {Object} [options] - 配置选项
|
|
2216
|
+
* @param {Array<Object>} [options.items=[]] - 物品条目列表
|
|
2217
|
+
* @param {string} options.items[].item - 物品ID
|
|
2218
|
+
* @param {number} [options.items[].want_amount] - 想要保留的数量
|
|
2219
|
+
* @param {number} [options.items[].surplus_amount] - 溢出阈值(超出此数量可分享给玩家)
|
|
2220
|
+
* @param {number} [options.items[].priority] - 优先级(数值越小优先级越高)
|
|
2221
|
+
* @param {number} [options.items[].max_amount] - 最大持有数
|
|
2222
|
+
* @param {number} [options.items[].pickup_limit] - 单次拾取数限制
|
|
2223
|
+
* @param {boolean} [options.items[].pickup_only] - 是否只拾取不分享
|
|
2224
|
+
* @param {boolean} [options.items[].stored_in_inventory] - 是否存入库存
|
|
2225
|
+
* @param {boolean} [options.items[].consume_item] - 是否消耗物品
|
|
2226
|
+
* @param {Object} [options.items[].admire] - 欣赏物品行为
|
|
2227
|
+
* @param {Object} [options.items[].barter] - 以物易物配置
|
|
2228
|
+
* @param {Object} [options.items[].craft_into] - 合成转换配置
|
|
2229
|
+
* @param {boolean} [options.all_items=false] - 是否接受任意物品
|
|
2230
|
+
* @param {boolean} [options.singular_pickup=false] - 是否一次只拾取一个
|
|
2231
|
+
* @returns {Map} 返回 Minecraft shareables 组件
|
|
2232
|
+
*/
|
|
2233
|
+
static setShareables({ items, all_items, singular_pickup }?: {
|
|
2234
|
+
items?: Object[] | undefined;
|
|
2235
|
+
}): Map<any, any>;
|
|
1810
2236
|
}
|
|
1811
2237
|
|
|
1812
2238
|
type BehaviorLiterals = 'beh' | 'behavior' | 'behaviour';
|
|
@@ -1866,13 +2292,18 @@ declare namespace BlockAPI {
|
|
|
1866
2292
|
}): RotatableBlock;
|
|
1867
2293
|
function createGeometryBlock(identifier: any, category: any, geometry: any, material_instances: any, options?: {}): GeometryBlock;
|
|
1868
2294
|
function createOreBlock(identifier: any, category: any, textures_arr: any, options?: {}): OreBlock;
|
|
1869
|
-
function
|
|
2295
|
+
function createHeadBlock(identifier: string, category: string, texture: any, options?: {
|
|
1870
2296
|
group: string;
|
|
1871
2297
|
hide_in_command: boolean;
|
|
1872
2298
|
ambient_occlusion: boolean;
|
|
1873
2299
|
face_dimming: boolean;
|
|
1874
2300
|
render_method: string;
|
|
1875
2301
|
}): CropBlock;
|
|
2302
|
+
function createGlassBlock(identifier: any, category: any, texture: any, options?: {}): GlassBlock;
|
|
2303
|
+
function createFenceBlock(identifier: any, category: any, textures_arr: any, options?: {}): FenceBlock;
|
|
2304
|
+
function createStairBlock(identifier: any, category: any, textures_arr: any, options?: {}): StairBlock;
|
|
2305
|
+
function createTrapdoorBlock(identifier: any, category: any, texture: any, options?: {}): TrapdoorBlock;
|
|
2306
|
+
function createCropBlock(identifier: any, category: any, variantDatas: any, options?: {}): CropBlock;
|
|
1876
2307
|
}
|
|
1877
2308
|
|
|
1878
2309
|
declare function registerEntity(behData: any, resData: any): void;
|
|
@@ -1900,6 +2331,10 @@ declare namespace FeatureAPI {
|
|
|
1900
2331
|
function createFeatureRules(identifier: any, places_feature: any): FeatureRule;
|
|
1901
2332
|
}
|
|
1902
2333
|
|
|
2334
|
+
/**
|
|
2335
|
+
* 物品菜单栏分类枚举
|
|
2336
|
+
* 用于 Item / Food / FlipbookItem 及 ItemAPI 的 category 参数
|
|
2337
|
+
*/
|
|
1903
2338
|
declare enum ItemCategory {
|
|
1904
2339
|
Commands = "commands",
|
|
1905
2340
|
Construction = "construction",
|
|
@@ -1908,179 +2343,621 @@ declare enum ItemCategory {
|
|
|
1908
2343
|
Items = "items",
|
|
1909
2344
|
None = "none"
|
|
1910
2345
|
}
|
|
1911
|
-
|
|
1912
|
-
|
|
2346
|
+
/**
|
|
2347
|
+
* 物品组件 Map:以 Minecraft 组件名为 key
|
|
2348
|
+
*/
|
|
2349
|
+
type ItemComponentMap = Map<string, unknown>;
|
|
2350
|
+
/**
|
|
2351
|
+
* 物品选项
|
|
2352
|
+
* snake_case(对应 Minecraft JSON 字段)与 camelCase 互为别名,camelCase 优先
|
|
2353
|
+
*/
|
|
2354
|
+
interface ItemOptions {
|
|
2355
|
+
group?: string;
|
|
2356
|
+
hide_in_command?: boolean;
|
|
2357
|
+
hideInCommand?: boolean;
|
|
2358
|
+
max_stack_size?: number;
|
|
2359
|
+
maxStackSize?: number;
|
|
2360
|
+
format_version?: string;
|
|
2361
|
+
formatVersion?: string;
|
|
1913
2362
|
/**
|
|
1914
|
-
*
|
|
1915
|
-
* @param {string} identifier 物品唯一标识符
|
|
1916
|
-
* @param {string} category 菜单栏分类 可选:"construction", "nature", "equipment", "items", and "none"
|
|
1917
|
-
* @param {string} texture 物品纹理
|
|
1918
|
-
* @param {Object?} options 可选参数
|
|
1919
|
-
* @param {string|undefined} options.group 分组
|
|
1920
|
-
* @param {boolean|undefined} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
2363
|
+
* 图标纹理名称;传 null 表示不添加 minecraft:icon 组件
|
|
1921
2364
|
*/
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
2365
|
+
icon?: string | null;
|
|
2366
|
+
displayName?: string;
|
|
2367
|
+
}
|
|
2368
|
+
/**
|
|
2369
|
+
* 3D 手持物品骨骼变换(动画中的 position/rotation/scale)
|
|
2370
|
+
*/
|
|
2371
|
+
interface ModelBoneTransform {
|
|
2372
|
+
position?: [number, number, number];
|
|
2373
|
+
rotation?: [number, number, number];
|
|
2374
|
+
scale?: number | [number, number, number];
|
|
2375
|
+
}
|
|
2376
|
+
/**
|
|
2377
|
+
* 3D 手持物品选项(Method 2:model binding)
|
|
2378
|
+
*/
|
|
2379
|
+
interface CreateModelItemOptions extends ItemOptions {
|
|
1930
2380
|
/**
|
|
1931
|
-
*
|
|
1932
|
-
*
|
|
2381
|
+
* 几何根骨骼名,内置动画将作用于该骨骼;必须与用户 geometry 中带
|
|
2382
|
+
* binding(q.item_slot_to_bone_name)的骨骼名一致。默认 "rightitem"。
|
|
1933
2383
|
*/
|
|
1934
|
-
|
|
2384
|
+
boneName?: string;
|
|
1935
2385
|
/**
|
|
1936
|
-
*
|
|
1937
|
-
*
|
|
2386
|
+
* 默认材质。默认 "entity"(不透明,同官方示例);
|
|
2387
|
+
* 模型含透明像素时可用 "entity_alphatest"。
|
|
1938
2388
|
*/
|
|
1939
|
-
|
|
2389
|
+
material?: string;
|
|
1940
2390
|
/**
|
|
1941
|
-
*
|
|
1942
|
-
* @returns {Object} JSON 格式的物品对象
|
|
2391
|
+
* 覆盖内置第一人称握持姿态(默认参照官方示例)
|
|
1943
2392
|
*/
|
|
1944
|
-
|
|
1945
|
-
}
|
|
1946
|
-
|
|
1947
|
-
declare class Food extends Item {
|
|
2393
|
+
holdFirstPerson?: ModelBoneTransform;
|
|
1948
2394
|
/**
|
|
1949
|
-
*
|
|
1950
|
-
* @param {string} identifier 物品唯一标识符
|
|
1951
|
-
* @param {string} category 菜单栏分类 可选:"construction", "nature", "equipment", "items", and "none"
|
|
1952
|
-
* @param {string} texture 物品纹理
|
|
1953
|
-
* @param {Object} options 可选参数
|
|
1954
|
-
* @param {string} options.group 分组
|
|
1955
|
-
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
1956
|
-
* @param {string} options.animation 使用动画,默认为 "eat"
|
|
1957
|
-
* @param {boolean} options.canAlwaysEat 是否总是可以食用,默认为 false
|
|
1958
|
-
* @param {number} options.nutrition 营养价值,默认为 0
|
|
1959
|
-
* @param {number} options.saturationModifier 饱和度修正值,默认为 1
|
|
2395
|
+
* 覆盖内置第三人称握持姿态(默认参照官方示例)
|
|
1960
2396
|
*/
|
|
1961
|
-
|
|
1962
|
-
group: string;
|
|
1963
|
-
hide_in_command: boolean;
|
|
1964
|
-
animation: string;
|
|
1965
|
-
canAlwaysEat: boolean;
|
|
1966
|
-
nutrition: number;
|
|
1967
|
-
saturationModifier: number;
|
|
1968
|
-
});
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
declare class Attachable extends AddonAttachableDescription {
|
|
1972
|
-
constructor(identifier: any);
|
|
1973
|
-
getId(): string;
|
|
1974
|
-
toObject(): any;
|
|
1975
|
-
}
|
|
1976
|
-
|
|
1977
|
-
declare class Armor {
|
|
1978
|
-
constructor(identifier: any, category: any, item_texture: any, texture_path: any, options?: {});
|
|
1979
|
-
identifier: any;
|
|
1980
|
-
item: Item;
|
|
1981
|
-
attachable: Attachable;
|
|
1982
|
-
setArrachableGeometry(key: any, geometry: any): this;
|
|
2397
|
+
holdThirdPerson?: ModelBoneTransform;
|
|
1983
2398
|
}
|
|
1984
|
-
declare class Chestplate extends Armor {
|
|
1985
|
-
constructor(identifier: any, item_texture: any, texture_path: any, options?: {});
|
|
1986
|
-
}
|
|
1987
|
-
declare class Boot extends Armor {
|
|
1988
|
-
constructor(identifier: any, item_texture: any, texture_path: any, options?: {});
|
|
1989
|
-
}
|
|
1990
|
-
declare class Leggings extends Armor {
|
|
1991
|
-
constructor(identifier: any, item_texture: any, texture_path: any, options?: {});
|
|
1992
|
-
}
|
|
1993
|
-
declare class Helmet extends Armor {
|
|
1994
|
-
constructor(identifier: any, item_texture: any, texture_path: any, options?: {});
|
|
1995
|
-
}
|
|
1996
|
-
|
|
1997
2399
|
/**
|
|
1998
|
-
*
|
|
2400
|
+
* 食物选项
|
|
1999
2401
|
*/
|
|
2000
|
-
interface
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
group?: string;
|
|
2008
|
-
/**
|
|
2009
|
-
* 是否在命令自动补全中隐藏该物品
|
|
2010
|
-
* @default false - 默认在命令中显示
|
|
2011
|
-
*/
|
|
2012
|
-
hide_in_command?: boolean;
|
|
2402
|
+
interface FoodOptions extends ItemOptions {
|
|
2403
|
+
animation?: string;
|
|
2404
|
+
movement?: number;
|
|
2405
|
+
useDuration?: number;
|
|
2406
|
+
canAlwaysEat?: boolean;
|
|
2407
|
+
nutrition?: number;
|
|
2408
|
+
saturationModifier?: number;
|
|
2013
2409
|
/**
|
|
2014
|
-
*
|
|
2015
|
-
* 1秒 = 20游戏刻,因此8刻 = 0.4秒
|
|
2016
|
-
* @default 8 - 默认每帧显示0.4秒
|
|
2017
|
-
* @minimum 1 - 最小值1刻
|
|
2410
|
+
* 是否为肉类(自动追加 minecraft:is_meat 标签)
|
|
2018
2411
|
*/
|
|
2019
|
-
|
|
2412
|
+
isMeat?: boolean;
|
|
2020
2413
|
/**
|
|
2021
|
-
*
|
|
2022
|
-
* @default 64 - 默认堆叠64个
|
|
2023
|
-
* @minimum 1 - 最小值1
|
|
2024
|
-
* @maximum 99 - 最大堆叠限制
|
|
2414
|
+
* 是否为鱼类(自动追加 minecraft:is_fish 标签)
|
|
2025
2415
|
*/
|
|
2026
|
-
|
|
2416
|
+
isFish?: boolean;
|
|
2027
2417
|
/**
|
|
2028
|
-
*
|
|
2029
|
-
* @example "1.20.0" - 1.20版本
|
|
2030
|
-
* @example "1.19.0" - 1.19版本
|
|
2031
|
-
* @default "1.20.0" - 默认使用最新版本
|
|
2418
|
+
* 是否为熟食(自动追加 minecraft:is_cooked 标签)
|
|
2032
2419
|
*/
|
|
2033
|
-
|
|
2420
|
+
isCooked?: boolean;
|
|
2034
2421
|
}
|
|
2035
2422
|
/**
|
|
2036
|
-
*
|
|
2037
|
-
* 继承自Item类,用于创建具有动态翻书动画效果的物品
|
|
2038
|
-
* 该类会自动创建对应的几何方块并注册翻书材质动画
|
|
2423
|
+
* 可投掷组件选项
|
|
2039
2424
|
*/
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
* 创建并注册翻书物品
|
|
2048
|
-
*
|
|
2049
|
-
* @param identifier - 物品的唯一标识符(如:"my_mod:flipbook_item")
|
|
2050
|
-
* @param category - 物品所属的分类(如:"construction", "equipment"等)
|
|
2051
|
-
* @param texture - 纹理名称(不包含路径和后缀,如:"my_flipbook_texture")
|
|
2052
|
-
* @param options - 可选的配置参数对象
|
|
2053
|
-
* @param options.group - 物品分组,用于在创造模式物品栏中分组显示
|
|
2054
|
-
* @param options.hide_in_command - 是否在命令自动补全中隐藏该物品
|
|
2055
|
-
* @param options.ticks_per_frame - 每个动画帧持续的游戏刻数(tick),默认8刻
|
|
2056
|
-
* @param options.max_stack_size - 物品的最大堆叠数量
|
|
2057
|
-
* @param options.format_version - 格式版本号
|
|
2058
|
-
*/
|
|
2059
|
-
constructor(identifier: string, category: string, texture: string, options?: FlipbookItemOptions);
|
|
2425
|
+
interface ThrowableOptions {
|
|
2426
|
+
doSwingAnimation?: boolean;
|
|
2427
|
+
launchPowerScale?: number;
|
|
2428
|
+
maxDrawDuration?: number;
|
|
2429
|
+
maxLaunchPower?: number;
|
|
2430
|
+
minDrawDuration?: number;
|
|
2431
|
+
scalePowerByDrawDuration?: boolean;
|
|
2060
2432
|
}
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
group: string;
|
|
2070
|
-
hide_in_command: boolean;
|
|
2071
|
-
animation: string;
|
|
2072
|
-
canAlwaysEat: boolean;
|
|
2073
|
-
nutrition: number;
|
|
2074
|
-
saturationModifier: number;
|
|
2075
|
-
}): Food;
|
|
2076
|
-
function createAttachable(identifier: string, texture: string, material: string, options?: Object): Attachable;
|
|
2077
|
-
function createChestplateArmor(identifier: any, item_texture: any, texture_path: any, options?: {}): Chestplate;
|
|
2078
|
-
function createHelmetArmor(identifier: any, item_texture: any, texture_path: any, options?: {}): Helmet;
|
|
2079
|
-
function createBootArmor(identifier: any, item_texture: any, texture_path: any, options?: {}): Boot;
|
|
2080
|
-
function createLeggingsArmor(identifier: any, item_texture: any, texture_path: any, options?: {}): Leggings;
|
|
2081
|
-
function createFlipbookItem(identifier: string, category: string, texture: string, options?: Object | null): FlipbookItem;
|
|
2433
|
+
/**
|
|
2434
|
+
* 食物组件选项
|
|
2435
|
+
*/
|
|
2436
|
+
interface FoodComponentOptions {
|
|
2437
|
+
nutrition?: number;
|
|
2438
|
+
saturationModifier?: number;
|
|
2439
|
+
canAlwaysEat?: boolean;
|
|
2440
|
+
usingConvertsTo?: string;
|
|
2082
2441
|
}
|
|
2083
|
-
|
|
2442
|
+
/**
|
|
2443
|
+
* 方块描述符:字符串、带状态的名称对象或标签 Molang 查询对象
|
|
2444
|
+
*/
|
|
2445
|
+
type BlockDescriptor = string | {
|
|
2446
|
+
name: string;
|
|
2447
|
+
states?: Record<string, unknown>;
|
|
2448
|
+
} | {
|
|
2449
|
+
tags: string;
|
|
2450
|
+
};
|
|
2451
|
+
/**
|
|
2452
|
+
* 数值范围
|
|
2453
|
+
*/
|
|
2454
|
+
interface Range {
|
|
2455
|
+
min: number;
|
|
2456
|
+
max: number;
|
|
2457
|
+
}
|
|
2458
|
+
/**
|
|
2459
|
+
* 物品稀有度
|
|
2460
|
+
*/
|
|
2461
|
+
type ItemRarity = 'common' | 'uncommon' | 'rare' | 'epic';
|
|
2462
|
+
/**
|
|
2463
|
+
* 放置方块组件选项
|
|
2464
|
+
*/
|
|
2465
|
+
interface BlockPlacerOptions {
|
|
2466
|
+
replaceBlockItem?: boolean;
|
|
2467
|
+
alignedPlacement?: boolean;
|
|
2468
|
+
useOn?: BlockDescriptor[];
|
|
2469
|
+
}
|
|
2470
|
+
/**
|
|
2471
|
+
* 使用修饰组件选项
|
|
2472
|
+
*/
|
|
2473
|
+
interface UseModifiersOptions {
|
|
2474
|
+
movementModifier?: number;
|
|
2475
|
+
useDuration?: number;
|
|
2476
|
+
emitVibrations?: boolean;
|
|
2477
|
+
startSound?: string;
|
|
2478
|
+
startUsing?: 'always' | 'if_first';
|
|
2479
|
+
}
|
|
2480
|
+
/**
|
|
2481
|
+
* 图标纹理(对象格式)
|
|
2482
|
+
*/
|
|
2483
|
+
interface IconTextures {
|
|
2484
|
+
default: string;
|
|
2485
|
+
dyed?: string;
|
|
2486
|
+
iconTrim?: string;
|
|
2487
|
+
bundleOpenBack?: string;
|
|
2488
|
+
bundleOpenFront?: string;
|
|
2489
|
+
}
|
|
2490
|
+
/**
|
|
2491
|
+
* 冷却组件选项
|
|
2492
|
+
*/
|
|
2493
|
+
interface CooldownOptions {
|
|
2494
|
+
category: string;
|
|
2495
|
+
duration: number;
|
|
2496
|
+
type?: 'use' | 'attack';
|
|
2497
|
+
}
|
|
2498
|
+
/**
|
|
2499
|
+
* 挖掘组件选项
|
|
2500
|
+
*/
|
|
2501
|
+
interface DiggerOptions {
|
|
2502
|
+
destroySpeeds: {
|
|
2503
|
+
block: BlockDescriptor;
|
|
2504
|
+
speed: number;
|
|
2505
|
+
}[];
|
|
2506
|
+
useEfficiency?: boolean;
|
|
2507
|
+
}
|
|
2508
|
+
/**
|
|
2509
|
+
* 耐久传感器阈值
|
|
2510
|
+
*/
|
|
2511
|
+
interface DurabilityThreshold {
|
|
2512
|
+
durability: number;
|
|
2513
|
+
particleType?: string;
|
|
2514
|
+
soundEvent?: string;
|
|
2515
|
+
}
|
|
2516
|
+
/**
|
|
2517
|
+
* 耐久传感器组件选项
|
|
2518
|
+
*/
|
|
2519
|
+
interface DurabilitySensorOptions {
|
|
2520
|
+
durabilityThresholds: DurabilityThreshold[];
|
|
2521
|
+
}
|
|
2522
|
+
/**
|
|
2523
|
+
* 放置实体组件选项
|
|
2524
|
+
*/
|
|
2525
|
+
interface EntityPlacerOptions {
|
|
2526
|
+
dispenseOn?: BlockDescriptor[];
|
|
2527
|
+
useOn?: BlockDescriptor[];
|
|
2528
|
+
}
|
|
2529
|
+
/**
|
|
2530
|
+
* 动能武器组件选项
|
|
2531
|
+
*/
|
|
2532
|
+
interface KineticWeaponOptions {
|
|
2533
|
+
delay: number;
|
|
2534
|
+
hitboxMargin?: number;
|
|
2535
|
+
reach?: Range;
|
|
2536
|
+
creativeReach?: Range;
|
|
2537
|
+
damageMultiplier?: number;
|
|
2538
|
+
damageModifier?: number;
|
|
2539
|
+
damageConditions?: Record<string, unknown>;
|
|
2540
|
+
dismountConditions?: Record<string, unknown>;
|
|
2541
|
+
knockbackConditions?: Record<string, unknown>;
|
|
2542
|
+
}
|
|
2543
|
+
/**
|
|
2544
|
+
* 穿刺武器组件选项
|
|
2545
|
+
*/
|
|
2546
|
+
interface PiercingWeaponOptions {
|
|
2547
|
+
hitboxMargin?: number;
|
|
2548
|
+
reach?: Range;
|
|
2549
|
+
creativeReach?: Range;
|
|
2550
|
+
}
|
|
2551
|
+
/**
|
|
2552
|
+
* 唱片组件选项
|
|
2553
|
+
*/
|
|
2554
|
+
interface RecordOptions {
|
|
2555
|
+
comparatorSignal: number;
|
|
2556
|
+
duration: number;
|
|
2557
|
+
soundEvent: string;
|
|
2558
|
+
}
|
|
2559
|
+
/**
|
|
2560
|
+
* 修复条目
|
|
2561
|
+
*/
|
|
2562
|
+
interface RepairItem {
|
|
2563
|
+
items: (string | {
|
|
2564
|
+
tags: string;
|
|
2565
|
+
})[];
|
|
2566
|
+
repairAmount?: number | string;
|
|
2567
|
+
}
|
|
2568
|
+
/**
|
|
2569
|
+
* 射击组件弹药
|
|
2570
|
+
*/
|
|
2571
|
+
interface ShooterAmmunition {
|
|
2572
|
+
item: string;
|
|
2573
|
+
searchInventory?: boolean;
|
|
2574
|
+
useInCreative?: boolean;
|
|
2575
|
+
useOffhand?: boolean;
|
|
2576
|
+
}
|
|
2577
|
+
/**
|
|
2578
|
+
* 射击组件选项
|
|
2579
|
+
*/
|
|
2580
|
+
interface ShooterOptions {
|
|
2581
|
+
ammunition: ShooterAmmunition[];
|
|
2582
|
+
chargeOnDraw?: boolean;
|
|
2583
|
+
maxDrawDuration?: number;
|
|
2584
|
+
scalePowerByDrawDuration?: boolean;
|
|
2585
|
+
}
|
|
2586
|
+
/**
|
|
2587
|
+
* 容器物品组件选项
|
|
2588
|
+
*/
|
|
2589
|
+
interface StorageItemOptions {
|
|
2590
|
+
maxSlots: number;
|
|
2591
|
+
allowNestedStorageItems: boolean;
|
|
2592
|
+
allowedItems?: string[];
|
|
2593
|
+
bannedItems?: string[];
|
|
2594
|
+
}
|
|
2595
|
+
/**
|
|
2596
|
+
* 挥砍音效组件选项
|
|
2597
|
+
*/
|
|
2598
|
+
interface SwingSoundsOptions {
|
|
2599
|
+
attackMiss?: string;
|
|
2600
|
+
attackHit?: string;
|
|
2601
|
+
attackCriticalHit?: string;
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
declare class Attachable extends AddonAttachableDescription {
|
|
2605
|
+
#private;
|
|
2606
|
+
constructor(identifier: string, formatVersion?: string);
|
|
2607
|
+
getId(): string;
|
|
2608
|
+
toObject(): Record<string, any>;
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
declare class Item {
|
|
2612
|
+
identifier: string;
|
|
2613
|
+
category: string;
|
|
2614
|
+
texture: string;
|
|
2615
|
+
group?: string;
|
|
2616
|
+
hide_in_command: boolean;
|
|
2617
|
+
format_version: string;
|
|
2618
|
+
components: ItemComponentMap;
|
|
2619
|
+
attachable?: Attachable;
|
|
2620
|
+
/**
|
|
2621
|
+
* 物品类
|
|
2622
|
+
* @param identifier 物品唯一标识符
|
|
2623
|
+
* @param category 菜单栏分类,见 {@link ItemCategory}
|
|
2624
|
+
* @param texture 物品纹理
|
|
2625
|
+
* @param options 可选参数
|
|
2626
|
+
*/
|
|
2627
|
+
constructor(identifier: string, category: ItemCategory, texture: string, options?: ItemOptions);
|
|
2628
|
+
/**
|
|
2629
|
+
* 添加组件
|
|
2630
|
+
* @param componentMap 组件 Map
|
|
2631
|
+
*/
|
|
2632
|
+
addComponent(componentMap: ItemComponentMap): this;
|
|
2633
|
+
/**
|
|
2634
|
+
* 移除组件
|
|
2635
|
+
* @param key 组件名称
|
|
2636
|
+
*/
|
|
2637
|
+
removeComponent(key: string): this;
|
|
2638
|
+
getAttachable(): Attachable | undefined;
|
|
2639
|
+
/**
|
|
2640
|
+
* 将物品转换为 JSON 格式
|
|
2641
|
+
* @returns JSON 格式的物品对象
|
|
2642
|
+
*/
|
|
2643
|
+
toObject(): Record<string, any>;
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
/**
|
|
2647
|
+
* 盔甲类型枚举
|
|
2648
|
+
*/
|
|
2649
|
+
declare enum ArmorType {
|
|
2650
|
+
Chestplate = "chestplate",
|
|
2651
|
+
Helmet = "helmet",
|
|
2652
|
+
Boots = "boots",
|
|
2653
|
+
Leggings = "leggings"
|
|
2654
|
+
}
|
|
2655
|
+
/**
|
|
2656
|
+
* 盔甲类型规格
|
|
2657
|
+
* 参考 Bedrock Wiki "Custom Armor":https://wiki.bedrock.dev/items/custom-armor
|
|
2658
|
+
*/
|
|
2659
|
+
interface ArmorSpec {
|
|
2660
|
+
group: string;
|
|
2661
|
+
geometry: string;
|
|
2662
|
+
script: string;
|
|
2663
|
+
protection: number;
|
|
2664
|
+
slot: string;
|
|
2665
|
+
enchantSlot: string;
|
|
2666
|
+
maxDurability: number;
|
|
2667
|
+
displayName: string;
|
|
2668
|
+
}
|
|
2669
|
+
/**
|
|
2670
|
+
* 盔甲选项
|
|
2671
|
+
* 参考 Bedrock Wiki "Custom Armor":https://wiki.bedrock.dev/items/custom-armor
|
|
2672
|
+
*/
|
|
2673
|
+
interface ArmorOptions extends ItemOptions {
|
|
2674
|
+
displayName?: string;
|
|
2675
|
+
/**
|
|
2676
|
+
* 附魔槽位与等级(参考 wiki 规范,默认 { slot: 按部位, value: 10 })
|
|
2677
|
+
*/
|
|
2678
|
+
enchantable?: {
|
|
2679
|
+
slot: string;
|
|
2680
|
+
value?: number;
|
|
2681
|
+
};
|
|
2682
|
+
/**
|
|
2683
|
+
* 最大耐久(参考 wiki 规范,默认按部位:头盔 363 / 胸甲 528 / 护腿 495 / 靴子 429)
|
|
2684
|
+
*/
|
|
2685
|
+
maxDurability?: number;
|
|
2686
|
+
/**
|
|
2687
|
+
* 修复条目(参考 wiki 规范,默认木棍,每次恢复 25% 最大耐久)
|
|
2688
|
+
*/
|
|
2689
|
+
repairItems?: RepairItem[];
|
|
2690
|
+
/**
|
|
2691
|
+
* 附加标签(参考 wiki 规范,默认 ["minecraft:is_armor", "minecraft:trimmable_armors"])
|
|
2692
|
+
*/
|
|
2693
|
+
tags?: string[];
|
|
2694
|
+
/**
|
|
2695
|
+
* 渲染控制器,默认 "controller.render.armor"(兼容旧版),可传 "controller.render.armor.v2"
|
|
2696
|
+
*/
|
|
2697
|
+
renderController?: string;
|
|
2698
|
+
}
|
|
2699
|
+
/**
|
|
2700
|
+
* 盔甲类
|
|
2701
|
+
* 由 ArmorType 数据表驱动,同时生成物品(Item)与可附着物(Attachable)
|
|
2702
|
+
*/
|
|
2703
|
+
declare class Armor {
|
|
2704
|
+
type: ArmorType;
|
|
2705
|
+
identifier: string;
|
|
2706
|
+
item: Item;
|
|
2707
|
+
attachable: Attachable;
|
|
2708
|
+
constructor(identifier: string, item_texture: string, texture_path: string, type?: ArmorType, options?: ArmorOptions);
|
|
2709
|
+
/**
|
|
2710
|
+
* 设置可附着物的几何模型
|
|
2711
|
+
* @param key 几何模型名称
|
|
2712
|
+
* @param geometry 几何模型标识符
|
|
2713
|
+
* @returns 当前实例,支持链式调用
|
|
2714
|
+
*/
|
|
2715
|
+
setAttachableGeometry(key: string, geometry: string): this;
|
|
2716
|
+
/**
|
|
2717
|
+
* 获取行为包与资源包的 JSON 表示
|
|
2718
|
+
* @returns { behavior, resource } 两个包的注册内容
|
|
2719
|
+
*/
|
|
2720
|
+
toObject(): {
|
|
2721
|
+
behavior: Record<string, any>;
|
|
2722
|
+
resource: Record<string, any>;
|
|
2723
|
+
};
|
|
2724
|
+
}
|
|
2725
|
+
|
|
2726
|
+
declare class Food extends Item {
|
|
2727
|
+
/**
|
|
2728
|
+
* 食物类
|
|
2729
|
+
* @param identifier 物品唯一标识符
|
|
2730
|
+
* @param category 菜单栏分类,见 {@link ItemCategory}
|
|
2731
|
+
* @param texture 物品纹理
|
|
2732
|
+
* @param options 可选参数
|
|
2733
|
+
*/
|
|
2734
|
+
constructor(identifier: string, category: ItemCategory, texture: string, options?: FoodOptions);
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
/**
|
|
2738
|
+
* 翻书物品配置选项接口
|
|
2739
|
+
*/
|
|
2740
|
+
interface FlipbookItemOptions {
|
|
2741
|
+
/**
|
|
2742
|
+
* 物品分组 - 用于在创造模式物品栏中分组显示
|
|
2743
|
+
* @example "construction" - 建筑类
|
|
2744
|
+
* @example "equipment" - 装备类
|
|
2745
|
+
* @example "nature" - 自然类
|
|
2746
|
+
*/
|
|
2747
|
+
group?: string;
|
|
2748
|
+
/**
|
|
2749
|
+
* 是否在命令自动补全中隐藏该物品
|
|
2750
|
+
* @default false - 默认在命令中显示
|
|
2751
|
+
*/
|
|
2752
|
+
hide_in_command?: boolean;
|
|
2753
|
+
/**
|
|
2754
|
+
* 每个动画帧持续的游戏刻数(tick)
|
|
2755
|
+
* 1秒 = 20游戏刻,因此8刻 = 0.4秒
|
|
2756
|
+
* @default 8 - 默认每帧显示0.4秒
|
|
2757
|
+
* @minimum 1 - 最小值1刻
|
|
2758
|
+
*/
|
|
2759
|
+
ticks_per_frame?: number;
|
|
2760
|
+
/**
|
|
2761
|
+
* 物品的最大堆叠数量
|
|
2762
|
+
* @default 64 - 默认堆叠64个
|
|
2763
|
+
* @minimum 1 - 最小值1
|
|
2764
|
+
* @maximum 99 - 最大堆叠限制
|
|
2765
|
+
*/
|
|
2766
|
+
max_stack_size?: number;
|
|
2767
|
+
/**
|
|
2768
|
+
* 资源包的格式版本号
|
|
2769
|
+
* @example "1.20.0" - 1.20版本
|
|
2770
|
+
* @example "1.19.0" - 1.19版本
|
|
2771
|
+
* @default "1.20.0" - 默认使用最新版本
|
|
2772
|
+
*/
|
|
2773
|
+
format_version?: string;
|
|
2774
|
+
/**
|
|
2775
|
+
* 翻书纹理文件的完整路径(不含 .png 后缀)。
|
|
2776
|
+
* @default `"textures/blocks/${texture}"` - 默认使用方块纹理目录
|
|
2777
|
+
*/
|
|
2778
|
+
texture_path?: string;
|
|
2779
|
+
}
|
|
2780
|
+
/**
|
|
2781
|
+
* 翻书物品类
|
|
2782
|
+
* 继承自Item类,用于创建具有动态翻书动画效果的物品
|
|
2783
|
+
* 该类会自动创建对应的几何方块并注册翻书材质动画
|
|
2784
|
+
*/
|
|
2785
|
+
declare class FlipbookItem extends Item {
|
|
2786
|
+
/**
|
|
2787
|
+
* 关联的外观方块实例
|
|
2788
|
+
* 用于在游戏中显示该翻书物品的3D模型
|
|
2789
|
+
*/
|
|
2790
|
+
block: GeometryBlock;
|
|
2791
|
+
/**
|
|
2792
|
+
* 创建并注册翻书物品
|
|
2793
|
+
*
|
|
2794
|
+
* @param identifier - 物品的唯一标识符(如:"my_mod:flipbook_item")
|
|
2795
|
+
* @param category - 物品所属的分类(如:"construction", "equipment"等)
|
|
2796
|
+
* @param texture - 纹理名称(不包含路径和后缀,如:"my_flipbook_texture")
|
|
2797
|
+
* @param options - 可选的配置参数对象
|
|
2798
|
+
* @param options.group - 物品分组,用于在创造模式物品栏中分组显示
|
|
2799
|
+
* @param options.hide_in_command - 是否在命令自动补全中隐藏该物品
|
|
2800
|
+
* @param options.ticks_per_frame - 每个动画帧持续的游戏刻数(tick),默认8刻
|
|
2801
|
+
* @param options.max_stack_size - 物品的最大堆叠数量
|
|
2802
|
+
* @param options.format_version - 格式版本号
|
|
2803
|
+
*/
|
|
2804
|
+
constructor(identifier: string, category: ItemCategory, texture: string, options?: FlipbookItemOptions);
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
/**
|
|
2808
|
+
* 物品目录分类
|
|
2809
|
+
* 参考 Bedrock Wiki Item Catalog:仅支持 construction / equipment / items / nature 四类
|
|
2810
|
+
*/
|
|
2811
|
+
type ItemCatalogCategory = 'construction' | 'equipment' | 'items' | 'nature';
|
|
2812
|
+
/**
|
|
2813
|
+
* 可展开分组配置
|
|
2814
|
+
*/
|
|
2815
|
+
interface ItemCatalogGroupOptions {
|
|
2816
|
+
/**
|
|
2817
|
+
* 分组图标使用的物品
|
|
2818
|
+
*/
|
|
2819
|
+
icon?: string;
|
|
2820
|
+
/**
|
|
2821
|
+
* 分组的本地化键,如 "wiki:itemGroup.name.ore";同时可用作物品/方块的 menu_category.group
|
|
2822
|
+
*/
|
|
2823
|
+
name?: string;
|
|
2824
|
+
}
|
|
2825
|
+
/**
|
|
2826
|
+
* 物品目录
|
|
2827
|
+
* 生成 BP/item_catalog/crafting_item_catalog.json,
|
|
2828
|
+
* 用于指定物品在创造菜单与配方手册中的分组位置。
|
|
2829
|
+
*/
|
|
2830
|
+
declare class ItemCatalog {
|
|
2831
|
+
format_version: string;
|
|
2832
|
+
private categories;
|
|
2833
|
+
/**
|
|
2834
|
+
* @param format_version 格式版本,默认 "1.26.30"
|
|
2835
|
+
*/
|
|
2836
|
+
constructor(format_version?: string);
|
|
2837
|
+
/**
|
|
2838
|
+
* 添加一组物品到指定分类
|
|
2839
|
+
* @param category 创造菜单分类(construction/equipment/items/nature)
|
|
2840
|
+
* @param items 物品标识符列表
|
|
2841
|
+
* @param options 可展开分组配置
|
|
2842
|
+
* @returns 当前实例,支持链式调用
|
|
2843
|
+
*/
|
|
2844
|
+
addGroup(category: ItemCatalogCategory, items: string[], options?: ItemCatalogGroupOptions): this;
|
|
2845
|
+
/**
|
|
2846
|
+
* 添加单个物品到指定分类
|
|
2847
|
+
* @param category 创造菜单分类(construction/equipment/items/nature)
|
|
2848
|
+
* @param item 物品标识符
|
|
2849
|
+
* @param options 可展开分组配置
|
|
2850
|
+
* @returns 当前实例,支持链式调用
|
|
2851
|
+
*/
|
|
2852
|
+
addItem(category: ItemCatalogCategory, item: string, options?: ItemCatalogGroupOptions): this;
|
|
2853
|
+
/**
|
|
2854
|
+
* 注册到行为包的 item_catalog/ 目录
|
|
2855
|
+
* @returns 当前实例
|
|
2856
|
+
*/
|
|
2857
|
+
register(): this;
|
|
2858
|
+
/**
|
|
2859
|
+
* 将物品目录转换为 JSON 格式
|
|
2860
|
+
* @returns JSON 格式的物品目录对象
|
|
2861
|
+
*/
|
|
2862
|
+
toObject(): Record<string, any>;
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
declare const ItemAPI: {
|
|
2866
|
+
/**
|
|
2867
|
+
* 创建一个普通物品。
|
|
2868
|
+
* @param identifier 物品的唯一标识符。
|
|
2869
|
+
* @param category 物品在创造菜单中的分类,见 {@link ItemCategory}。
|
|
2870
|
+
* @param texture 物品的纹理。
|
|
2871
|
+
* @param options 额外选项。
|
|
2872
|
+
* @returns 创建的物品。
|
|
2873
|
+
*/
|
|
2874
|
+
createItem(identifier: string, category: ItemCategory, texture: string, options?: ItemOptions): Item;
|
|
2875
|
+
/**
|
|
2876
|
+
* 创建一个大型物品(Item + Attachable)。
|
|
2877
|
+
* 用于在手持时显示为大型 3D 模型(如部分 3D 物品)。
|
|
2878
|
+
* @param identifier 物品的唯一标识符。
|
|
2879
|
+
* @param category 物品在创造菜单中的分类,见 {@link ItemCategory}。
|
|
2880
|
+
* @param texture 物品的纹理。
|
|
2881
|
+
* @param options 额外选项。
|
|
2882
|
+
* @returns 创建的物品。
|
|
2883
|
+
*/
|
|
2884
|
+
createLargeItem(identifier: string, category: ItemCategory, texture: string, options?: ItemOptions): Item;
|
|
2885
|
+
/**
|
|
2886
|
+
* 创建一个 3D 手持物品(Item + Attachable + 内置默认握持动画)。
|
|
2887
|
+
* 采用 Bedrock Wiki "Attachables" 的 Method 2(model binding):attachable 使用
|
|
2888
|
+
* scripts.animate 按 context.is_first_person 切换首/第三人称动画,并搭配
|
|
2889
|
+
* controller.render.item_default 渲染控制器。内置动画姿态参照官方示例
|
|
2890
|
+
* (首/第三人称各用固定值),骨骼名须与用户 geometry 中的根骨骼一致。
|
|
2891
|
+
* 用户需自行将几何模型放入 RP(geometry 根骨骼应使用
|
|
2892
|
+
* "q.item_slot_to_bone_name(c.item_slot)" 绑定槽位)。
|
|
2893
|
+
* @param identifier 物品的唯一标识符(如 "my_mod:model_sword")。
|
|
2894
|
+
* @param category 物品在创造菜单中的分类,见 {@link ItemCategory}。
|
|
2895
|
+
* @param icon 物品图标(创造菜单/物品栏显示的短名,需登记在 item_texture.json)。
|
|
2896
|
+
* 与 texture 相互独立,可分别指定。
|
|
2897
|
+
* @param texture attachable 的 3D 贴图路径。传完整路径(如 "textures/entity/skeleton/skeleton")
|
|
2898
|
+
* 将直接用作贴图;传短名(如 "amethyst_shard")则自动拼接 "textures/items/" 前缀。
|
|
2899
|
+
* @param geometry 用户几何标识符(如 "geometry.my_model")。
|
|
2900
|
+
* @param options 额外选项,见 {@link CreateModelItemOptions}。
|
|
2901
|
+
* @returns 创建的物品。
|
|
2902
|
+
*/
|
|
2903
|
+
createModelItem(identifier: string, category: ItemCategory, icon: string, texture: string, geometry: string, options?: CreateModelItemOptions): Item;
|
|
2904
|
+
/**
|
|
2905
|
+
* 创建一个食物物品。
|
|
2906
|
+
* @param identifier 食物的唯一标识符。
|
|
2907
|
+
* @param category 食物在创造菜单中的分类,见 {@link ItemCategory}。
|
|
2908
|
+
* @param texture 食物的纹理。
|
|
2909
|
+
* @param options 额外选项。
|
|
2910
|
+
* @returns 创建的食物物品。
|
|
2911
|
+
*/
|
|
2912
|
+
createFood(identifier: string, category: ItemCategory, texture: string, options?: FoodOptions): Food;
|
|
2913
|
+
/**
|
|
2914
|
+
* 创建一个可附着物品。
|
|
2915
|
+
* @param identifier 可附着物品的唯一标识符。
|
|
2916
|
+
* @param texture 可附着物品的纹理。
|
|
2917
|
+
* @param material 可附着物品的材质。
|
|
2918
|
+
* @param options 额外选项。
|
|
2919
|
+
* @returns 创建的可附着物品。
|
|
2920
|
+
*/
|
|
2921
|
+
createAttachable(identifier: string, texture: string, material: string, options?: ItemOptions): Attachable;
|
|
2922
|
+
/**
|
|
2923
|
+
* 创建一个胸甲(Item + Attachable)。
|
|
2924
|
+
* @param identifier 物品的唯一标识符。
|
|
2925
|
+
* @param item_texture 物品图标纹理名称。
|
|
2926
|
+
* @param texture_path 盔甲模型纹理路径。
|
|
2927
|
+
* @param options 额外选项。
|
|
2928
|
+
* @returns 创建的盔甲实例。
|
|
2929
|
+
*/
|
|
2930
|
+
createChestplateArmor(identifier: string, item_texture: string, texture_path: string, options?: ItemOptions): Armor;
|
|
2931
|
+
/**
|
|
2932
|
+
* 创建一个头盔(Item + Attachable)。
|
|
2933
|
+
*/
|
|
2934
|
+
createHelmetArmor(identifier: string, item_texture: string, texture_path: string, options?: ItemOptions): Armor;
|
|
2935
|
+
/**
|
|
2936
|
+
* 创建一个靴子(Item + Attachable)。
|
|
2937
|
+
*/
|
|
2938
|
+
createBootArmor(identifier: string, item_texture: string, texture_path: string, options?: ItemOptions): Armor;
|
|
2939
|
+
/**
|
|
2940
|
+
* 创建一个护腿(Item + Attachable)。
|
|
2941
|
+
*/
|
|
2942
|
+
createLeggingsArmor(identifier: string, item_texture: string, texture_path: string, options?: ItemOptions): Armor;
|
|
2943
|
+
/**
|
|
2944
|
+
* 创建并注册翻书物品。
|
|
2945
|
+
* @param identifier 物品的唯一标识符(如:"my_mod:flipbook_item")。
|
|
2946
|
+
* @param category 物品所属的分类,见 {@link ItemCategory}。
|
|
2947
|
+
* @param texture 纹理名称(不包含路径和后缀,如:"my_flipbook_texture")。
|
|
2948
|
+
* @param options 可选的配置参数对象。
|
|
2949
|
+
* @returns 创建的翻书物品。
|
|
2950
|
+
*/
|
|
2951
|
+
createFlipbookItem(identifier: string, category: ItemCategory, texture: string, options?: FlipbookItemOptions): FlipbookItem;
|
|
2952
|
+
/**
|
|
2953
|
+
* 创建物品目录(生成 BP/item_catalog/crafting_item_catalog.json)。
|
|
2954
|
+
* 用于指定物品在创造菜单与配方手册中的分组位置。
|
|
2955
|
+
* @param formatVersion 格式版本,默认 "1.26.30"
|
|
2956
|
+
* @returns 物品目录实例
|
|
2957
|
+
*/
|
|
2958
|
+
createItemCatalog(formatVersion?: string): ItemCatalog;
|
|
2959
|
+
};
|
|
2960
|
+
|
|
2084
2961
|
declare const RecipeAPI: RecipeRegistry;
|
|
2085
2962
|
declare class RecipeRegistry {
|
|
2086
2963
|
/**
|
|
@@ -2096,21 +2973,148 @@ declare class RecipeRegistry {
|
|
|
2096
2973
|
registerShapeless(identifier: any): AddonRecipeShapeless_1_17;
|
|
2097
2974
|
}
|
|
2098
2975
|
|
|
2976
|
+
type Any$1 = any;
|
|
2099
2977
|
declare class UISystem {
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
addElement(element:
|
|
2108
|
-
getElement(element_name:
|
|
2109
|
-
addAnimation(name:
|
|
2110
|
-
getAnimation(animation_name:
|
|
2111
|
-
toObject():
|
|
2112
|
-
|
|
2113
|
-
|
|
2978
|
+
identifier: string;
|
|
2979
|
+
namespace: string;
|
|
2980
|
+
name: string;
|
|
2981
|
+
path: string;
|
|
2982
|
+
elements: Map<string, Any$1>;
|
|
2983
|
+
animations: Map<string, Any$1>;
|
|
2984
|
+
constructor(identifier: string, path: string);
|
|
2985
|
+
addElement(element: Any$1): this;
|
|
2986
|
+
getElement(element_name: string): Any$1;
|
|
2987
|
+
addAnimation(name: string, value: Any$1): void;
|
|
2988
|
+
getAnimation(animation_name: string): Any$1;
|
|
2989
|
+
toObject(): Record<string, Any$1>;
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
/** 共享 UI 类型定义(JSON UI 规范的受控映射) */
|
|
2993
|
+
/** 尺寸向量(像素数字或百分比/计算字符串),如 [320, 207] / ["50%", "100%"] */
|
|
2994
|
+
type Size2 = [number | string, number | string];
|
|
2995
|
+
/** 偏移向量 [x, y](像素) */
|
|
2996
|
+
type Offset2 = [number, number];
|
|
2997
|
+
/** 锚点(anchor_from / anchor_to)可选值 */
|
|
2998
|
+
type Anchor = 'top_left' | 'top_middle' | 'top_right' | 'left_middle' | 'center' | 'right_middle' | 'bottom_left' | 'bottom_middle' | 'bottom_right';
|
|
2999
|
+
/** 数据绑定类型 */
|
|
3000
|
+
type BindingType = 'global' | 'view' | 'collection' | 'collection_details' | 'none';
|
|
3001
|
+
/** 数据绑定条件 */
|
|
3002
|
+
type BindingCondition = 'always' | 'always_when_visible' | 'visible' | 'once' | 'none' | 'visibility_changed';
|
|
3003
|
+
/** 调制操作类型(Modifications.OPERATION 的字面量) */
|
|
3004
|
+
type ModificationOperation = 'insert_back' | 'insert_front' | 'insert_after' | 'insert_before' | 'move_back' | 'move_front' | 'move_after' | 'move_before' | 'swap' | 'replace' | 'remove';
|
|
3005
|
+
/** 支持任意键的 JSON UI 属性包(类内部索引签名基类型) */
|
|
3006
|
+
type JsonUIBag = {
|
|
3007
|
+
[key: string]: any;
|
|
3008
|
+
};
|
|
3009
|
+
|
|
3010
|
+
/**
|
|
3011
|
+
* DataBindingObject 类
|
|
3012
|
+
*
|
|
3013
|
+
* 该类表示数据绑定配置,用于将硬编码值或变量绑定到元素属性。
|
|
3014
|
+
*
|
|
3015
|
+
* 属性:
|
|
3016
|
+
* - ignored: boolean - 是否忽略绑定(默认值:false)
|
|
3017
|
+
* - binding_type: enum - 绑定类型(可能值:global, view, collection, collection_details, none)
|
|
3018
|
+
* - binding_name: string - 数据绑定名称或条件的值
|
|
3019
|
+
* - binding_name_override: string - 应用 binding_name 值的 UI 元素属性名称
|
|
3020
|
+
* - binding_collection_name: string - 要使用的集合名称
|
|
3021
|
+
* - binding_collection_prefix: string - 集合前缀
|
|
3022
|
+
* - binding_condition: enum - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
3023
|
+
* - source_control_name: string - 要观察其属性值的 UI 元素名称
|
|
3024
|
+
* - source_property_name: string - 存储 source_control_name 引用的 UI 元素的属性值
|
|
3025
|
+
* - target_property_name: string - 应用 source_property_name 值的 UI 元素属性
|
|
3026
|
+
* - resolve_sibling_scope: boolean - 是否允许选择同级元素而非子元素(默认值:false)
|
|
3027
|
+
*/
|
|
3028
|
+
|
|
3029
|
+
type BindingTypeOrString = BindingType | string;
|
|
3030
|
+
type BindingConditionOrString = BindingCondition | string;
|
|
3031
|
+
declare class DataBindingObject {
|
|
3032
|
+
[key: string]: unknown;
|
|
3033
|
+
ignored: boolean;
|
|
3034
|
+
binding_type: BindingTypeOrString;
|
|
3035
|
+
binding_name: string;
|
|
3036
|
+
binding_name_override: string;
|
|
3037
|
+
binding_collection_name: string;
|
|
3038
|
+
binding_collection_prefix: string;
|
|
3039
|
+
binding_condition: BindingConditionOrString;
|
|
3040
|
+
source_control_name: string;
|
|
3041
|
+
source_property_name: string;
|
|
3042
|
+
target_property_name: string;
|
|
3043
|
+
resolve_sibling_scope: boolean;
|
|
3044
|
+
/**
|
|
3045
|
+
* 设置是否忽略绑定。
|
|
3046
|
+
* @param {boolean} ignored - 是否忽略绑定(默认值:false)
|
|
3047
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3048
|
+
*/
|
|
3049
|
+
setIgnored(ignored?: boolean): this;
|
|
3050
|
+
/**
|
|
3051
|
+
* 设置绑定类型。
|
|
3052
|
+
* @param {BindingTypeOrString} type - 绑定类型(可能值:global, view, collection, collection_details, none)
|
|
3053
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3054
|
+
*/
|
|
3055
|
+
setBindingType(type: BindingTypeOrString): this;
|
|
3056
|
+
/**
|
|
3057
|
+
* 设置数据绑定名称或条件的值。
|
|
3058
|
+
* @param {string} name - 数据绑定名称或条件的值
|
|
3059
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3060
|
+
*/
|
|
3061
|
+
setBindingName(name: string): this;
|
|
3062
|
+
/**
|
|
3063
|
+
* 设置应用 binding_name 值的 UI 元素属性名称。
|
|
3064
|
+
* @param {string} nameOverride - 应用 binding_name 值的 UI 元素属性名称
|
|
3065
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3066
|
+
*/
|
|
3067
|
+
setBindingNameOverride(nameOverride: string): this;
|
|
3068
|
+
/**
|
|
3069
|
+
* 设置要使用的集合名称。
|
|
3070
|
+
* @param {string} collectionName - 集合名称
|
|
3071
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3072
|
+
*/
|
|
3073
|
+
setBindingCollectionName(collectionName: string): this;
|
|
3074
|
+
/**
|
|
3075
|
+
* 设置集合前缀。
|
|
3076
|
+
* @param {string} prefix - 集合前缀
|
|
3077
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3078
|
+
*/
|
|
3079
|
+
setBindingCollectionPrefix(prefix: string): this;
|
|
3080
|
+
/**
|
|
3081
|
+
* 设置数据绑定的条件。
|
|
3082
|
+
* @param {BindingConditionOrString} condition - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
3083
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3084
|
+
*/
|
|
3085
|
+
setBindingCondition(condition: BindingConditionOrString): this;
|
|
3086
|
+
/**
|
|
3087
|
+
* 设置要观察其属性值的 UI 元素名称。
|
|
3088
|
+
* @param {string} controlName - UI 元素名称
|
|
3089
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3090
|
+
*/
|
|
3091
|
+
setSourceControlName(controlName: string): this;
|
|
3092
|
+
/**
|
|
3093
|
+
* 设置存储 source_control_name 引用的 UI 元素的属性值。
|
|
3094
|
+
* @param {string} propertyName - 属性名称
|
|
3095
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3096
|
+
*/
|
|
3097
|
+
setSourcePropertyName(propertyName: string): this;
|
|
3098
|
+
/**
|
|
3099
|
+
* 设置应用 source_property_name 值的 UI 元素属性。
|
|
3100
|
+
* @param {string} propertyName - 属性名称
|
|
3101
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3102
|
+
*/
|
|
3103
|
+
setTargetPropertyName(propertyName: string): this;
|
|
3104
|
+
/**
|
|
3105
|
+
* 设置是否允许选择同级元素而非子元素。
|
|
3106
|
+
* @param {boolean} resolve - 是否允许选择同级元素(默认值:false)
|
|
3107
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3108
|
+
*/
|
|
3109
|
+
setResolveSiblingScope(resolve?: boolean): this;
|
|
3110
|
+
}
|
|
3111
|
+
|
|
3112
|
+
declare class DataBinding {
|
|
3113
|
+
[key: string]: unknown;
|
|
3114
|
+
bindings: DataBindingObject[];
|
|
3115
|
+
binding: DataBindingObject;
|
|
3116
|
+
setBinding(binding: DataBindingObject): this;
|
|
3117
|
+
addDataBinding(dataBindingObject: DataBindingObject): this;
|
|
2114
3118
|
}
|
|
2115
3119
|
|
|
2116
3120
|
/**
|
|
@@ -2142,190 +3146,165 @@ declare class UISystem {
|
|
|
2142
3146
|
* - grid_position: Vector [row, column] - Position that the control will take inside the grid. This also allows to modify specific grid items of a hardcoded grid
|
|
2143
3147
|
* - collection_index: int - Index that the control takes in the collection
|
|
2144
3148
|
*/
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
* 该类表示一个具有各种属性和方法的 UI 控件元素,用于操作其状态。
|
|
2149
|
-
*
|
|
2150
|
-
* 属性:
|
|
2151
|
-
* - visible: boolean - 控制 UI 元素是否可见(默认值:true)
|
|
2152
|
-
* - enabled: boolean - 如果为 true,且 UI 元素或其任何子元素处于锁定状态,则它们将被锁定(默认值:true)
|
|
2153
|
-
* - layer: int - 相对于父元素的 Z-Index/层级(类似于 CSS 中的 zindex)。较高的层级将渲染在上方(默认值:0)
|
|
2154
|
-
* - alpha: float - 元素的透明度。仅影响 UI 元素本身,其子元素不受影响。如果希望透明度同时应用于父元素和子元素,请使用 propagate_alpha(默认值:1.0)
|
|
2155
|
-
* - propagate_alpha: boolean - 透明度是否应同时应用于父元素及其所有子元素(默认值:false)
|
|
2156
|
-
* - clips_children: boolean - 是否在视觉上和交互上裁剪超出 UI 元素边界的内容(默认值:false)
|
|
2157
|
-
* - allow_clipping: boolean - 是否允许在 UI 元素中启用裁剪。否则,clips_children 将无效(默认值:true)
|
|
2158
|
-
* - clip_offset: Vector [x, y] - 裁剪起始点的偏移量(默认值:[0, 0])
|
|
2159
|
-
* - clip_state_change_event: string - 裁剪状态更改时触发的事件
|
|
2160
|
-
* - enable_scissor_test: boolean - 是否启用裁剪测试(默认值:false)
|
|
2161
|
-
* - property_bag: object - 属性包,包含与数据相关的属性/变量,而不是 UI 元素的实际结构和外观
|
|
2162
|
-
* - selected: boolean - 文本框是否默认被选中
|
|
2163
|
-
* - use_child_anchors: boolean - 是否使用 UI 元素子元素的 anchor_from 和 anchor_to(默认值:false)
|
|
2164
|
-
* - controls: array - 用于向元素添加子元素
|
|
2165
|
-
* - anims: string[] - 动画名称数组
|
|
2166
|
-
* - disable_anim_fast_forward: boolean - 是否禁用动画快进
|
|
2167
|
-
* - animation_reset_name: string - 重置动画的名称
|
|
2168
|
-
* - ignored: boolean - 是否忽略该 UI 元素(默认值:false)
|
|
2169
|
-
* - variables: array 或 object - 一组条件,用于更改变量的值
|
|
2170
|
-
* - modifications: array - 允许修改资源包中的 UI 文件(最底层为原版资源包)
|
|
2171
|
-
* - grid_position: Vector [row, column] - 控件在网格中的位置。此属性还允许修改硬编码网格中的特定网格项
|
|
2172
|
-
* - collection_index: int - 控件在集合中的索引
|
|
2173
|
-
*/
|
|
3149
|
+
|
|
3150
|
+
/** 附加到 Control.controls 的子元素:可序列化元素对象或 JSON UI 控件对象 */
|
|
3151
|
+
type ChildControl = Record<string, unknown>;
|
|
2174
3152
|
declare class Control {
|
|
3153
|
+
[key: string]: unknown;
|
|
3154
|
+
visible: boolean;
|
|
3155
|
+
enabled: boolean;
|
|
3156
|
+
layer: number;
|
|
3157
|
+
alpha: number;
|
|
3158
|
+
propagate_alpha: boolean;
|
|
3159
|
+
clips_children: boolean;
|
|
3160
|
+
allow_clipping: boolean;
|
|
3161
|
+
clip_offset: Offset2;
|
|
3162
|
+
clip_state_change_event: string;
|
|
3163
|
+
enable_scissor_test: boolean;
|
|
3164
|
+
property_bag: JsonUIBag;
|
|
3165
|
+
selected: boolean;
|
|
3166
|
+
use_child_anchors: boolean;
|
|
3167
|
+
controls: ChildControl[];
|
|
3168
|
+
anims: string[];
|
|
3169
|
+
disable_anim_fast_forward: boolean;
|
|
3170
|
+
animation_reset_name: string;
|
|
3171
|
+
ignored: boolean;
|
|
3172
|
+
variables: JsonUIBag;
|
|
3173
|
+
modifications: unknown[];
|
|
3174
|
+
grid_position: Offset2;
|
|
3175
|
+
collection_index: number;
|
|
2175
3176
|
/**
|
|
2176
3177
|
* 设置控件的可见性。
|
|
2177
3178
|
* @param {boolean} visible - 控件是否可见(默认值:true)
|
|
2178
3179
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2179
3180
|
*/
|
|
2180
|
-
setVisible(visible?: boolean):
|
|
2181
|
-
visible: boolean | undefined;
|
|
3181
|
+
setVisible(visible?: boolean): this;
|
|
2182
3182
|
/**
|
|
2183
3183
|
* 设置控件的启用状态。
|
|
2184
3184
|
* @param {boolean} enabled - 控件是否启用(默认值:true)
|
|
2185
3185
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2186
3186
|
*/
|
|
2187
|
-
setEnabled(enabled?: boolean):
|
|
2188
|
-
enabled: boolean | undefined;
|
|
3187
|
+
setEnabled(enabled?: boolean): this;
|
|
2189
3188
|
/**
|
|
2190
3189
|
* 设置控件的层级(z-index)。
|
|
2191
3190
|
* @param {number} layer - 要设置的层级(默认值:0)
|
|
2192
3191
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2193
3192
|
*/
|
|
2194
|
-
setLayer(layer?: number):
|
|
2195
|
-
layer: number | undefined;
|
|
3193
|
+
setLayer(layer?: number): this;
|
|
2196
3194
|
/**
|
|
2197
3195
|
* 设置控件的透明度。
|
|
2198
3196
|
* @param {number} alpha - 要设置的透明度值(默认值:1.0)
|
|
2199
3197
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2200
3198
|
*/
|
|
2201
|
-
setAlpha(alpha?: number):
|
|
2202
|
-
alpha: number | undefined;
|
|
3199
|
+
setAlpha(alpha?: number): this;
|
|
2203
3200
|
/**
|
|
2204
3201
|
* 设置透明度是否应传播到子元素。
|
|
2205
3202
|
* @param {boolean} propagate - 透明度是否应传播(默认值:false)
|
|
2206
3203
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2207
3204
|
*/
|
|
2208
|
-
setPropagateAlpha(propagate?: boolean):
|
|
2209
|
-
propagate_alpha: boolean | undefined;
|
|
3205
|
+
setPropagateAlpha(propagate?: boolean): this;
|
|
2210
3206
|
/**
|
|
2211
3207
|
* 设置控件是否应裁剪其子元素。
|
|
2212
3208
|
* @param {boolean} clips - 控件是否应裁剪其子元素(默认值:false)
|
|
2213
3209
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2214
3210
|
*/
|
|
2215
|
-
setClipsChildren(clips?: boolean):
|
|
2216
|
-
clips_children: boolean | undefined;
|
|
3211
|
+
setClipsChildren(clips?: boolean): this;
|
|
2217
3212
|
/**
|
|
2218
3213
|
* 设置控件是否允许裁剪。
|
|
2219
3214
|
* @param {boolean} allow - 是否允许裁剪(默认值:true)
|
|
2220
3215
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2221
3216
|
*/
|
|
2222
|
-
setAllowClipping(allow?: boolean):
|
|
2223
|
-
allow_clipping: boolean | undefined;
|
|
3217
|
+
setAllowClipping(allow?: boolean): this;
|
|
2224
3218
|
/**
|
|
2225
3219
|
* 设置控件的裁剪偏移量。
|
|
2226
|
-
* @param {
|
|
3220
|
+
* @param {Offset2} offset - 裁剪偏移量,格式为 [x, y](默认值:[0, 0])
|
|
2227
3221
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2228
3222
|
*/
|
|
2229
|
-
setClipOffset(offset?:
|
|
2230
|
-
clip_offset: number[] | undefined;
|
|
3223
|
+
setClipOffset(offset?: Offset2): this;
|
|
2231
3224
|
/**
|
|
2232
3225
|
* 设置裁剪状态更改事件。
|
|
2233
3226
|
* @param {string} event - 裁剪状态更改时触发的事件名称
|
|
2234
3227
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2235
3228
|
*/
|
|
2236
|
-
setClipStateChangeEvent(event: string):
|
|
2237
|
-
clip_state_change_event: string | undefined;
|
|
3229
|
+
setClipStateChangeEvent(event: string): this;
|
|
2238
3230
|
/**
|
|
2239
3231
|
* 设置是否启用裁剪测试。
|
|
2240
3232
|
* @param {boolean} enable - 是否启用裁剪测试(默认值:false)
|
|
2241
3233
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2242
3234
|
*/
|
|
2243
|
-
setEnableScissorTest(enable?: boolean):
|
|
2244
|
-
enable_scissor_test: boolean | undefined;
|
|
3235
|
+
setEnableScissorTest(enable?: boolean): this;
|
|
2245
3236
|
/**
|
|
2246
3237
|
* 设置控件的属性包。
|
|
2247
|
-
* @param {
|
|
3238
|
+
* @param {JsonUIBag} bag - 要设置的属性包
|
|
2248
3239
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2249
3240
|
*/
|
|
2250
|
-
setPropertyBag(bag:
|
|
2251
|
-
property_bag: object | undefined;
|
|
3241
|
+
setPropertyBag(bag: JsonUIBag): this;
|
|
2252
3242
|
/**
|
|
2253
3243
|
* 设置控件是否被选中。
|
|
2254
3244
|
* @param {boolean} selected - 控件是否被选中(默认值:false)
|
|
2255
3245
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2256
3246
|
*/
|
|
2257
|
-
setSelected(selected?: boolean):
|
|
2258
|
-
selected: boolean | undefined;
|
|
3247
|
+
setSelected(selected?: boolean): this;
|
|
2259
3248
|
/**
|
|
2260
3249
|
* 设置控件是否使用子元素的锚点。
|
|
2261
3250
|
* @param {boolean} use - 是否使用子元素的锚点(默认值:false)
|
|
2262
3251
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2263
3252
|
*/
|
|
2264
|
-
setUseChildAnchors(use?: boolean):
|
|
2265
|
-
use_child_anchors: boolean | undefined;
|
|
3253
|
+
setUseChildAnchors(use?: boolean): this;
|
|
2266
3254
|
/**
|
|
2267
3255
|
* 向控件添加子控件。
|
|
2268
|
-
* @param {
|
|
3256
|
+
* @param {ChildControl} control - 要添加的子控件
|
|
2269
3257
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2270
3258
|
*/
|
|
2271
|
-
addControl(control:
|
|
2272
|
-
controls: any[] | undefined;
|
|
3259
|
+
addControl(control: ChildControl): this;
|
|
2273
3260
|
/**
|
|
2274
3261
|
* 设置控件的动画。
|
|
2275
3262
|
* @param {string[]} anims - 动画名称数组
|
|
2276
3263
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2277
3264
|
*/
|
|
2278
|
-
setAnimations(anims: string[]):
|
|
2279
|
-
anims: string[] | undefined;
|
|
3265
|
+
setAnimations(anims: string[]): this;
|
|
2280
3266
|
/**
|
|
2281
3267
|
* 设置是否禁用动画快进。
|
|
2282
3268
|
* @param {boolean} disable - 是否禁用动画快进(默认值:false)
|
|
2283
3269
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2284
3270
|
*/
|
|
2285
|
-
setDisableAnimFastForward(disable?: boolean):
|
|
2286
|
-
disable_anim_fast_forward: boolean | undefined;
|
|
3271
|
+
setDisableAnimFastForward(disable?: boolean): this;
|
|
2287
3272
|
/**
|
|
2288
3273
|
* 设置动画重置名称。
|
|
2289
3274
|
* @param {string} name - 要重置的动画名称
|
|
2290
3275
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2291
3276
|
*/
|
|
2292
|
-
setAnimationResetName(name: string):
|
|
2293
|
-
animation_reset_name: string | undefined;
|
|
3277
|
+
setAnimationResetName(name: string): this;
|
|
2294
3278
|
/**
|
|
2295
3279
|
* 设置是否忽略该控件。
|
|
2296
3280
|
* @param {boolean} ignored - 是否忽略该控件(默认值:false)
|
|
2297
3281
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2298
3282
|
*/
|
|
2299
|
-
setIgnored(ignored?: boolean):
|
|
2300
|
-
ignored: boolean | undefined;
|
|
3283
|
+
setIgnored(ignored?: boolean): this;
|
|
2301
3284
|
/**
|
|
2302
3285
|
* 设置控件的变量。
|
|
2303
|
-
* @param {
|
|
3286
|
+
* @param {JsonUIBag} variables - 要设置的变量
|
|
2304
3287
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2305
3288
|
*/
|
|
2306
|
-
setVariables(variables:
|
|
2307
|
-
variables: object | undefined;
|
|
3289
|
+
setVariables(variables: JsonUIBag): this;
|
|
2308
3290
|
/**
|
|
2309
3291
|
* 设置控件的修改项。
|
|
2310
|
-
* @param {
|
|
3292
|
+
* @param {unknown[]} modifications - 要设置的修改项
|
|
2311
3293
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2312
3294
|
*/
|
|
2313
|
-
setModifications(modifications:
|
|
2314
|
-
modifications: any;
|
|
3295
|
+
setModifications(modifications: unknown[]): this;
|
|
2315
3296
|
/**
|
|
2316
3297
|
* 设置控件在网格中的位置。
|
|
2317
|
-
* @param {
|
|
3298
|
+
* @param {Offset2} position - 网格位置,格式为 [行, 列]
|
|
2318
3299
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2319
3300
|
*/
|
|
2320
|
-
setGridPosition(position:
|
|
2321
|
-
grid_position: number[] | undefined;
|
|
3301
|
+
setGridPosition(position: Offset2): this;
|
|
2322
3302
|
/**
|
|
2323
3303
|
* 设置控件在集合中的索引。
|
|
2324
3304
|
* @param {number} index - 要设置的索引
|
|
2325
3305
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
2326
3306
|
*/
|
|
2327
|
-
setCollectionIndex(index: number):
|
|
2328
|
-
collection_index: number | undefined;
|
|
3307
|
+
setCollectionIndex(index: number): this;
|
|
2329
3308
|
}
|
|
2330
3309
|
|
|
2331
3310
|
/**
|
|
@@ -2347,125 +3326,163 @@ declare class Control {
|
|
|
2347
3326
|
* - draggable: enum - 是否使元素可拖动(可能值:vertical, horizontal, both)
|
|
2348
3327
|
* - follows_cursor: boolean - 是否使元素跟随光标(默认值:false)
|
|
2349
3328
|
*/
|
|
3329
|
+
|
|
3330
|
+
type AnchorOrString = Anchor | string;
|
|
3331
|
+
type SizeOrString = Size2 | string;
|
|
2350
3332
|
declare class Layout {
|
|
3333
|
+
[key: string]: unknown;
|
|
3334
|
+
size: SizeOrString;
|
|
3335
|
+
max_size: Size2;
|
|
3336
|
+
min_size: Size2;
|
|
3337
|
+
offset: Offset2;
|
|
3338
|
+
anchor_from: AnchorOrString;
|
|
3339
|
+
anchor_to: AnchorOrString;
|
|
3340
|
+
inherit_max_sibling_width: boolean;
|
|
3341
|
+
inherit_max_sibling_height: boolean;
|
|
3342
|
+
use_anchored_offset: boolean;
|
|
3343
|
+
contained: boolean;
|
|
3344
|
+
draggable: 'vertical' | 'horizontal' | 'both';
|
|
3345
|
+
follows_cursor: boolean;
|
|
2351
3346
|
/**
|
|
2352
3347
|
* 设置 UI 元素的大小。
|
|
2353
|
-
* @param {
|
|
3348
|
+
* @param {Size2} size - 大小,格式为 [width, height](默认值:["default", "default"])
|
|
2354
3349
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2355
3350
|
*/
|
|
2356
|
-
setSize(size?:
|
|
2357
|
-
size: any[] | undefined;
|
|
3351
|
+
setSize(size?: SizeOrString): this;
|
|
2358
3352
|
/**
|
|
2359
3353
|
* 设置 UI 元素的最大大小。
|
|
2360
|
-
* @param {
|
|
3354
|
+
* @param {Size2} maxSize - 最大大小,格式为 [width, height](默认值:["default", "default"])
|
|
2361
3355
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2362
3356
|
*/
|
|
2363
|
-
setMaxSize(maxSize?:
|
|
2364
|
-
max_size: string[] | undefined;
|
|
3357
|
+
setMaxSize(maxSize?: Size2): this;
|
|
2365
3358
|
/**
|
|
2366
3359
|
* 设置 UI 元素的最小大小。
|
|
2367
|
-
* @param {
|
|
3360
|
+
* @param {Size2} minSize - 最小大小,格式为 [width, height](默认值:["default", "default"])
|
|
2368
3361
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2369
3362
|
*/
|
|
2370
|
-
setMinSize(minSize?:
|
|
2371
|
-
min_size: string[] | undefined;
|
|
3363
|
+
setMinSize(minSize?: Size2): this;
|
|
2372
3364
|
/**
|
|
2373
3365
|
* 设置 UI 元素相对于父元素的位置。
|
|
2374
|
-
* @param {
|
|
3366
|
+
* @param {Offset2} offset - 偏移量,格式为 [x, y](默认值:[0, 0])
|
|
2375
3367
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2376
3368
|
*/
|
|
2377
|
-
setOffset(offset?:
|
|
2378
|
-
offset: number[] | undefined;
|
|
3369
|
+
setOffset(offset?: Offset2): this;
|
|
2379
3370
|
/**
|
|
2380
3371
|
* 设置父元素中的锚点。
|
|
2381
|
-
* @param {
|
|
3372
|
+
* @param {AnchorOrString} anchorFrom - 锚点(可能值:top_left, top_middle, top_right, left_middle, center, right_middle, bottom_left, bottom_middle, bottom_right)(默认值:center)
|
|
2382
3373
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2383
3374
|
*/
|
|
2384
|
-
setAnchorFrom(anchorFrom?:
|
|
2385
|
-
anchor_from: string | undefined;
|
|
3375
|
+
setAnchorFrom(anchorFrom?: AnchorOrString): this;
|
|
2386
3376
|
/**
|
|
2387
3377
|
* 设置元素自身的锚点。
|
|
2388
|
-
* @param {
|
|
3378
|
+
* @param {AnchorOrString} anchorTo - 锚点(可能值:top_left, top_middle, top_right, left_middle, center, right_middle, bottom_left, bottom_middle, bottom_right)(默认值:center)
|
|
2389
3379
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2390
3380
|
*/
|
|
2391
|
-
setAnchorTo(anchorTo?:
|
|
2392
|
-
anchor_to: string | undefined;
|
|
3381
|
+
setAnchorTo(anchorTo?: AnchorOrString): this;
|
|
2393
3382
|
/**
|
|
2394
3383
|
* 设置是否使用兄弟元素的最大宽度。
|
|
2395
3384
|
* @param {boolean} inherit - 是否使用兄弟元素的最大宽度(默认值:false)
|
|
2396
3385
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2397
3386
|
*/
|
|
2398
|
-
setInheritMaxSiblingWidth(inherit?: boolean):
|
|
2399
|
-
inherit_max_sibling_width: boolean | undefined;
|
|
3387
|
+
setInheritMaxSiblingWidth(inherit?: boolean): this;
|
|
2400
3388
|
/**
|
|
2401
3389
|
* 设置是否使用兄弟元素的最大高度。
|
|
2402
3390
|
* @param {boolean} inherit - 是否使用兄弟元素的最大高度(默认值:false)
|
|
2403
3391
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2404
3392
|
*/
|
|
2405
|
-
setInheritMaxSiblingHeight(inherit?: boolean):
|
|
2406
|
-
inherit_max_sibling_height: boolean | undefined;
|
|
3393
|
+
setInheritMaxSiblingHeight(inherit?: boolean): this;
|
|
2407
3394
|
/**
|
|
2408
3395
|
* 设置是否使用基于锚点的偏移。
|
|
2409
3396
|
* @param {boolean} use - 是否使用基于锚点的偏移(默认值:false)
|
|
2410
3397
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2411
3398
|
*/
|
|
2412
|
-
setUseAnchoredOffset(use?: boolean):
|
|
2413
|
-
use_anchored_offset: boolean | undefined;
|
|
3399
|
+
setUseAnchoredOffset(use?: boolean): this;
|
|
2414
3400
|
/**
|
|
2415
3401
|
* 设置是否限制元素在父元素边界内。
|
|
2416
3402
|
* @param {boolean} contained - 是否限制元素在父元素边界内(默认值:false)
|
|
2417
3403
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2418
3404
|
*/
|
|
2419
|
-
setContained(contained?: boolean):
|
|
2420
|
-
contained: boolean | undefined;
|
|
3405
|
+
setContained(contained?: boolean): this;
|
|
2421
3406
|
/**
|
|
2422
3407
|
* 设置是否使元素可拖动。
|
|
2423
|
-
* @param {
|
|
3408
|
+
* @param {'vertical' | 'horizontal' | 'both'} draggable - 是否使元素可拖动(可能值:vertical, horizontal, both)
|
|
2424
3409
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2425
3410
|
*/
|
|
2426
|
-
setDraggable(draggable:
|
|
2427
|
-
draggable: string | undefined;
|
|
3411
|
+
setDraggable(draggable: 'vertical' | 'horizontal' | 'both'): this;
|
|
2428
3412
|
/**
|
|
2429
3413
|
* 设置是否使元素跟随光标。
|
|
2430
3414
|
* @param {boolean} follows - 是否使元素跟随光标(默认值:false)
|
|
2431
3415
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2432
3416
|
*/
|
|
2433
|
-
setFollowsCursor(follows?: boolean):
|
|
2434
|
-
follows_cursor: boolean | undefined;
|
|
3417
|
+
setFollowsCursor(follows?: boolean): this;
|
|
2435
3418
|
}
|
|
2436
3419
|
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
3420
|
+
/**
|
|
3421
|
+
* Elements
|
|
3422
|
+
A JSON UI element is the basic form of data within JSON UI. Elements must have a unique name for each namespace so as to not have a conflict with other elements of the same name yet may have different functions.
|
|
3423
|
+
|
|
3424
|
+
Here the element type is label so it will render a text of Hello World when called:
|
|
3425
|
+
|
|
3426
|
+
vanilla/ui/example_file.json
|
|
3427
|
+
|
|
3428
|
+
{
|
|
3429
|
+
"test_element": {
|
|
3430
|
+
"type": "label",
|
|
3431
|
+
"text": "Hello World"
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
Types
|
|
3435
|
+
The following are some of the element types, which are possible values for the type property:
|
|
2443
3436
|
|
|
3437
|
+
label - for creating text objects
|
|
3438
|
+
image - for rendering images from a filepath provided
|
|
3439
|
+
button - for creating interactive and clickable elements
|
|
3440
|
+
panel - an empty container where you can store all other elements that may overlap to each other
|
|
3441
|
+
stack_panel - an empty container where you can store all other elements in a stack that doesn't overlap to each other
|
|
3442
|
+
grid - uses another element as a template, and then renders it repeatedly in multiple rows and columns
|
|
3443
|
+
factory - renders an element based off of another element, is capable of calling hardcoded values and variables
|
|
3444
|
+
custom - is paired with another property renderer which renders hardcoded JSON UI elements
|
|
3445
|
+
screen - elements that are called by the game directly, usually root panel elements
|
|
3446
|
+
*/
|
|
3447
|
+
|
|
3448
|
+
type SerializedElement = Record<string, JsonUIBag>;
|
|
3449
|
+
type AnyJSON = any;
|
|
2444
3450
|
declare class UIElement {
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
name: any;
|
|
3451
|
+
type: string | undefined;
|
|
3452
|
+
id: string;
|
|
3453
|
+
name: string;
|
|
2449
3454
|
control: Control;
|
|
2450
3455
|
layout: Layout;
|
|
2451
|
-
properties: Map<
|
|
2452
|
-
variables: Map<
|
|
3456
|
+
properties: Map<string, AnyJSON>;
|
|
3457
|
+
variables: Map<string, AnyJSON>;
|
|
2453
3458
|
dataBinding: DataBinding;
|
|
2454
|
-
modifications:
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
3459
|
+
modifications: {
|
|
3460
|
+
array_name: string;
|
|
3461
|
+
operation: ModificationOperation;
|
|
3462
|
+
value: AnyJSON;
|
|
3463
|
+
}[];
|
|
3464
|
+
constructor(name: string, type?: string, template?: string);
|
|
3465
|
+
enableDebug(color?: [number, number, number, number]): this;
|
|
3466
|
+
setLayout(layout: Layout): this;
|
|
3467
|
+
setControl(control: Control): this;
|
|
3468
|
+
addControl(control: UIElement | JsonUIBag): this;
|
|
3469
|
+
addControls(controls: (UIElement | JsonUIBag)[]): this;
|
|
3470
|
+
addVariable(name: string, value: AnyJSON): this;
|
|
3471
|
+
addProp(name: string, value: AnyJSON): this;
|
|
3472
|
+
addModification(modification: {
|
|
3473
|
+
array_name: string;
|
|
3474
|
+
operation: ModificationOperation;
|
|
3475
|
+
value: AnyJSON;
|
|
3476
|
+
}): this;
|
|
3477
|
+
/**
|
|
3478
|
+
* 声明待序列化合并的属性包(子类覆写以加入自己的专属属性包)。
|
|
3479
|
+
* 合并顺序对结果无影响:重复键值均相同。
|
|
3480
|
+
*/
|
|
3481
|
+
protected serializableSources(): object[];
|
|
3482
|
+
serialize(): SerializedElement;
|
|
2466
3483
|
}
|
|
2467
3484
|
/**
|
|
2468
|
-
* Modifications
|
|
3485
|
+
* Modifications
|
|
2469
3486
|
To modify JSON UI in a non-intrusive way, you can use the modifications property to modify previously existing JSON UI elements from other packs (usually vanilla JSON UI files). Doing this makes sure only necessary parts are modified unless otherwise intended, to improve compatibility with other packs that modify the JSON UI.
|
|
2470
3487
|
|
|
2471
3488
|
Modification Description
|
|
@@ -2483,17 +3500,17 @@ declare class UIElement {
|
|
|
2483
3500
|
*/
|
|
2484
3501
|
declare class Modifications {
|
|
2485
3502
|
static OPERATION: Readonly<{
|
|
2486
|
-
INSERT_BACK: "insert_back";
|
|
2487
|
-
INSERT_FRONT: "insert_front";
|
|
2488
|
-
INSERT_AFTER: "insert_after";
|
|
2489
|
-
INSERT_BEFORE: "insert_before";
|
|
2490
|
-
MOVE_BACK: "move_back";
|
|
2491
|
-
MOVE_FRONT: "move_front";
|
|
2492
|
-
MOVE_AFTER: "move_after";
|
|
2493
|
-
MOVE_BEFORE: "move_before";
|
|
2494
|
-
SWAP: "swap";
|
|
2495
|
-
REPLACE: "replace";
|
|
2496
|
-
REMOVE: "remove";
|
|
3503
|
+
readonly INSERT_BACK: "insert_back";
|
|
3504
|
+
readonly INSERT_FRONT: "insert_front";
|
|
3505
|
+
readonly INSERT_AFTER: "insert_after";
|
|
3506
|
+
readonly INSERT_BEFORE: "insert_before";
|
|
3507
|
+
readonly MOVE_BACK: "move_back";
|
|
3508
|
+
readonly MOVE_FRONT: "move_front";
|
|
3509
|
+
readonly MOVE_AFTER: "move_after";
|
|
3510
|
+
readonly MOVE_BEFORE: "move_before";
|
|
3511
|
+
readonly SWAP: "swap";
|
|
3512
|
+
readonly REPLACE: "replace";
|
|
3513
|
+
readonly REMOVE: "remove";
|
|
2497
3514
|
}>;
|
|
2498
3515
|
}
|
|
2499
3516
|
|
|
@@ -2506,44 +3523,46 @@ declare class Modifications {
|
|
|
2506
3523
|
* - control_name: string - 工厂的子控件名
|
|
2507
3524
|
* - control_ids: object - 工厂的子控件 ID 对象组
|
|
2508
3525
|
*/
|
|
3526
|
+
|
|
2509
3527
|
declare class Factory {
|
|
3528
|
+
[key: string]: unknown;
|
|
3529
|
+
factory: JsonUIBag;
|
|
2510
3530
|
/**
|
|
2511
3531
|
* 设置工厂的名。
|
|
2512
3532
|
* @param {string} name - 名(格式:name)
|
|
2513
3533
|
* @returns {Factory} 返回当前实例以支持链式调用
|
|
2514
3534
|
*/
|
|
2515
|
-
setName(name: string):
|
|
2516
|
-
factory: {} | undefined;
|
|
3535
|
+
setName(name: string): this;
|
|
2517
3536
|
/**
|
|
2518
3537
|
* 设置工厂的子控件名。
|
|
2519
3538
|
* @param {string} name - 子控件名(格式:namespace.controls_name)
|
|
2520
3539
|
* @returns {Factory} 返回当前实例以支持链式调用
|
|
2521
3540
|
*/
|
|
2522
|
-
setControlName(name: string):
|
|
3541
|
+
setControlName(name: string): this;
|
|
2523
3542
|
/**
|
|
2524
3543
|
* 设置工厂的子控件 ID 对象组。
|
|
2525
|
-
* @param {
|
|
3544
|
+
* @param {JsonUIBag} ids - 子控件 ID 对象组
|
|
2526
3545
|
* @returns {Factory} 返回当前实例以支持链式调用
|
|
2527
3546
|
*/
|
|
2528
|
-
setControlIds(ids:
|
|
3547
|
+
setControlIds(ids: JsonUIBag): this;
|
|
2529
3548
|
/**
|
|
2530
3549
|
* 添加一个子控件 ID。
|
|
2531
3550
|
* @param {string} key - 子控件的键名
|
|
2532
3551
|
* @param {string} value - 子控件的 ID 值
|
|
2533
3552
|
* @returns {Factory} 返回当前实例以支持链式调用
|
|
2534
3553
|
*/
|
|
2535
|
-
addControlId(key: string, value: string):
|
|
3554
|
+
addControlId(key: string, value: string): this;
|
|
2536
3555
|
}
|
|
2537
3556
|
|
|
2538
3557
|
declare class Panel extends UIElement {
|
|
3558
|
+
factory: Factory;
|
|
2539
3559
|
/**
|
|
2540
|
-
*
|
|
2541
|
-
* @param {
|
|
2542
|
-
* @param {*} [template]
|
|
3560
|
+
* @param {string} id
|
|
3561
|
+
* @param {string} [template]
|
|
2543
3562
|
*/
|
|
2544
|
-
constructor(id:
|
|
2545
|
-
|
|
2546
|
-
|
|
3563
|
+
constructor(id: string, template?: string);
|
|
3564
|
+
setLayout(layout: Layout): this;
|
|
3565
|
+
protected serializableSources(): object[];
|
|
2547
3566
|
}
|
|
2548
3567
|
|
|
2549
3568
|
/**
|
|
@@ -2572,147 +3591,152 @@ declare class Panel extends UIElement {
|
|
|
2572
3591
|
* - force_texture_reload: boolean - 是否在纹理路径更改时强制重新加载图像
|
|
2573
3592
|
* - base_size: Vector [width, height] - 基础大小
|
|
2574
3593
|
*/
|
|
3594
|
+
type UV = [number, number];
|
|
3595
|
+
type ClipDirection = 'left' | 'right' | 'up' | 'down' | 'center';
|
|
3596
|
+
type TextureFileSystem = 'InUserPackage' | 'InAppPackage' | 'RawPath' | 'RawPersistent' | 'InSettingsDir' | 'InExternalDir' | 'InServerPackage' | 'InDataDir' | 'InUserDir' | 'InWorldDir' | 'StoreCache' | string;
|
|
2575
3597
|
declare class Sprite {
|
|
3598
|
+
[key: string]: unknown;
|
|
3599
|
+
texture: string;
|
|
3600
|
+
allow_debug_missing_texture: boolean;
|
|
3601
|
+
uv: UV;
|
|
3602
|
+
uv_size: UV;
|
|
3603
|
+
texture_file_system: TextureFileSystem;
|
|
3604
|
+
nineslice_size: number | [number, number, number, number];
|
|
3605
|
+
tiled: boolean | 'x' | 'y';
|
|
3606
|
+
tiled_scale: [number, number];
|
|
3607
|
+
clip_direction: ClipDirection | string;
|
|
3608
|
+
clip_ratio: number;
|
|
3609
|
+
clip_pixelperfect: boolean;
|
|
3610
|
+
keep_ratio: boolean;
|
|
3611
|
+
bilinear: boolean;
|
|
3612
|
+
fill: boolean;
|
|
3613
|
+
$fit_to_width: boolean;
|
|
3614
|
+
zip_folder: string;
|
|
3615
|
+
grayscale: boolean;
|
|
3616
|
+
force_texture_reload: boolean;
|
|
3617
|
+
base_size: [number, number];
|
|
2576
3618
|
/**
|
|
2577
3619
|
* 设置图像纹理路径。
|
|
2578
3620
|
* @param {string} texture - 图像路径(例如:"textures/ui/White")
|
|
2579
3621
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2580
3622
|
*/
|
|
2581
|
-
setTexture(texture: string):
|
|
2582
|
-
texture: string | undefined;
|
|
3623
|
+
setTexture(texture: string): this;
|
|
2583
3624
|
/**
|
|
2584
3625
|
* 设置是否在纹理未找到时显示缺失纹理。
|
|
2585
3626
|
* @param {boolean} allow - 是否显示缺失纹理(默认值:true)
|
|
2586
3627
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2587
3628
|
*/
|
|
2588
|
-
setAllowDebugMissingTexture(allow?: boolean):
|
|
2589
|
-
allow_debug_missing_texture: boolean | undefined;
|
|
3629
|
+
setAllowDebugMissingTexture(allow?: boolean): this;
|
|
2590
3630
|
/**
|
|
2591
3631
|
* 设置纹理映射的起始位置。
|
|
2592
|
-
* @param {
|
|
3632
|
+
* @param {UV} uv - 起始位置,格式为 [u, v]
|
|
2593
3633
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2594
3634
|
*/
|
|
2595
|
-
setUV(uv:
|
|
2596
|
-
uv: number[] | undefined;
|
|
3635
|
+
setUV(uv: UV): this;
|
|
2597
3636
|
/**
|
|
2598
3637
|
* 设置纹理映射的大小。
|
|
2599
|
-
* @param {
|
|
3638
|
+
* @param {UV} uvSize - 大小,格式为 [width, height]
|
|
2600
3639
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2601
3640
|
*/
|
|
2602
|
-
setUVSize(uvSize:
|
|
2603
|
-
uv_size: number[] | undefined;
|
|
3641
|
+
setUVSize(uvSize: UV): this;
|
|
2604
3642
|
/**
|
|
2605
3643
|
* 设置纹理来源。
|
|
2606
|
-
* @param {
|
|
3644
|
+
* @param {TextureFileSystem} source - 纹理来源(可能值:InUserPackage, InAppPackage 等)
|
|
2607
3645
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2608
3646
|
*/
|
|
2609
|
-
setTextureFileSystem(source?:
|
|
2610
|
-
texture_file_system: string | undefined;
|
|
3647
|
+
setTextureFileSystem(source?: TextureFileSystem): this;
|
|
2611
3648
|
/**
|
|
2612
3649
|
* 设置 9-slice 分割大小。
|
|
2613
|
-
* @param {number|number
|
|
3650
|
+
* @param {number | [number, number, number, number]} size - 9-slice 分割大小
|
|
2614
3651
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2615
3652
|
*/
|
|
2616
|
-
setNineSliceSize(size: number | number
|
|
2617
|
-
nineslice_size: number | number[] | undefined;
|
|
3653
|
+
setNineSliceSize(size: number | [number, number, number, number]): this;
|
|
2618
3654
|
/**
|
|
2619
3655
|
* 设置是否平铺纹理。
|
|
2620
|
-
* @param {boolean|
|
|
3656
|
+
* @param {boolean | 'x' | 'y'} tiled - 是否平铺纹理(可能值:true/false, x, y)
|
|
2621
3657
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2622
3658
|
*/
|
|
2623
|
-
setTiled(tiled: boolean |
|
|
2624
|
-
tiled: string | boolean | undefined;
|
|
3659
|
+
setTiled(tiled: boolean | 'x' | 'y'): this;
|
|
2625
3660
|
/**
|
|
2626
3661
|
* 设置平铺纹理的缩放比例。
|
|
2627
|
-
* @param {number
|
|
3662
|
+
* @param {[number, number]} scale - 缩放比例,格式为 [sX, sY](默认值:[1, 1])
|
|
2628
3663
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2629
3664
|
*/
|
|
2630
|
-
setTiledScale(scale?: number
|
|
2631
|
-
tiled_scale: number[] | undefined;
|
|
3665
|
+
setTiledScale(scale?: [number, number]): this;
|
|
2632
3666
|
/**
|
|
2633
3667
|
* 设置裁剪方向的起始点。
|
|
2634
|
-
* @param {
|
|
3668
|
+
* @param {ClipDirection} direction - 裁剪方向(可能值:left, right, up, down, center)
|
|
2635
3669
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2636
3670
|
*/
|
|
2637
|
-
setClipDirection(direction: string):
|
|
2638
|
-
clip_direction: string | undefined;
|
|
3671
|
+
setClipDirection(direction: ClipDirection | string): this;
|
|
2639
3672
|
/**
|
|
2640
3673
|
* 设置裁剪比例。
|
|
2641
3674
|
* @param {number} ratio - 裁剪比例(范围:0.0 到 1.0)
|
|
2642
3675
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2643
3676
|
*/
|
|
2644
|
-
setClipRatio(ratio: number):
|
|
2645
|
-
clip_ratio: number | undefined;
|
|
3677
|
+
setClipRatio(ratio: number): this;
|
|
2646
3678
|
/**
|
|
2647
3679
|
* 设置是否尽可能保持像素精确裁剪。
|
|
2648
3680
|
* @param {boolean} pixelPerfect - 是否保持像素精确裁剪
|
|
2649
3681
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2650
3682
|
*/
|
|
2651
|
-
setClipPixelPerfect(pixelPerfect?: boolean):
|
|
2652
|
-
clip_pixelperfect: boolean | undefined;
|
|
3683
|
+
setClipPixelPerfect(pixelPerfect?: boolean): this;
|
|
2653
3684
|
/**
|
|
2654
3685
|
* 设置是否在调整大小时保持比例。
|
|
2655
3686
|
* @param {boolean} keep - 是否保持比例(默认值:true)
|
|
2656
3687
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2657
3688
|
*/
|
|
2658
|
-
setKeepRatio(keep?: boolean):
|
|
2659
|
-
keep_ratio: boolean | undefined;
|
|
3689
|
+
setKeepRatio(keep?: boolean): this;
|
|
2660
3690
|
/**
|
|
2661
3691
|
* 设置是否在调整大小时使用双线性函数。
|
|
2662
3692
|
* @param {boolean} bilinear - 是否使用双线性函数(默认值:false)
|
|
2663
3693
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2664
3694
|
*/
|
|
2665
|
-
setBilinear(bilinear?: boolean):
|
|
2666
|
-
bilinear: boolean | undefined;
|
|
3695
|
+
setBilinear(bilinear?: boolean): this;
|
|
2667
3696
|
/**
|
|
2668
3697
|
* 设置是否拉伸图像以适应大小。
|
|
2669
3698
|
* @param {boolean} fill - 是否拉伸图像(默认值:false)
|
|
2670
3699
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2671
3700
|
*/
|
|
2672
|
-
setFill(fill?: boolean):
|
|
2673
|
-
fill: boolean | undefined;
|
|
3701
|
+
setFill(fill?: boolean): this;
|
|
2674
3702
|
/**
|
|
2675
3703
|
* 设置是否适应宽度。
|
|
2676
3704
|
* @param {boolean} fit - 是否适应宽度
|
|
2677
3705
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2678
3706
|
*/
|
|
2679
|
-
setFitToWidth(fit?: boolean):
|
|
2680
|
-
$fit_to_width: boolean | undefined;
|
|
3707
|
+
setFitToWidth(fit?: boolean): this;
|
|
2681
3708
|
/**
|
|
2682
3709
|
* 设置压缩文件夹路径。
|
|
2683
3710
|
* @param {string} folder - 压缩文件夹路径
|
|
2684
3711
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2685
3712
|
*/
|
|
2686
|
-
setZipFolder(folder: string):
|
|
2687
|
-
zip_folder: string | undefined;
|
|
3713
|
+
setZipFolder(folder: string): this;
|
|
2688
3714
|
/**
|
|
2689
3715
|
* 设置是否以黑白渲染图像。
|
|
2690
3716
|
* @param {boolean} grayscale - 是否以黑白渲染图像(默认值:false)
|
|
2691
3717
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2692
3718
|
*/
|
|
2693
|
-
setGrayscale(grayscale?: boolean):
|
|
2694
|
-
grayscale: boolean | undefined;
|
|
3719
|
+
setGrayscale(grayscale?: boolean): this;
|
|
2695
3720
|
/**
|
|
2696
3721
|
* 设置是否在纹理路径更改时强制重新加载图像。
|
|
2697
|
-
* @param {boolean} force -
|
|
3722
|
+
* @param {boolean} force - 是否强制重新加载图像(默认值:false)
|
|
2698
3723
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2699
3724
|
*/
|
|
2700
|
-
setForceTextureReload(force?: boolean):
|
|
2701
|
-
force_texture_reload: boolean | undefined;
|
|
3725
|
+
setForceTextureReload(force?: boolean): this;
|
|
2702
3726
|
/**
|
|
2703
3727
|
* 设置基础大小。
|
|
2704
|
-
* @param {number
|
|
3728
|
+
* @param {[number, number]} size - 基础大小,格式为 [width, height]
|
|
2705
3729
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2706
3730
|
*/
|
|
2707
|
-
setBaseSize(size: number
|
|
2708
|
-
base_size: number[] | undefined;
|
|
3731
|
+
setBaseSize(size: [number, number]): this;
|
|
2709
3732
|
}
|
|
2710
3733
|
|
|
2711
3734
|
declare class Image extends UIElement {
|
|
2712
|
-
constructor(id: any, template: any);
|
|
2713
3735
|
sprite: Sprite;
|
|
2714
3736
|
factory: Factory;
|
|
2715
|
-
|
|
3737
|
+
constructor(id: string, template?: string);
|
|
3738
|
+
setSprite(sprite: Sprite): this;
|
|
3739
|
+
protected serializableSources(): object[];
|
|
2716
3740
|
}
|
|
2717
3741
|
|
|
2718
3742
|
/**
|
|
@@ -2737,126 +3761,131 @@ declare class Image extends UIElement {
|
|
|
2737
3761
|
* - backup_font_type: enum - 备用字体类型(默认值:default)
|
|
2738
3762
|
* - text_alignment: enum - 文本对齐方式(未定义时根据 anchor_from 和 anchor_to 自动调整)
|
|
2739
3763
|
*/
|
|
3764
|
+
type RGB = [number, number, number];
|
|
3765
|
+
type FontSize = 'small' | 'normal' | 'large' | 'extra_large';
|
|
3766
|
+
type TextAlignment = 'left' | 'right' | 'center';
|
|
2740
3767
|
declare class Text {
|
|
3768
|
+
[key: string]: unknown;
|
|
3769
|
+
text: string;
|
|
3770
|
+
color: RGB;
|
|
3771
|
+
locked_color: RGB;
|
|
3772
|
+
shadow: boolean;
|
|
3773
|
+
hide_hyphen: boolean;
|
|
3774
|
+
notify_on_ellipses: string[];
|
|
3775
|
+
enable_profanity_filter: boolean;
|
|
3776
|
+
locked_alpha: number;
|
|
3777
|
+
font_size: FontSize;
|
|
3778
|
+
font_scale_factor: number;
|
|
3779
|
+
localize: boolean;
|
|
3780
|
+
line_padding: number;
|
|
3781
|
+
font_type: string;
|
|
3782
|
+
backup_font_type: string;
|
|
3783
|
+
text_alignment: TextAlignment;
|
|
2741
3784
|
/**
|
|
2742
3785
|
* 设置文本内容。
|
|
2743
3786
|
* @param {string} text - 文本内容
|
|
2744
3787
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2745
3788
|
*/
|
|
2746
|
-
setText(text?: string):
|
|
2747
|
-
text: string | undefined;
|
|
3789
|
+
setText(text?: string): this;
|
|
2748
3790
|
/**
|
|
2749
3791
|
* 设置文本颜色。
|
|
2750
|
-
* @param {
|
|
3792
|
+
* @param {RGB} color - RGB 颜色值(格式:[r, g, b],默认值:[1.0, 1.0, 1.0])
|
|
2751
3793
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2752
3794
|
*/
|
|
2753
|
-
setColor(color?:
|
|
2754
|
-
color: number[] | undefined;
|
|
3795
|
+
setColor(color?: RGB): this;
|
|
2755
3796
|
/**
|
|
2756
3797
|
* 设置父级禁用时的文本颜色。
|
|
2757
|
-
* @param {
|
|
3798
|
+
* @param {RGB} lockedColor - RGB 颜色值(格式:[r, g, b])
|
|
2758
3799
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2759
3800
|
*/
|
|
2760
|
-
setLockedColor(lockedColor:
|
|
2761
|
-
locked_color: number[] | undefined;
|
|
3801
|
+
setLockedColor(lockedColor: RGB): this;
|
|
2762
3802
|
/**
|
|
2763
3803
|
* 设置是否显示文本阴影。
|
|
2764
3804
|
* @param {boolean} shadow - 是否显示阴影(默认值:false)
|
|
2765
3805
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2766
3806
|
*/
|
|
2767
|
-
setShadow(shadow?: boolean):
|
|
2768
|
-
shadow: boolean | undefined;
|
|
3807
|
+
setShadow(shadow?: boolean): this;
|
|
2769
3808
|
/**
|
|
2770
3809
|
* 设置是否隐藏断词连字符。
|
|
2771
3810
|
* @param {boolean} hide - 是否隐藏连字符(默认值:false)
|
|
2772
3811
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2773
3812
|
*/
|
|
2774
|
-
setHideHyphen(hide?: boolean):
|
|
2775
|
-
hide_hyphen: boolean | undefined;
|
|
3813
|
+
setHideHyphen(hide?: boolean): this;
|
|
2776
3814
|
/**
|
|
2777
3815
|
* 设置文本出现省略号时需通知的控件名称数组。
|
|
2778
3816
|
* @param {string[]} controls - 控件名称数组
|
|
2779
3817
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2780
3818
|
*/
|
|
2781
|
-
setNotifyOnEllipses(controls: string[]):
|
|
2782
|
-
notify_on_ellipses: string[] | undefined;
|
|
3819
|
+
setNotifyOnEllipses(controls: string[]): this;
|
|
2783
3820
|
/**
|
|
2784
3821
|
* 添加一个需通知省略号事件的控件名称。
|
|
2785
3822
|
* @param {string} controlName - 控件名称
|
|
2786
3823
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2787
3824
|
*/
|
|
2788
|
-
addNotifyOnEllipses(controlName: string):
|
|
3825
|
+
addNotifyOnEllipses(controlName: string): this;
|
|
2789
3826
|
/**
|
|
2790
3827
|
* 设置是否启用脏话过滤。
|
|
2791
3828
|
* @param {boolean} enable - 是否启用过滤(默认值:false)
|
|
2792
3829
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2793
3830
|
*/
|
|
2794
|
-
setEnableProfanityFilter(enable?: boolean):
|
|
2795
|
-
enable_profanity_filter: boolean | undefined;
|
|
3831
|
+
setEnableProfanityFilter(enable?: boolean): this;
|
|
2796
3832
|
/**
|
|
2797
3833
|
* 设置父级禁用时的透明度。
|
|
2798
3834
|
* @param {number} alpha - 透明度(范围:0.0 到 1.0)
|
|
2799
3835
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2800
3836
|
*/
|
|
2801
|
-
setLockedAlpha(alpha: number):
|
|
2802
|
-
locked_alpha: number | undefined;
|
|
3837
|
+
setLockedAlpha(alpha: number): this;
|
|
2803
3838
|
/**
|
|
2804
3839
|
* 设置字体大小。
|
|
2805
|
-
* @param {
|
|
3840
|
+
* @param {FontSize} size - 字体大小(可能值:small, normal, large, extra_large,默认值:normal)
|
|
2806
3841
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2807
3842
|
*/
|
|
2808
|
-
setFontSize(size?:
|
|
2809
|
-
font_size: string | undefined;
|
|
3843
|
+
setFontSize(size?: FontSize): this;
|
|
2810
3844
|
/**
|
|
2811
3845
|
* 设置字体缩放比例。
|
|
2812
3846
|
* @param {number} factor - 缩放比例(默认值:1.0)
|
|
2813
3847
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2814
3848
|
*/
|
|
2815
|
-
setFontScaleFactor(factor?: number):
|
|
2816
|
-
font_scale_factor: number | undefined;
|
|
3849
|
+
setFontScaleFactor(factor?: number): this;
|
|
2817
3850
|
/**
|
|
2818
3851
|
* 设置是否启用本地化翻译。
|
|
2819
3852
|
* @param {boolean} localize - 是否启用本地化(默认值:false)
|
|
2820
3853
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2821
3854
|
*/
|
|
2822
|
-
setLocalize(localize?: boolean):
|
|
2823
|
-
localize: boolean | undefined;
|
|
3855
|
+
setLocalize(localize?: boolean): this;
|
|
2824
3856
|
/**
|
|
2825
3857
|
* 设置行间距。
|
|
2826
3858
|
* @param {number} padding - 行间距
|
|
2827
3859
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2828
3860
|
*/
|
|
2829
|
-
setLinePadding(padding: number):
|
|
2830
|
-
line_padding: number | undefined;
|
|
3861
|
+
setLinePadding(padding: number): this;
|
|
2831
3862
|
/**
|
|
2832
3863
|
* 设置字体类型。
|
|
2833
3864
|
* @param {string} font - 字体类型(可能值:default, rune, unicode 等,默认值:default)
|
|
2834
3865
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2835
3866
|
*/
|
|
2836
|
-
setFontType(font?: string):
|
|
2837
|
-
font_type: string | undefined;
|
|
3867
|
+
setFontType(font?: string): this;
|
|
2838
3868
|
/**
|
|
2839
3869
|
* 设置备用字体类型。
|
|
2840
3870
|
* @param {string} backupFont - 备用字体类型(默认值:default)
|
|
2841
3871
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2842
3872
|
*/
|
|
2843
|
-
setBackupFontType(backupFont?: string):
|
|
2844
|
-
backup_font_type: string | undefined;
|
|
3873
|
+
setBackupFontType(backupFont?: string): this;
|
|
2845
3874
|
/**
|
|
2846
3875
|
* 设置文本对齐方式。
|
|
2847
|
-
* @param {
|
|
3876
|
+
* @param {TextAlignment} alignment - 对齐方式(例如:left, right, center)
|
|
2848
3877
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
2849
3878
|
*/
|
|
2850
|
-
setTextAlignment(alignment:
|
|
2851
|
-
text_alignment: string | undefined;
|
|
3879
|
+
setTextAlignment(alignment: TextAlignment): this;
|
|
2852
3880
|
}
|
|
2853
3881
|
|
|
2854
3882
|
declare class Label extends UIElement {
|
|
2855
|
-
constructor(id: any, template: any);
|
|
2856
3883
|
text: Text;
|
|
2857
3884
|
factory: Factory;
|
|
2858
|
-
|
|
2859
|
-
|
|
3885
|
+
constructor(id: string, template?: string);
|
|
3886
|
+
setLayout(layout: Layout): this;
|
|
3887
|
+
setText(text: Text): this;
|
|
3888
|
+
protected serializableSources(): object[];
|
|
2860
3889
|
}
|
|
2861
3890
|
|
|
2862
3891
|
declare namespace UiAPI {
|
|
@@ -2870,129 +3899,354 @@ declare namespace UiAPI {
|
|
|
2870
3899
|
declare class ItemComponent {
|
|
2871
3900
|
/**
|
|
2872
3901
|
* 设置交互按钮
|
|
2873
|
-
* @param
|
|
3902
|
+
* @param interact_text 交互文本;传 true 使用通用 "Use Item" 文案,传 false 不显示
|
|
2874
3903
|
* @returns 交互按钮组件
|
|
2875
3904
|
*/
|
|
2876
|
-
static setInteractButton(interact_text: string):
|
|
3905
|
+
static setInteractButton(interact_text: string | boolean): ItemComponentMap;
|
|
2877
3906
|
/**
|
|
2878
3907
|
* 自定义物品组件
|
|
2879
3908
|
* [warning] 需要物品格式版本 format_version >1.21.90 and Scripting V2.0.0
|
|
2880
|
-
* @param
|
|
2881
|
-
* @param
|
|
2882
|
-
* @returns
|
|
3909
|
+
* @param component_id 组件标识符
|
|
3910
|
+
* @param params 自定义参数接口对象
|
|
3911
|
+
* @returns 物品组件 Map
|
|
2883
3912
|
*/
|
|
2884
|
-
static setCustomComponentV2(component_id: string, params: object):
|
|
3913
|
+
static setCustomComponentV2(component_id: string, params: object): ItemComponentMap;
|
|
2885
3914
|
/**
|
|
2886
3915
|
* 物品的耐久度组件
|
|
2887
|
-
* @param
|
|
2888
|
-
* @param
|
|
2889
|
-
* @param
|
|
2890
|
-
* @returns
|
|
2891
|
-
*/
|
|
2892
|
-
static setDurability(max_durability: number, damage_chance_min?: number, damage_chance_max?: number):
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
3916
|
+
* @param max_durability 最大耐久
|
|
3917
|
+
* @param damage_chance_min 损坏最小几率
|
|
3918
|
+
* @param damage_chance_max 损坏最大几率
|
|
3919
|
+
* @returns 耐久度组件 Map
|
|
3920
|
+
*/
|
|
3921
|
+
static setDurability(max_durability: number, damage_chance_min?: number, damage_chance_max?: number): ItemComponentMap;
|
|
3922
|
+
/**
|
|
3923
|
+
* 设置放置方块组件
|
|
3924
|
+
* @param block 被放置的方块标识符
|
|
3925
|
+
* @param options 放置配置
|
|
3926
|
+
* @param options.replaceBlockItem 是否替换原方块物品
|
|
3927
|
+
* @param options.alignedPlacement 是否启用对齐放置
|
|
3928
|
+
* @param options.useOn 允许放置的目标方块描述符列表;省略则可放置于任何方块
|
|
3929
|
+
* @returns 组件 Map
|
|
3930
|
+
*/
|
|
3931
|
+
static setBlockPlacer(block: string, options?: BlockPlacerOptions): ItemComponentMap;
|
|
3932
|
+
/**
|
|
3933
|
+
* 设置自定义组件列表
|
|
3934
|
+
* @param custom_components 自定义组件 ID 数组
|
|
3935
|
+
* @returns 组件 Map
|
|
3936
|
+
*/
|
|
3937
|
+
static setCustomComponents(custom_components: string[]): ItemComponentMap;
|
|
2900
3938
|
/**
|
|
2901
3939
|
* 设置物品的可投掷组件。
|
|
2902
|
-
* @param
|
|
2903
|
-
* @param
|
|
2904
|
-
* @param
|
|
2905
|
-
* @param
|
|
2906
|
-
* @param
|
|
2907
|
-
* @param
|
|
2908
|
-
* @returns
|
|
3940
|
+
* @param doSwingAnimation 是否使用挥动动画。
|
|
3941
|
+
* @param launchPowerScale 投掷力量的缩放比例。
|
|
3942
|
+
* @param maxDrawDuration 最大蓄力时间。
|
|
3943
|
+
* @param maxLaunchPower 最大投掷力量。
|
|
3944
|
+
* @param minDrawDuration 最小蓄力时间。
|
|
3945
|
+
* @param scalePowerByDrawDuration 投掷力量是否随蓄力时间增加。
|
|
3946
|
+
* @returns 新的组件集合。
|
|
2909
3947
|
*/
|
|
2910
|
-
static setThrowable(doSwingAnimation?: boolean, launchPowerScale?: number, maxDrawDuration?: number, maxLaunchPower?: number, minDrawDuration?: number, scalePowerByDrawDuration?: boolean):
|
|
3948
|
+
static setThrowable(doSwingAnimation?: boolean, launchPowerScale?: number, maxDrawDuration?: number, maxLaunchPower?: number, minDrawDuration?: number, scalePowerByDrawDuration?: boolean): ItemComponentMap;
|
|
2911
3949
|
/**
|
|
2912
3950
|
* 设置物品的显示名称。
|
|
2913
|
-
* @param
|
|
2914
|
-
* @returns
|
|
3951
|
+
* @param displayName 显示名称或本地化键。
|
|
3952
|
+
* @returns 新的组件集合。
|
|
2915
3953
|
*/
|
|
2916
|
-
static setDisplayName(displayName: string):
|
|
3954
|
+
static setDisplayName(displayName: string): ItemComponentMap;
|
|
2917
3955
|
/**
|
|
2918
3956
|
* 设置物品的食物组件。
|
|
2919
|
-
* @param
|
|
2920
|
-
* @param
|
|
2921
|
-
* @param
|
|
2922
|
-
* @param
|
|
2923
|
-
* @
|
|
3957
|
+
* @param options 食物组件配置。
|
|
3958
|
+
* @param options.canAlwaysEat 是否随时可以食用。
|
|
3959
|
+
* @param options.nutrition 营养值。
|
|
3960
|
+
* @param options.saturationModifier 饱和度修正值。
|
|
3961
|
+
* @param options.usingConvertsTo 食用后转换的目标物品。
|
|
3962
|
+
* @returns 新的组件集合。
|
|
2924
3963
|
*/
|
|
2925
|
-
static setFoodComponent(
|
|
3964
|
+
static setFoodComponent(options?: FoodComponentOptions): ItemComponentMap;
|
|
2926
3965
|
/**
|
|
2927
3966
|
* 设置物品的燃料组件。
|
|
2928
|
-
* @param
|
|
2929
|
-
* @returns
|
|
3967
|
+
* @param duration 燃料燃烧的持续时间(秒),最小值为 0.05。
|
|
3968
|
+
* @returns 新的组件集合。
|
|
2930
3969
|
*/
|
|
2931
|
-
static setFuel(duration: number):
|
|
3970
|
+
static setFuel(duration: number): ItemComponentMap;
|
|
2932
3971
|
/**
|
|
2933
3972
|
* 设置物品的附魔光效组件。
|
|
2934
|
-
* @param
|
|
2935
|
-
* @returns
|
|
3973
|
+
* @param hasGlint 是否显示附魔光效。
|
|
3974
|
+
* @returns 新的组件集合。
|
|
2936
3975
|
*/
|
|
2937
|
-
static setGlint(hasGlint: boolean):
|
|
3976
|
+
static setGlint(hasGlint: boolean): ItemComponentMap;
|
|
2938
3977
|
/**
|
|
2939
3978
|
* 设置物品的手持渲染方式组件。
|
|
2940
|
-
* @param
|
|
2941
|
-
* @returns
|
|
3979
|
+
* @param isHandEquipped 是否像工具一样渲染。
|
|
3980
|
+
* @returns 新的组件集合。
|
|
2942
3981
|
*/
|
|
2943
|
-
static setHandEquipped(isHandEquipped: boolean):
|
|
3982
|
+
static setHandEquipped(isHandEquipped: boolean): ItemComponentMap;
|
|
2944
3983
|
/**
|
|
2945
3984
|
* 设置物品的图标组件。
|
|
2946
|
-
*
|
|
2947
|
-
* @
|
|
3985
|
+
* 支持字符串(default 纹理)或对象(多纹理)两种格式。
|
|
3986
|
+
* @param texture 图标纹理名称,或包含 default/dyed/iconTrim 等纹理的对象。
|
|
3987
|
+
* @returns 新的组件集合。
|
|
2948
3988
|
*/
|
|
2949
|
-
static setIcon(texture: string):
|
|
3989
|
+
static setIcon(texture: string | IconTextures): ItemComponentMap;
|
|
2950
3990
|
/**
|
|
2951
3991
|
* 设置物品的最大堆叠数量组件。
|
|
2952
|
-
* @param
|
|
2953
|
-
* @returns
|
|
3992
|
+
* @param maxStackSize 最大堆叠数量,默认值为 64。
|
|
3993
|
+
* @returns 新的组件集合。
|
|
2954
3994
|
*/
|
|
2955
|
-
static setMaxStackSize(maxStackSize?: number):
|
|
3995
|
+
static setMaxStackSize(maxStackSize?: number): ItemComponentMap;
|
|
2956
3996
|
/**
|
|
2957
3997
|
* 设置物品的投射物组件。
|
|
2958
|
-
* @param
|
|
2959
|
-
* @param
|
|
2960
|
-
* @returns
|
|
3998
|
+
* @param minimumCriticalPower 投射物需要蓄力多久才能造成暴击。
|
|
3999
|
+
* @param projectileEntity 作为投射物发射的实体名称。
|
|
4000
|
+
* @returns 新的组件集合。
|
|
2961
4001
|
*/
|
|
2962
|
-
static setProjectile(minimumCriticalPower?: number, projectileEntity?: string):
|
|
4002
|
+
static setProjectile(minimumCriticalPower?: number, projectileEntity?: string): ItemComponentMap;
|
|
2963
4003
|
/**
|
|
2964
4004
|
* 设置物品的使用修饰组件。
|
|
2965
|
-
* @param
|
|
2966
|
-
* @param
|
|
2967
|
-
* @
|
|
4005
|
+
* @param options 使用修饰配置。
|
|
4006
|
+
* @param options.movementModifier 使用物品时玩家移动速度的缩放值(0.0-1.0)。
|
|
4007
|
+
* @param options.useDuration 物品使用所需的时间(秒)。
|
|
4008
|
+
* @param options.emitVibrations 是否在开始/停止使用时发出振动。
|
|
4009
|
+
* @param options.startSound 开始使用时触发的音效。
|
|
4010
|
+
* @param options.startUsing 使用修饰生效的时机("always" 或 "if_first")。
|
|
4011
|
+
* @returns 新的组件集合。
|
|
2968
4012
|
*/
|
|
2969
|
-
static setUseModifiers(
|
|
4013
|
+
static setUseModifiers(options?: UseModifiersOptions): ItemComponentMap;
|
|
2970
4014
|
/**
|
|
2971
4015
|
* 设置物品的可穿戴组件。
|
|
2972
|
-
* @param
|
|
2973
|
-
* @param
|
|
2974
|
-
* @
|
|
4016
|
+
* @param protection 物品提供的保护值。
|
|
4017
|
+
* @param slot 物品可以穿戴的槽位(如 "slot.armor.head"、"slot.weapon.offhand" 等)。
|
|
4018
|
+
* @param hidesPlayerLocation 穿戴时是否从定位栏与定位地图中隐藏。
|
|
4019
|
+
* @returns 新的组件集合。
|
|
2975
4020
|
*/
|
|
2976
|
-
static setWearable(protection?: number, slot?: string):
|
|
4021
|
+
static setWearable(protection?: number, slot?: string, hidesPlayerLocation?: boolean): ItemComponentMap;
|
|
2977
4022
|
/**
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
4023
|
+
* 设置物品的使用动画组件。
|
|
4024
|
+
* @param animation 物品使用时的动画类型(如 "eat"、"drink" 等)。
|
|
4025
|
+
* @returns 新的组件集合。
|
|
4026
|
+
*/
|
|
4027
|
+
static setUseAnimation(animation: string): ItemComponentMap;
|
|
4028
|
+
/**
|
|
4029
|
+
* 设置物品是否可装备至副手。
|
|
4030
|
+
* @param allowed 是否允许装备至副手。
|
|
4031
|
+
* @returns 新的组件集合。
|
|
4032
|
+
*/
|
|
4033
|
+
static setAllowOffHand(allowed: boolean): ItemComponentMap;
|
|
4034
|
+
/**
|
|
4035
|
+
* 设置 Bundle 交互组件(需要同时具备 storage_item 组件)。
|
|
4036
|
+
* @param numViewableSlots 可查看的槽位数量(1-64)。
|
|
4037
|
+
* @returns 新的组件集合。
|
|
4038
|
+
*/
|
|
4039
|
+
static setBundleInteraction(numViewableSlots: number): ItemComponentMap;
|
|
4040
|
+
/**
|
|
4041
|
+
* 设置创造模式下能否破坏方块。
|
|
4042
|
+
* @param canDestroy 是否可破坏。
|
|
4043
|
+
* @returns 新的组件集合。
|
|
4044
|
+
*/
|
|
4045
|
+
static setCanDestroyInCreative(canDestroy: boolean): ItemComponentMap;
|
|
4046
|
+
/**
|
|
4047
|
+
* 设置堆肥组件。
|
|
4048
|
+
* @param compostingChance 堆肥等级增加的概率(0-100)。
|
|
4049
|
+
* @returns 新的组件集合。
|
|
4050
|
+
*/
|
|
4051
|
+
static setCompostable(compostingChance: number): ItemComponentMap;
|
|
4052
|
+
/**
|
|
4053
|
+
* 设置物品的冷却组件。
|
|
4054
|
+
* @param options 冷却配置。
|
|
4055
|
+
* @param options.category 冷却分类,相同分类的物品共享冷却。
|
|
4056
|
+
* @param options.duration 冷却时长(秒),负数会使物品无法使用。
|
|
4057
|
+
* @param options.type 冷却影响的输入类型("use" 或 "attack")。
|
|
4058
|
+
* @returns 新的组件集合。
|
|
4059
|
+
*/
|
|
4060
|
+
static setCooldown(options: CooldownOptions): ItemComponentMap;
|
|
4061
|
+
/**
|
|
4062
|
+
* 设置物品的伤害组件。
|
|
4063
|
+
* @param damage 额外伤害值(0-32767)。
|
|
4064
|
+
* @returns 新的组件集合。
|
|
4065
|
+
*/
|
|
4066
|
+
static setDamage(damage: number): ItemComponentMap;
|
|
4067
|
+
/**
|
|
4068
|
+
* 设置伤害吸收组件(需要同时具备 durability 组件并装备于盔甲槽位)。
|
|
4069
|
+
* @param absorbableCauses 可被吸收的伤害原因列表,如 ["all"]。
|
|
4070
|
+
* @returns 新的组件集合。
|
|
4071
|
+
*/
|
|
4072
|
+
static setDamageAbsorption(absorbableCauses: string[]): ItemComponentMap;
|
|
4073
|
+
/**
|
|
4074
|
+
* 设置挖掘组件。
|
|
4075
|
+
* @param options 挖掘配置。
|
|
4076
|
+
* @param options.destroySpeeds 破坏速度列表,speed 为 0 表示无法破坏该方块。
|
|
4077
|
+
* @param options.useEfficiency 效率附魔是否能影响破坏速度。
|
|
4078
|
+
* @returns 新的组件集合。
|
|
4079
|
+
*/
|
|
4080
|
+
static setDigger(options: DiggerOptions): ItemComponentMap;
|
|
4081
|
+
/**
|
|
4082
|
+
* 设置耐久传感器组件。
|
|
4083
|
+
* @param options 耐久传感器配置。
|
|
4084
|
+
* @param options.durabilityThresholds 耐久阈值列表,达到阈值时触发粒子或音效。
|
|
4085
|
+
* @returns 新的组件集合。
|
|
4086
|
+
*/
|
|
4087
|
+
static setDurabilitySensor(options: DurabilitySensorOptions): ItemComponentMap;
|
|
4088
|
+
/**
|
|
4089
|
+
* 设置可染色组件。
|
|
4090
|
+
* @param defaultColor 默认颜色,如 "#ffffff"。
|
|
4091
|
+
* @returns 新的组件集合。
|
|
4092
|
+
*/
|
|
4093
|
+
static setDyeable(defaultColor: string): ItemComponentMap;
|
|
4094
|
+
/**
|
|
4095
|
+
* 设置可附魔组件。
|
|
4096
|
+
* @param slot 可应用的附魔槽位,如 "sword"、"bow"。
|
|
4097
|
+
* @param value 附魔质量与数量(0-255)。
|
|
4098
|
+
* @returns 新的组件集合。
|
|
4099
|
+
*/
|
|
4100
|
+
static setEnchantable(slot: string, value: number): ItemComponentMap;
|
|
4101
|
+
/**
|
|
4102
|
+
* 设置放置实体组件。
|
|
4103
|
+
* @param entity 被放置的实体标识符,可带出生事件如 "wiki:entity<wiki:event>"。
|
|
4104
|
+
* @param options 放置配置。
|
|
4105
|
+
* @param options.dispenseOn 允许发射器放置的目标方块列表。
|
|
4106
|
+
* @param options.useOn 允许放置的目标方块列表。
|
|
4107
|
+
* @returns 新的组件集合。
|
|
4108
|
+
*/
|
|
4109
|
+
static setEntityPlacer(entity: string, options?: EntityPlacerOptions): ItemComponentMap;
|
|
4110
|
+
/**
|
|
4111
|
+
* 设置防火组件。
|
|
4112
|
+
* @param value 是否防火。
|
|
4113
|
+
* @returns 新的组件集合。
|
|
4114
|
+
*/
|
|
4115
|
+
static setFireResistant(value: boolean): ItemComponentMap;
|
|
4116
|
+
/**
|
|
4117
|
+
* 设置物品名颜色组件。
|
|
4118
|
+
* @param color 颜色名称,如 "minecoin_gold"。
|
|
4119
|
+
* @returns 新的组件集合。
|
|
4120
|
+
*/
|
|
4121
|
+
static setHoverTextColor(color: string): ItemComponentMap;
|
|
4122
|
+
/**
|
|
4123
|
+
* 设置动能武器组件。
|
|
4124
|
+
* @param options 动能武器配置。
|
|
4125
|
+
* @param options.delay 动能伤害开始生效前的延迟(tick)。
|
|
4126
|
+
* @param options.hitboxMargin 命中箱额外边距(格)。
|
|
4127
|
+
* @param options.reach 生效距离范围(格)。
|
|
4128
|
+
* @param options.creativeReach 创造模式下生效距离范围(格)。
|
|
4129
|
+
* @param options.damageMultiplier 基础伤害倍率。
|
|
4130
|
+
* @param options.damageModifier 附加伤害。
|
|
4131
|
+
* @param options.damageConditions 造成伤害的条件。
|
|
4132
|
+
* @param options.dismountConditions 解除骑乘的条件。
|
|
4133
|
+
* @param options.knockbackConditions 造成击退的条件。
|
|
4134
|
+
* @returns 新的组件集合。
|
|
4135
|
+
*/
|
|
4136
|
+
static setKineticWeapon(options: KineticWeaponOptions): ItemComponentMap;
|
|
4137
|
+
/**
|
|
4138
|
+
* 设置物品是否与液体方块交互。
|
|
4139
|
+
* @param clipped 是否在液体内部交互。
|
|
4140
|
+
* @returns 新的组件集合。
|
|
4141
|
+
*/
|
|
4142
|
+
static setLiquidClipped(clipped: boolean): ItemComponentMap;
|
|
4143
|
+
/**
|
|
4144
|
+
* 设置穿刺武器组件。
|
|
4145
|
+
* @param options 穿刺武器配置。
|
|
4146
|
+
* @param options.hitboxMargin 命中箱额外边距(格)。
|
|
4147
|
+
* @param options.reach 生效距离范围(格)。
|
|
4148
|
+
* @param options.creativeReach 创造模式下生效距离范围(格)。
|
|
4149
|
+
* @returns 新的组件集合。
|
|
4150
|
+
*/
|
|
4151
|
+
static setPiercingWeapon(options?: PiercingWeaponOptions): ItemComponentMap;
|
|
4152
|
+
/**
|
|
4153
|
+
* 设置物品稀有度组件(会被 hover_text_color 覆盖)。
|
|
4154
|
+
* @param rarity 稀有度:"common"、"uncommon"、"rare"、"epic"。
|
|
4155
|
+
* @returns 新的组件集合。
|
|
4156
|
+
*/
|
|
4157
|
+
static setRarity(rarity: ItemRarity): ItemComponentMap;
|
|
4158
|
+
/**
|
|
4159
|
+
* 设置唱片组件。
|
|
4160
|
+
* @param options 唱片配置。
|
|
4161
|
+
* @param options.comparatorSignal 比较器信号强度(0-15)。
|
|
4162
|
+
* @param options.duration 播放时长(秒)。
|
|
4163
|
+
* @param options.soundEvent 播放的原版音效事件。
|
|
4164
|
+
* @returns 新的组件集合。
|
|
4165
|
+
*/
|
|
4166
|
+
static setRecord(options: RecordOptions): ItemComponentMap;
|
|
4167
|
+
/**
|
|
4168
|
+
* 设置可修复组件。
|
|
4169
|
+
* @param repairItems 修复条目列表;repair_amount 可为数字或 Molang 表达式字符串。
|
|
4170
|
+
* @returns 新的组件集合。
|
|
4171
|
+
*/
|
|
4172
|
+
static setRepairable(repairItems: RepairItem[]): ItemComponentMap;
|
|
4173
|
+
/**
|
|
4174
|
+
* 设置射击组件(需要同时具备 use_modifiers 组件)。
|
|
4175
|
+
* @param options 射击配置。
|
|
4176
|
+
* @param options.ammunition 弹药列表,item 必须具有 projectile 组件。
|
|
4177
|
+
* @param options.chargeOnDraw 是否在拉弓时上弹(如弩)。
|
|
4178
|
+
* @param options.maxDrawDuration 自动发射前的最大拉弓时长(秒)。
|
|
4179
|
+
* @param options.scalePowerByDrawDuration 发射威力是否随拉弓时长增加。
|
|
4180
|
+
* @returns 新的组件集合。
|
|
4181
|
+
*/
|
|
4182
|
+
static setShooter(options: ShooterOptions): ItemComponentMap;
|
|
4183
|
+
/**
|
|
4184
|
+
* 设置是否应该消失组件。
|
|
4185
|
+
* @param shouldDespawn 掉落物是否最终消失。
|
|
4186
|
+
* @returns 新的组件集合。
|
|
4187
|
+
*/
|
|
4188
|
+
static setShouldDespawn(shouldDespawn: boolean): ItemComponentMap;
|
|
4189
|
+
/**
|
|
4190
|
+
* 设置按数据堆叠组件。
|
|
4191
|
+
* @param stackedByData 不同数据值的同种物品是否分开堆叠。
|
|
4192
|
+
* @returns 新的组件集合。
|
|
4193
|
+
*/
|
|
4194
|
+
static setStackedByData(stackedByData: boolean): ItemComponentMap;
|
|
4195
|
+
/**
|
|
4196
|
+
* 设置容器物品组件(需要 max_stack_size 为 1)。
|
|
4197
|
+
* @param options 容器配置。
|
|
4198
|
+
* @param options.maxSlots 容器槽位数量(1-64)。
|
|
4199
|
+
* @param options.allowNestedStorageItems 是否允许嵌套其他容器物品。
|
|
4200
|
+
* @param options.allowedItems 仅允许存入的物品列表。
|
|
4201
|
+
* @param options.bannedItems 禁止存入的物品列表。
|
|
4202
|
+
* @returns 新的组件集合。
|
|
4203
|
+
*/
|
|
4204
|
+
static setStorageItem(options: StorageItemOptions): ItemComponentMap;
|
|
4205
|
+
/**
|
|
4206
|
+
* 设置容器重量上限组件(需要同时具备 storage_item 组件)。
|
|
4207
|
+
* @param maxWeightLimit 容器内物品总重量上限。
|
|
4208
|
+
* @returns 新的组件集合。
|
|
4209
|
+
*/
|
|
4210
|
+
static setStorageWeightLimit(maxWeightLimit: number): ItemComponentMap;
|
|
4211
|
+
/**
|
|
4212
|
+
* 设置容器重量修正组件(0 表示不允许放入其他容器)。
|
|
4213
|
+
* @param weightInStorageItem 该物品放入容器时占用的重量(0-64)。
|
|
4214
|
+
* @returns 新的组件集合。
|
|
4215
|
+
*/
|
|
4216
|
+
static setStorageWeightModifier(weightInStorageItem: number): ItemComponentMap;
|
|
4217
|
+
/**
|
|
4218
|
+
* 设置挥动时长组件。
|
|
4219
|
+
* @param value 基础挥动时长(秒)。
|
|
4220
|
+
* @returns 新的组件集合。
|
|
4221
|
+
*/
|
|
4222
|
+
static setSwingDuration(value: number): ItemComponentMap;
|
|
4223
|
+
/**
|
|
4224
|
+
* 设置挥砍音效组件。
|
|
4225
|
+
* @param options 音效配置。
|
|
4226
|
+
* @param options.attackMiss 未命中时播放的原版音效。
|
|
4227
|
+
* @param options.attackHit 普通命中时播放的原版音效。
|
|
4228
|
+
* @param options.attackCriticalHit 暴击命中时播放的原版音效。
|
|
4229
|
+
* @returns 新的组件集合。
|
|
4230
|
+
*/
|
|
4231
|
+
static setSwingSounds(options?: SwingSoundsOptions): ItemComponentMap;
|
|
4232
|
+
/**
|
|
4233
|
+
* 设置物品标签组件。
|
|
4234
|
+
* @param tags 标签列表。
|
|
4235
|
+
* @returns 新的组件集合。
|
|
4236
|
+
*/
|
|
4237
|
+
static setTags(tags: string[]): ItemComponentMap;
|
|
2984
4238
|
/**
|
|
2985
4239
|
* 将多个组件集合合并为一个。
|
|
2986
|
-
* @param
|
|
2987
|
-
* @returns
|
|
4240
|
+
* @param componentMaps 多个组件集合。
|
|
4241
|
+
* @returns 合并后的组件集合。
|
|
2988
4242
|
*/
|
|
2989
|
-
static combineComponents(...componentMaps:
|
|
4243
|
+
static combineComponents(...componentMaps: ItemComponentMap[]): ItemComponentMap;
|
|
2990
4244
|
/**
|
|
2991
|
-
* 获取当前组件的 JSON 表示。
|
|
2992
|
-
* @param
|
|
2993
|
-
* @returns
|
|
4245
|
+
* 获取当前组件的 JSON 表示。
|
|
4246
|
+
* @param components 组件集合。
|
|
4247
|
+
* @returns 组件的 JSON 对象。
|
|
2994
4248
|
*/
|
|
2995
|
-
static toJSON(components:
|
|
4249
|
+
static toJSON(components: ItemComponentMap): Record<string, unknown>;
|
|
2996
4250
|
}
|
|
2997
4251
|
|
|
2998
4252
|
/**
|
|
@@ -3013,7 +4267,8 @@ declare class ItemComponent {
|
|
|
3013
4267
|
* - handle_deselect: boolean - 是否处理取消选择事件
|
|
3014
4268
|
* - button_up_right_of_first_refusal: boolean - 是否在首次拒绝后处理按钮释放事件
|
|
3015
4269
|
*/
|
|
3016
|
-
declare class ButtonMapping
|
|
4270
|
+
declare class ButtonMapping {
|
|
4271
|
+
[key: string]: unknown;
|
|
3017
4272
|
ignored: boolean;
|
|
3018
4273
|
from_button_id: string;
|
|
3019
4274
|
to_button_id: string;
|
|
@@ -3025,170 +4280,113 @@ declare class ButtonMapping$1 {
|
|
|
3025
4280
|
handle_select: boolean;
|
|
3026
4281
|
handle_deselect: boolean;
|
|
3027
4282
|
button_up_right_of_first_refusal: boolean;
|
|
4283
|
+
constructor();
|
|
3028
4284
|
/**
|
|
3029
4285
|
* 设置是否忽略映射。
|
|
3030
4286
|
* @param {boolean} ignored - 是否忽略映射(默认值:false)
|
|
3031
4287
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
3032
4288
|
*/
|
|
3033
|
-
setIgnored(ignored?: boolean):
|
|
4289
|
+
setIgnored(ignored?: boolean): this;
|
|
3034
4290
|
/**
|
|
3035
4291
|
* 设置触发事件的按钮 ID。
|
|
3036
4292
|
* @param {string} fromButtonId - 触发事件的按钮 ID
|
|
3037
4293
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
3038
4294
|
*/
|
|
3039
|
-
setFromButtonId(fromButtonId: string):
|
|
4295
|
+
setFromButtonId(fromButtonId: string): this;
|
|
3040
4296
|
/**
|
|
3041
4297
|
* 设置事件触发时执行的按钮 ID。
|
|
3042
4298
|
* @param {string} toButtonId - 事件触发时执行的按钮 ID
|
|
3043
4299
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
3044
4300
|
*/
|
|
3045
|
-
setToButtonId(toButtonId: string):
|
|
4301
|
+
setToButtonId(toButtonId: string): this;
|
|
3046
4302
|
/**
|
|
3047
4303
|
* 设置映射类型。
|
|
3048
4304
|
* @param {string} mappingType - 映射类型(可能值:global, pressed, double_pressed, focused)
|
|
3049
4305
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
3050
4306
|
*/
|
|
3051
|
-
setMappingType(mappingType: string):
|
|
4307
|
+
setMappingType(mappingType: string): this;
|
|
3052
4308
|
/**
|
|
3053
4309
|
* 设置映射范围。
|
|
3054
4310
|
* @param {string} scope - 映射范围(可能值:view, controller)
|
|
3055
4311
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
3056
4312
|
*/
|
|
3057
|
-
setScope(scope: string):
|
|
4313
|
+
setScope(scope: string): this;
|
|
3058
4314
|
/**
|
|
3059
4315
|
* 设置输入模式条件。
|
|
3060
4316
|
* @param {string} condition - 输入模式条件(可能值:not_gaze, not_gamepad, gamepad_and_not_gaze)
|
|
3061
4317
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
3062
4318
|
*/
|
|
3063
|
-
setInputModeCondition(condition: string):
|
|
4319
|
+
setInputModeCondition(condition: string): this;
|
|
3064
4320
|
/**
|
|
3065
4321
|
* 设置是否忽略输入范围。
|
|
3066
4322
|
* @param {boolean} ignore - 是否忽略输入范围
|
|
3067
4323
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
3068
4324
|
*/
|
|
3069
|
-
setIgnoreInputScope(ignore?: boolean):
|
|
4325
|
+
setIgnoreInputScope(ignore?: boolean): this;
|
|
3070
4326
|
/**
|
|
3071
4327
|
* 设置是否消耗事件。
|
|
3072
4328
|
* @param {boolean} consume - 是否消耗事件
|
|
3073
4329
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
3074
4330
|
*/
|
|
3075
|
-
setConsumeEvent(consume?: boolean):
|
|
4331
|
+
setConsumeEvent(consume?: boolean): this;
|
|
3076
4332
|
/**
|
|
3077
4333
|
* 设置是否处理选择事件。
|
|
3078
4334
|
* @param {boolean} handle - 是否处理选择事件
|
|
3079
4335
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
3080
4336
|
*/
|
|
3081
|
-
setHandleSelect(handle?: boolean):
|
|
4337
|
+
setHandleSelect(handle?: boolean): this;
|
|
3082
4338
|
/**
|
|
3083
4339
|
* 设置是否处理取消选择事件。
|
|
3084
4340
|
* @param {boolean} handle - 是否处理取消选择事件
|
|
3085
4341
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
3086
4342
|
*/
|
|
3087
|
-
setHandleDeselect(handle?: boolean):
|
|
4343
|
+
setHandleDeselect(handle?: boolean): this;
|
|
3088
4344
|
/**
|
|
3089
4345
|
* 设置是否在首次拒绝后处理按钮释放事件。
|
|
3090
4346
|
* @param {boolean} handle - 是否处理按钮释放事件
|
|
3091
4347
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
3092
4348
|
*/
|
|
3093
|
-
setButtonUpRightOfFirstRefusal(handle?: boolean):
|
|
4349
|
+
setButtonUpRightOfFirstRefusal(handle?: boolean): this;
|
|
3094
4350
|
}
|
|
3095
4351
|
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
setBindingName(name: string): DataBindingObject;
|
|
3135
|
-
binding_name: string | undefined;
|
|
3136
|
-
/**
|
|
3137
|
-
* 设置应用 binding_name 值的 UI 元素属性名称。
|
|
3138
|
-
* @param {string} nameOverride - 应用 binding_name 值的 UI 元素属性名称
|
|
3139
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3140
|
-
*/
|
|
3141
|
-
setBindingNameOverride(nameOverride: string): DataBindingObject;
|
|
3142
|
-
binding_name_override: string | undefined;
|
|
3143
|
-
/**
|
|
3144
|
-
* 设置要使用的集合名称。
|
|
3145
|
-
* @param {string} collectionName - 集合名称
|
|
3146
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3147
|
-
*/
|
|
3148
|
-
setBindingCollectionName(collectionName: string): DataBindingObject;
|
|
3149
|
-
binding_collection_name: string | undefined;
|
|
3150
|
-
/**
|
|
3151
|
-
* 设置集合前缀。
|
|
3152
|
-
* @param {string} prefix - 集合前缀
|
|
3153
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3154
|
-
*/
|
|
3155
|
-
setBindingCollectionPrefix(prefix: string): DataBindingObject;
|
|
3156
|
-
binding_collection_prefix: string | undefined;
|
|
3157
|
-
/**
|
|
3158
|
-
* 设置数据绑定的条件。
|
|
3159
|
-
* @param {string} condition - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
3160
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3161
|
-
*/
|
|
3162
|
-
setBindingCondition(condition: string): DataBindingObject;
|
|
3163
|
-
binding_condition: string | undefined;
|
|
3164
|
-
/**
|
|
3165
|
-
* 设置要观察其属性值的 UI 元素名称。
|
|
3166
|
-
* @param {string} controlName - UI 元素名称
|
|
3167
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3168
|
-
*/
|
|
3169
|
-
setSourceControlName(controlName: string): DataBindingObject;
|
|
3170
|
-
source_control_name: string | undefined;
|
|
3171
|
-
/**
|
|
3172
|
-
* 设置存储 source_control_name 引用的 UI 元素的属性值。
|
|
3173
|
-
* @param {string} propertyName - 属性名称
|
|
3174
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3175
|
-
*/
|
|
3176
|
-
setSourcePropertyName(propertyName: string): DataBindingObject;
|
|
3177
|
-
source_property_name: string | undefined;
|
|
3178
|
-
/**
|
|
3179
|
-
* 设置应用 source_property_name 值的 UI 元素属性。
|
|
3180
|
-
* @param {string} propertyName - 属性名称
|
|
3181
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3182
|
-
*/
|
|
3183
|
-
setTargetPropertyName(propertyName: string): DataBindingObject;
|
|
3184
|
-
target_property_name: string | undefined;
|
|
3185
|
-
/**
|
|
3186
|
-
* 设置是否允许选择同级元素而非子元素。
|
|
3187
|
-
* @param {boolean} resolve - 是否允许选择同级元素(默认值:false)
|
|
3188
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3189
|
-
*/
|
|
3190
|
-
setResolveSiblingScope(resolve?: boolean): DataBindingObject;
|
|
3191
|
-
resolve_sibling_scope: boolean | undefined;
|
|
4352
|
+
interface ProgressBarLayer {
|
|
4353
|
+
color: [number, number, number];
|
|
4354
|
+
clipRatio: number;
|
|
4355
|
+
}
|
|
4356
|
+
interface HudProgressBarOptions {
|
|
4357
|
+
id: string;
|
|
4358
|
+
texture: string;
|
|
4359
|
+
uv?: [number, number];
|
|
4360
|
+
uvSize?: [number, number];
|
|
4361
|
+
barSize?: [string | number, string | number];
|
|
4362
|
+
layers: ProgressBarLayer[];
|
|
4363
|
+
states: number;
|
|
4364
|
+
fillColor?: [number, number, number];
|
|
4365
|
+
fillUv?: [number, number];
|
|
4366
|
+
segments?: {
|
|
4367
|
+
count: number;
|
|
4368
|
+
color: [number, number, number];
|
|
4369
|
+
};
|
|
4370
|
+
hudSize?: [string | number, string | number];
|
|
4371
|
+
anchorFrom?: string;
|
|
4372
|
+
anchorTo?: string;
|
|
4373
|
+
offset?: [number, number];
|
|
4374
|
+
clipDirection?: string;
|
|
4375
|
+
}
|
|
4376
|
+
declare class HudProgressBar {
|
|
4377
|
+
private panel;
|
|
4378
|
+
private options;
|
|
4379
|
+
constructor(options: HudProgressBarOptions);
|
|
4380
|
+
private build;
|
|
4381
|
+
getPanel(): Panel;
|
|
4382
|
+
mountToHud(): void;
|
|
4383
|
+
}
|
|
4384
|
+
|
|
4385
|
+
type AnyUI = any;
|
|
4386
|
+
declare class UISystemRegistry {
|
|
4387
|
+
#private;
|
|
4388
|
+
static registerUISystem(ui_system: AnyUI): void;
|
|
4389
|
+
static addOuterUIdefs(ui_defs: string[]): void;
|
|
3192
4390
|
}
|
|
3193
4391
|
|
|
3194
4392
|
/**
|
|
@@ -3209,84 +4407,86 @@ declare class DataBindingObject {
|
|
|
3209
4407
|
* - consume_hover_events: boolean - 是否消耗悬停事件
|
|
3210
4408
|
* - gesture_tracking_button: string - 手势跟踪按钮
|
|
3211
4409
|
*/
|
|
4410
|
+
|
|
3212
4411
|
declare class Input {
|
|
4412
|
+
[key: string]: unknown;
|
|
4413
|
+
button_mappings: JsonUIBag[];
|
|
4414
|
+
modal: boolean;
|
|
4415
|
+
inline_modal: boolean;
|
|
4416
|
+
always_listen_to_input: boolean;
|
|
4417
|
+
always_handle_pointer: boolean;
|
|
4418
|
+
always_handle_controller_direction: boolean;
|
|
4419
|
+
hover_enabled: boolean;
|
|
4420
|
+
prevent_touch_input: boolean;
|
|
4421
|
+
consume_event: boolean;
|
|
4422
|
+
consume_hover_events: boolean;
|
|
4423
|
+
gesture_tracking_button: string;
|
|
3213
4424
|
/**
|
|
3214
4425
|
* 设置按钮映射配置。
|
|
3215
|
-
* @param {
|
|
4426
|
+
* @param {JsonUIBag[]} mappings - 按钮映射配置数组
|
|
3216
4427
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
3217
4428
|
*/
|
|
3218
|
-
setButtonMappings(mappings:
|
|
3219
|
-
button_mappings: ButtonMapping[] | undefined;
|
|
4429
|
+
setButtonMappings(mappings: JsonUIBag[]): this;
|
|
3220
4430
|
/**
|
|
3221
4431
|
* 设置是否为模态输入。
|
|
3222
4432
|
* @param {boolean} modal - 是否为模态输入
|
|
3223
4433
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
3224
4434
|
*/
|
|
3225
|
-
setModal(modal?: boolean):
|
|
3226
|
-
modal: boolean | undefined;
|
|
4435
|
+
setModal(modal?: boolean): this;
|
|
3227
4436
|
/**
|
|
3228
4437
|
* 设置是否为内联模态输入。
|
|
3229
4438
|
* @param {boolean} inlineModal - 是否为内联模态输入
|
|
3230
4439
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
3231
4440
|
*/
|
|
3232
|
-
setInlineModal(inlineModal?: boolean):
|
|
3233
|
-
inline_modal: boolean | undefined;
|
|
4441
|
+
setInlineModal(inlineModal?: boolean): this;
|
|
3234
4442
|
/**
|
|
3235
4443
|
* 设置是否始终监听输入。
|
|
3236
4444
|
* @param {boolean} alwaysListen - 是否始终监听输入
|
|
3237
4445
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
3238
4446
|
*/
|
|
3239
|
-
setAlwaysListenToInput(alwaysListen?: boolean):
|
|
3240
|
-
always_listen_to_input: boolean | undefined;
|
|
4447
|
+
setAlwaysListenToInput(alwaysListen?: boolean): this;
|
|
3241
4448
|
/**
|
|
3242
4449
|
* 设置是否始终处理指针事件。
|
|
3243
4450
|
* @param {boolean} alwaysHandle - 是否始终处理指针事件
|
|
3244
4451
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
3245
4452
|
*/
|
|
3246
|
-
setAlwaysHandlePointer(alwaysHandle?: boolean):
|
|
3247
|
-
always_handle_pointer: boolean | undefined;
|
|
4453
|
+
setAlwaysHandlePointer(alwaysHandle?: boolean): this;
|
|
3248
4454
|
/**
|
|
3249
4455
|
* 设置是否始终处理控制器方向事件。
|
|
3250
4456
|
* @param {boolean} alwaysHandle - 是否始终处理控制器方向事件
|
|
3251
4457
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
3252
4458
|
*/
|
|
3253
|
-
setAlwaysHandleControllerDirection(alwaysHandle?: boolean):
|
|
3254
|
-
always_handle_controller_direction: boolean | undefined;
|
|
4459
|
+
setAlwaysHandleControllerDirection(alwaysHandle?: boolean): this;
|
|
3255
4460
|
/**
|
|
3256
4461
|
* 设置是否启用悬停事件。
|
|
3257
4462
|
* @param {boolean} enabled - 是否启用悬停事件
|
|
3258
4463
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
3259
4464
|
*/
|
|
3260
|
-
setHoverEnabled(enabled?: boolean):
|
|
3261
|
-
hover_enabled: boolean | undefined;
|
|
4465
|
+
setHoverEnabled(enabled?: boolean): this;
|
|
3262
4466
|
/**
|
|
3263
4467
|
* 设置是否阻止触摸输入。
|
|
3264
4468
|
* @param {boolean} prevent - 是否阻止触摸输入
|
|
3265
4469
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
3266
4470
|
*/
|
|
3267
|
-
setPreventTouchInput(prevent?: boolean):
|
|
3268
|
-
prevent_touch_input: boolean | undefined;
|
|
4471
|
+
setPreventTouchInput(prevent?: boolean): this;
|
|
3269
4472
|
/**
|
|
3270
4473
|
* 设置是否消耗事件。
|
|
3271
4474
|
* @param {boolean} consume - 是否消耗事件
|
|
3272
4475
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
3273
4476
|
*/
|
|
3274
|
-
setConsumeEvent(consume?: boolean):
|
|
3275
|
-
consume_event: boolean | undefined;
|
|
4477
|
+
setConsumeEvent(consume?: boolean): this;
|
|
3276
4478
|
/**
|
|
3277
4479
|
* 设置是否消耗悬停事件。
|
|
3278
4480
|
* @param {boolean} consume - 是否消耗悬停事件
|
|
3279
4481
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
3280
4482
|
*/
|
|
3281
|
-
setConsumeHoverEvents(consume?: boolean):
|
|
3282
|
-
consume_hover_events: boolean | undefined;
|
|
4483
|
+
setConsumeHoverEvents(consume?: boolean): this;
|
|
3283
4484
|
/**
|
|
3284
4485
|
* 设置手势跟踪按钮。
|
|
3285
4486
|
* @param {string} button - 手势跟踪按钮
|
|
3286
4487
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
3287
4488
|
*/
|
|
3288
|
-
setGestureTrackingButton(button: string):
|
|
3289
|
-
gesture_tracking_button: string | undefined;
|
|
4489
|
+
setGestureTrackingButton(button: string): this;
|
|
3290
4490
|
}
|
|
3291
4491
|
|
|
3292
4492
|
/**
|
|
@@ -3300,62 +4500,75 @@ declare class Input {
|
|
|
3300
4500
|
* - sound_pitch: float - 声音音调(默认值:1.0)
|
|
3301
4501
|
* - sounds: Array of sound objects - 触发事件时播放的声音数组
|
|
3302
4502
|
*/
|
|
4503
|
+
|
|
3303
4504
|
declare class Sound {
|
|
4505
|
+
[key: string]: unknown;
|
|
4506
|
+
sound_name: string;
|
|
4507
|
+
sound_volume: number;
|
|
4508
|
+
sound_pitch: number;
|
|
4509
|
+
sounds: JsonUIBag[];
|
|
3304
4510
|
/**
|
|
3305
4511
|
* 设置声音名称。
|
|
3306
4512
|
* @param {string} name - 声音名称(定义在 RP/sounds/sound_definitions.json 文件中)
|
|
3307
4513
|
* @returns {Sound} 返回当前实例以支持链式调用
|
|
3308
4514
|
*/
|
|
3309
|
-
setSoundName(name: string):
|
|
3310
|
-
sound_name: string | undefined;
|
|
4515
|
+
setSoundName(name: string): this;
|
|
3311
4516
|
/**
|
|
3312
4517
|
* 设置声音音量。
|
|
3313
4518
|
* @param {number} volume - 音量(范围:0.0 到 1.0,默认值:1.0)
|
|
3314
4519
|
* @returns {Sound} 返回当前实例以支持链式调用
|
|
3315
4520
|
*/
|
|
3316
|
-
setSoundVolume(volume?: number):
|
|
3317
|
-
sound_volume: number | undefined;
|
|
4521
|
+
setSoundVolume(volume?: number): this;
|
|
3318
4522
|
/**
|
|
3319
4523
|
* 设置声音音调。
|
|
3320
4524
|
* @param {number} pitch - 音调(默认值:1.0)
|
|
3321
4525
|
* @returns {Sound} 返回当前实例以支持链式调用
|
|
3322
4526
|
*/
|
|
3323
|
-
setSoundPitch(pitch?: number):
|
|
3324
|
-
sound_pitch: number | undefined;
|
|
4527
|
+
setSoundPitch(pitch?: number): this;
|
|
3325
4528
|
/**
|
|
3326
4529
|
* 设置触发事件时播放的声音数组。
|
|
3327
|
-
* @param {
|
|
4530
|
+
* @param {JsonUIBag[]} sounds - 声音对象数组
|
|
3328
4531
|
* @returns {Sound} 返回当前实例以支持链式调用
|
|
3329
4532
|
*/
|
|
3330
|
-
setSounds(sounds:
|
|
3331
|
-
sounds: object[] | undefined;
|
|
4533
|
+
setSounds(sounds: JsonUIBag[]): this;
|
|
3332
4534
|
/**
|
|
3333
4535
|
* 添加一个声音对象到声音数组。
|
|
3334
|
-
* @param {
|
|
4536
|
+
* @param {JsonUIBag} sound - 声音对象
|
|
3335
4537
|
* @returns {Sound} 返回当前实例以支持链式调用
|
|
3336
4538
|
*/
|
|
3337
|
-
addSound(sound:
|
|
4539
|
+
addSound(sound: JsonUIBag): this;
|
|
3338
4540
|
}
|
|
3339
4541
|
|
|
4542
|
+
/**
|
|
4543
|
+
* Button
|
|
4544
|
+
Property Name Type Default Value Description
|
|
4545
|
+
default_control string Name of the child control that will be displayed only in the default state
|
|
4546
|
+
hover_control string Name of the child control that will be displayed only in the hover state
|
|
4547
|
+
pressed_control string Name of the child control that will be displayed only in the pressed state
|
|
4548
|
+
locked_control string Name of the child control that will be displayed only in the locked state
|
|
4549
|
+
*/
|
|
4550
|
+
|
|
3340
4551
|
declare class Button extends UIElement {
|
|
3341
|
-
constructor(id: any, template: any);
|
|
3342
4552
|
input: Input;
|
|
3343
4553
|
sound: Sound;
|
|
3344
4554
|
factory: Factory;
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
4555
|
+
constructor(id: string, template?: string);
|
|
4556
|
+
setDefaultControl(default_control: string): this;
|
|
4557
|
+
setHoverControl(hover_control: string): this;
|
|
4558
|
+
setPressedControl(pressed_control: string): this;
|
|
4559
|
+
setLockedControl(locked_control: string): this;
|
|
4560
|
+
setInput(input: Input): this;
|
|
4561
|
+
setSound(sound: Sound): this;
|
|
4562
|
+
setLayout(layout: Layout): this;
|
|
4563
|
+
protected serializableSources(): object[];
|
|
3352
4564
|
}
|
|
3353
4565
|
|
|
3354
4566
|
declare class CollectionPanel extends UIElement {
|
|
3355
|
-
constructor(id: any, template: any);
|
|
3356
4567
|
factory: Factory;
|
|
3357
|
-
|
|
3358
|
-
|
|
4568
|
+
constructor(id: string, template?: string);
|
|
4569
|
+
setCollectionName(collection_name: string): this;
|
|
4570
|
+
setLayout(layout: Layout): this;
|
|
4571
|
+
protected serializableSources(): object[];
|
|
3359
4572
|
}
|
|
3360
4573
|
|
|
3361
4574
|
/**
|
|
@@ -3373,62 +4586,66 @@ declare class CollectionPanel extends UIElement {
|
|
|
3373
4586
|
* - precached_grid_item_count: int - 预缓存的网格项目数量
|
|
3374
4587
|
*/
|
|
3375
4588
|
declare class GridProp {
|
|
4589
|
+
[key: string]: unknown;
|
|
4590
|
+
grid_dimensions: [number, number];
|
|
4591
|
+
maximum_grid_items: number;
|
|
4592
|
+
grid_dimension_binding: string;
|
|
4593
|
+
grid_rescaling_type: 'vertical' | 'horizontal' | 'none';
|
|
4594
|
+
grid_fill_direction: 'vertical' | 'horizontal' | 'none';
|
|
4595
|
+
grid_item_template: string;
|
|
4596
|
+
precached_grid_item_count: number;
|
|
3376
4597
|
/**
|
|
3377
4598
|
* 设置网格的列数和行数。
|
|
3378
|
-
* @param {number
|
|
4599
|
+
* @param {[number, number]} dimensions - 格式为 [columns, rows]
|
|
3379
4600
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
3380
4601
|
*/
|
|
3381
|
-
setGridDimensions(dimensions: number
|
|
3382
|
-
grid_dimensions: number[] | undefined;
|
|
4602
|
+
setGridDimensions(dimensions: [number, number]): this;
|
|
3383
4603
|
/**
|
|
3384
4604
|
* 设置网格生成的最大项目数。
|
|
3385
4605
|
* @param {number} maxItems - 最大项目数
|
|
3386
4606
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
3387
4607
|
*/
|
|
3388
|
-
setMaximumGridItems(maxItems: number):
|
|
3389
|
-
maximum_grid_items: number | undefined;
|
|
4608
|
+
setMaximumGridItems(maxItems: number): this;
|
|
3390
4609
|
/**
|
|
3391
4610
|
* 设置网格尺寸的绑定名称。
|
|
3392
4611
|
* @param {string} binding - 绑定名称
|
|
3393
4612
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
3394
4613
|
*/
|
|
3395
|
-
setGridDimensionBinding(binding: string):
|
|
3396
|
-
grid_dimension_binding: string | undefined;
|
|
4614
|
+
setGridDimensionBinding(binding: string): this;
|
|
3397
4615
|
/**
|
|
3398
4616
|
* 设置网格重新缩放方向。
|
|
3399
|
-
* @param {
|
|
4617
|
+
* @param {'vertical' | 'horizontal' | 'none'} type - 可能值:vertical, horizontal, none(默认值:none)
|
|
3400
4618
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
3401
4619
|
*/
|
|
3402
|
-
setGridRescalingType(type?:
|
|
3403
|
-
grid_rescaling_type: string | undefined;
|
|
4620
|
+
setGridRescalingType(type?: 'vertical' | 'horizontal' | 'none'): this;
|
|
3404
4621
|
/**
|
|
3405
4622
|
* 设置网格填充方向。
|
|
3406
|
-
* @param {
|
|
4623
|
+
* @param {'vertical' | 'horizontal' | 'none'} direction - 可能值:vertical, horizontal, none(默认值:none)
|
|
3407
4624
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
3408
4625
|
*/
|
|
3409
|
-
setGridFillDirection(direction?:
|
|
3410
|
-
grid_fill_direction: string | undefined;
|
|
4626
|
+
setGridFillDirection(direction?: 'vertical' | 'horizontal' | 'none'): this;
|
|
3411
4627
|
/**
|
|
3412
4628
|
* 设置处理集合的子元素名称。
|
|
3413
4629
|
* @param {string} template - 元素名称(例如:"common.container_item")
|
|
3414
4630
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
3415
4631
|
*/
|
|
3416
|
-
setGridItemTemplate(template: string):
|
|
3417
|
-
grid_item_template: string | undefined;
|
|
4632
|
+
setGridItemTemplate(template: string): this;
|
|
3418
4633
|
/**
|
|
3419
4634
|
* 设置预缓存的网格项目数量。
|
|
3420
4635
|
* @param {number} count - 预缓存数量
|
|
3421
4636
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
3422
4637
|
*/
|
|
3423
|
-
setPrecachedGridItemCount(count: number):
|
|
3424
|
-
precached_grid_item_count: number | undefined;
|
|
4638
|
+
setPrecachedGridItemCount(count: number): this;
|
|
3425
4639
|
}
|
|
3426
4640
|
|
|
3427
4641
|
declare class Grid extends CollectionPanel {
|
|
3428
4642
|
gridNum: number;
|
|
3429
4643
|
grid: GridProp;
|
|
3430
|
-
|
|
3431
|
-
|
|
4644
|
+
constructor(id: string, template?: string);
|
|
4645
|
+
setGridProp(grid_prop: GridProp): this;
|
|
4646
|
+
addGridItem(grid_position: Offset2, content: UIElement | JsonUIBag, name?: string, debugColor?: [number, number, number, number]): this;
|
|
4647
|
+
protected serializableSources(): object[];
|
|
4648
|
+
serialize(): SerializedElement;
|
|
3432
4649
|
}
|
|
3433
4650
|
|
|
3434
4651
|
/**
|
|
@@ -3451,282 +4668,221 @@ declare class Grid extends CollectionPanel {
|
|
|
3451
4668
|
* - jump_to_bottom_on_update: boolean - 是否在更新时跳转到底部
|
|
3452
4669
|
*/
|
|
3453
4670
|
declare class ScrollView {
|
|
4671
|
+
[key: string]: unknown;
|
|
4672
|
+
scrollbar_track_button: string;
|
|
4673
|
+
scrollbar_touch_button: string;
|
|
4674
|
+
scroll_speed: number;
|
|
4675
|
+
gesture_control_enabled: boolean;
|
|
4676
|
+
always_handle_scrolling: boolean;
|
|
4677
|
+
touch_mode: boolean;
|
|
4678
|
+
scrollbar_box: string;
|
|
4679
|
+
scrollbar_track: string;
|
|
4680
|
+
scroll_view_port: string;
|
|
4681
|
+
scroll_content: string;
|
|
4682
|
+
scroll_box_and_track_panel: string;
|
|
4683
|
+
jump_to_bottom_on_update: boolean;
|
|
3454
4684
|
/**
|
|
3455
4685
|
* 设置滚动条轨道按钮的 ID。
|
|
3456
4686
|
* @param {string} buttonId - 滚动条轨道按钮的 ID
|
|
3457
4687
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
3458
4688
|
*/
|
|
3459
|
-
setScrollbarTrackButton(buttonId: string):
|
|
3460
|
-
scrollbar_track_button: string | undefined;
|
|
4689
|
+
setScrollbarTrackButton(buttonId: string): this;
|
|
3461
4690
|
/**
|
|
3462
4691
|
* 设置滚动条触摸按钮的 ID。
|
|
3463
4692
|
* @param {string} buttonId - 滚动条触摸按钮的 ID
|
|
3464
4693
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
3465
4694
|
*/
|
|
3466
|
-
setScrollbarTouchButton(buttonId: string):
|
|
3467
|
-
scrollbar_touch_button: string | undefined;
|
|
4695
|
+
setScrollbarTouchButton(buttonId: string): this;
|
|
3468
4696
|
/**
|
|
3469
4697
|
* 设置滚动速度。
|
|
3470
4698
|
* @param {number} speed - 滚动速度
|
|
3471
4699
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
3472
4700
|
*/
|
|
3473
|
-
setScrollSpeed(speed: number):
|
|
3474
|
-
scroll_speed: number | undefined;
|
|
4701
|
+
setScrollSpeed(speed: number): this;
|
|
3475
4702
|
/**
|
|
3476
4703
|
* 设置是否启用手势控制。
|
|
3477
4704
|
* @param {boolean} enabled - 是否启用手势控制(默认值:false)
|
|
3478
4705
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
3479
4706
|
*/
|
|
3480
|
-
setGestureControlEnabled(enabled?: boolean):
|
|
3481
|
-
gesture_control_enabled: boolean | undefined;
|
|
4707
|
+
setGestureControlEnabled(enabled?: boolean): this;
|
|
3482
4708
|
/**
|
|
3483
4709
|
* 设置是否始终处理滚动。
|
|
3484
4710
|
* @param {boolean} alwaysHandle - 是否始终处理滚动(默认值:false)
|
|
3485
4711
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
3486
4712
|
*/
|
|
3487
|
-
setAlwaysHandleScrolling(alwaysHandle?: boolean):
|
|
3488
|
-
always_handle_scrolling: boolean | undefined;
|
|
4713
|
+
setAlwaysHandleScrolling(alwaysHandle?: boolean): this;
|
|
3489
4714
|
/**
|
|
3490
4715
|
* 设置是否启用触摸模式。
|
|
3491
4716
|
* @param {boolean} touchMode - 是否启用触摸模式(默认值:false)
|
|
3492
4717
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
3493
4718
|
*/
|
|
3494
|
-
setTouchMode(touchMode?: boolean):
|
|
3495
|
-
touch_mode: boolean | undefined;
|
|
4719
|
+
setTouchMode(touchMode?: boolean): this;
|
|
3496
4720
|
/**
|
|
3497
4721
|
* 设置滚动条滑块子元素的名称。
|
|
3498
4722
|
* @param {string} boxName - 滚动条滑块子元素的名称
|
|
3499
4723
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
3500
4724
|
*/
|
|
3501
|
-
setScrollbarBox(boxName: string):
|
|
3502
|
-
scrollbar_box: string | undefined;
|
|
4725
|
+
setScrollbarBox(boxName: string): this;
|
|
3503
4726
|
/**
|
|
3504
4727
|
* 设置滚动条轨道子元素的名称。
|
|
3505
4728
|
* @param {string} trackName - 滚动条轨道子元素的名称
|
|
3506
4729
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
3507
4730
|
*/
|
|
3508
|
-
setScrollbarTrack(trackName: string):
|
|
3509
|
-
scrollbar_track: string | undefined;
|
|
4731
|
+
setScrollbarTrack(trackName: string): this;
|
|
3510
4732
|
/**
|
|
3511
4733
|
* 设置视口子元素的名称。
|
|
3512
4734
|
* @param {string} viewPortName - 视口子元素的名称
|
|
3513
4735
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
3514
4736
|
*/
|
|
3515
|
-
setScrollViewPort(viewPortName: string):
|
|
3516
|
-
scroll_view_port: string | undefined;
|
|
4737
|
+
setScrollViewPort(viewPortName: string): this;
|
|
3517
4738
|
/**
|
|
3518
4739
|
* 设置内容根父元素的名称。
|
|
3519
4740
|
* @param {string} contentName - 内容根父元素的名称
|
|
3520
4741
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
3521
4742
|
*/
|
|
3522
|
-
setScrollContent(contentName: string):
|
|
3523
|
-
scroll_content: string | undefined;
|
|
4743
|
+
setScrollContent(contentName: string): this;
|
|
3524
4744
|
/**
|
|
3525
4745
|
* 设置包含滚动条滑块和轨道的子元素名称。
|
|
3526
4746
|
* @param {string} panelName - 包含滚动条滑块和轨道的子元素名称
|
|
3527
4747
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
3528
4748
|
*/
|
|
3529
|
-
setScrollBoxAndTrackPanel(panelName: string):
|
|
3530
|
-
scroll_box_and_track_panel: string | undefined;
|
|
4749
|
+
setScrollBoxAndTrackPanel(panelName: string): this;
|
|
3531
4750
|
/**
|
|
3532
4751
|
* 设置是否在更新时跳转到底部。
|
|
3533
4752
|
* @param {boolean} jump - 是否在更新时跳转到底部(默认值:false)
|
|
3534
4753
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
3535
4754
|
*/
|
|
3536
|
-
setJumpToBottomOnUpdate(jump?: boolean):
|
|
3537
|
-
jump_to_bottom_on_update: boolean | undefined;
|
|
4755
|
+
setJumpToBottomOnUpdate(jump?: boolean): this;
|
|
3538
4756
|
}
|
|
3539
4757
|
|
|
3540
4758
|
declare class ScrollingPanel extends UIElement {
|
|
3541
|
-
constructor(id: any, template: any);
|
|
3542
4759
|
input: Input;
|
|
3543
4760
|
scrollView: ScrollView;
|
|
3544
4761
|
factory: Factory;
|
|
4762
|
+
constructor(id: string, template?: string);
|
|
4763
|
+
protected serializableSources(): object[];
|
|
3545
4764
|
}
|
|
3546
4765
|
|
|
3547
4766
|
declare class StackPanel extends Panel {
|
|
3548
|
-
constructor(id: any, template: any);
|
|
3549
|
-
type: string;
|
|
3550
4767
|
orientation: string;
|
|
3551
4768
|
stackNum: number;
|
|
3552
|
-
|
|
4769
|
+
constructor(id: string, template?: string);
|
|
4770
|
+
addStack(size: Size2 | string, content: UIElement | JsonUIBag, debug?: boolean): this;
|
|
3553
4771
|
/**
|
|
3554
4772
|
* Possible values:
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
* @param {
|
|
3558
|
-
*/
|
|
3559
|
-
setOrientation(orientation: any): this;
|
|
3560
|
-
}
|
|
3561
|
-
|
|
3562
|
-
declare class ChestUISystem {
|
|
3563
|
-
static chest_screen: UISystem;
|
|
3564
|
-
static registerContainerUI(new_container_title: any, ui_system_root_panel: any): void;
|
|
3565
|
-
}
|
|
3566
|
-
|
|
3567
|
-
/**
|
|
3568
|
-
* 自定义容器 UI 系统类,用于创建和管理容器界面。
|
|
3569
|
-
* 支持动态添加网格项、设置标题、调整尺寸等功能。
|
|
3570
|
-
*/
|
|
3571
|
-
declare class ContainerUISystem {
|
|
3572
|
-
/**
|
|
3573
|
-
* 构造函数,初始化容器 UI 系统。
|
|
3574
|
-
* @param {string} identifier - 容器的唯一标识符。
|
|
3575
|
-
* @param {string} path - 资源路径。
|
|
3576
|
-
*/
|
|
3577
|
-
constructor(identifier: string, path: string);
|
|
3578
|
-
system: UISystem;
|
|
3579
|
-
title: string;
|
|
3580
|
-
root_panel_size: number[];
|
|
3581
|
-
gridDimension: number[];
|
|
3582
|
-
output_grids: any[];
|
|
3583
|
-
main_panel: Panel;
|
|
3584
|
-
grids: Grid;
|
|
3585
|
-
setInputGrid(output_arr: any): void;
|
|
3586
|
-
/**
|
|
3587
|
-
* 向网格中添加一个网格项。
|
|
3588
|
-
* @param {number[]} grid_position - 网格项的位置 [行, 列] 用于定位实体的背包槽。
|
|
3589
|
-
* @param {number[]} offset - 网格项的偏移量 [x, y]。
|
|
3590
|
-
* @param {Object} [options] - 可选参数,用于配置网格项。
|
|
3591
|
-
* @param {boolean} [options.enable=true] - 是否启用该网格项,默认为 true。
|
|
3592
|
-
* @param {number[]} [options.size] - 网格项的大小 [宽度, 高度]。
|
|
3593
|
-
* @param {UIElement[]} [options.background_images] - 网格项的背景图片控件。
|
|
3594
|
-
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
3595
|
-
*/
|
|
3596
|
-
addGridItem(grid_position: number[], offset: number[], options?: {
|
|
3597
|
-
enable?: boolean | undefined;
|
|
3598
|
-
size?: number[] | undefined;
|
|
3599
|
-
background_images?: UIElement[] | undefined;
|
|
3600
|
-
}): ContainerUISystem;
|
|
3601
|
-
addInputGrid(grid_position: any, offset: any, options: any): void;
|
|
3602
|
-
addOutputGrid(grid_position: any, offset: any, options: any): void;
|
|
3603
|
-
/**
|
|
3604
|
-
* 向主面板中添加一个 UI 元素。
|
|
3605
|
-
* @param {Object} element - 要添加的 UI 元素。
|
|
3606
|
-
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
3607
|
-
*/
|
|
3608
|
-
addElementToMain(element: Object): ContainerUISystem;
|
|
3609
|
-
/**
|
|
3610
|
-
* 设置网格的维度(行和列)。
|
|
3611
|
-
* @param {number[]} dimension - 网格的维度 [行数, 列数]。
|
|
3612
|
-
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
3613
|
-
*/
|
|
3614
|
-
setGridDimension(dimension: number[]): ContainerUISystem;
|
|
3615
|
-
/**
|
|
3616
|
-
* 设置容器的标题。
|
|
3617
|
-
* @param {string} title - 容器的标题。
|
|
3618
|
-
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
3619
|
-
*/
|
|
3620
|
-
setTitle(title: string): ContainerUISystem;
|
|
3621
|
-
/**
|
|
3622
|
-
* 设置根面板的尺寸。
|
|
3623
|
-
* @param {number[]} size - 根面板的尺寸 [宽度, 高度]。
|
|
3624
|
-
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
3625
|
-
*/
|
|
3626
|
-
setSize(size: number[]): ContainerUISystem;
|
|
3627
|
-
setItemMatrix(n: any, matrix: any): void;
|
|
3628
|
-
#private;
|
|
3629
|
-
}
|
|
3630
|
-
|
|
3631
|
-
declare const ServerFormSystem: UISystem;
|
|
3632
|
-
declare class ServerFormButton extends UIElement {
|
|
3633
|
-
/**
|
|
3634
|
-
* 定义一个新的表单按钮
|
|
3635
|
-
* @param {*} name
|
|
3636
|
-
* @param {*} binding_button_name
|
|
3637
|
-
*/
|
|
3638
|
-
constructor(name: any, binding_button_name: any);
|
|
3639
|
-
/**
|
|
3640
|
-
*
|
|
3641
|
-
* @param {string} texture
|
|
3642
|
-
* @returns
|
|
4773
|
+
vertical
|
|
4774
|
+
horizontal
|
|
4775
|
+
* @param {string} orientation
|
|
3643
4776
|
*/
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
setHoverTexture(texture: any): this;
|
|
3647
|
-
}
|
|
3648
|
-
declare const form_button_panel: Panel;
|
|
3649
|
-
declare class ServerUISystem {
|
|
3650
|
-
static "__#private@#binding_map": Map<any, any>;
|
|
3651
|
-
static "__#private@#binding_title_list": any[];
|
|
3652
|
-
static addBindingTitle(title_name: any): void;
|
|
3653
|
-
static getBindingTitleList(): any[];
|
|
3654
|
-
static getBindingContentList(): any[];
|
|
3655
|
-
static bindingTitlewithContent(title_name: any, content: any): void;
|
|
3656
|
-
static "__#private@#updateServerFormSystem"(): void;
|
|
3657
|
-
}
|
|
3658
|
-
|
|
3659
|
-
declare class Guidebook {
|
|
3660
|
-
constructor(identifier: any, path: any);
|
|
3661
|
-
system: UISystem;
|
|
3662
|
-
addPageBinding(page_name: any, left_control_name: any, right_control_name: any): this;
|
|
3663
|
-
addPage(page_name: any, left_control: any, right_control: any): this;
|
|
3664
|
-
addElement(element: any): this;
|
|
3665
|
-
#private;
|
|
3666
|
-
}
|
|
3667
|
-
|
|
3668
|
-
declare class UISystemRegistry {
|
|
3669
|
-
static "__#private@#ui_system_map": {};
|
|
3670
|
-
static "__#private@#ui_def_list": any[];
|
|
3671
|
-
static registerUISystem(ui_system: any): void;
|
|
3672
|
-
static addOuterUIdefs(ui_defs: any): void;
|
|
4777
|
+
setOrientation(orientation: string): this;
|
|
4778
|
+
serialize(): SerializedElement;
|
|
3673
4779
|
}
|
|
3674
4780
|
|
|
4781
|
+
type CustomButtonConfig = {
|
|
4782
|
+
id: string;
|
|
4783
|
+
position: "bottom_left" | "bottom_right" | "bottom_middle" | "top_left" | "top_right";
|
|
4784
|
+
offset: [number, number];
|
|
4785
|
+
size: [number | string, number | string];
|
|
4786
|
+
defaultTexture: string;
|
|
4787
|
+
hoverTexture: string;
|
|
4788
|
+
pressedTexture: string;
|
|
4789
|
+
bindingButtonName: string;
|
|
4790
|
+
};
|
|
4791
|
+
type ButtonTextures = {
|
|
4792
|
+
prevDefault?: string;
|
|
4793
|
+
prevHover?: string;
|
|
4794
|
+
prevPressed?: string;
|
|
4795
|
+
nextDefault?: string;
|
|
4796
|
+
nextHover?: string;
|
|
4797
|
+
nextPressed?: string;
|
|
4798
|
+
homeDefault?: string;
|
|
4799
|
+
homeHover?: string;
|
|
4800
|
+
homePressed?: string;
|
|
4801
|
+
closeDefault?: string;
|
|
4802
|
+
closeHover?: string;
|
|
4803
|
+
closePressed?: string;
|
|
4804
|
+
};
|
|
4805
|
+
type NeoGuidebookOptions = {
|
|
4806
|
+
size?: [number, number];
|
|
4807
|
+
background?: string;
|
|
4808
|
+
debug?: boolean;
|
|
4809
|
+
buttons?: {
|
|
4810
|
+
prev?: {
|
|
4811
|
+
visible?: boolean;
|
|
4812
|
+
};
|
|
4813
|
+
next?: {
|
|
4814
|
+
visible?: boolean;
|
|
4815
|
+
};
|
|
4816
|
+
home?: {
|
|
4817
|
+
visible?: boolean;
|
|
4818
|
+
};
|
|
4819
|
+
close?: {
|
|
4820
|
+
visible?: boolean;
|
|
4821
|
+
};
|
|
4822
|
+
};
|
|
4823
|
+
textures?: ButtonTextures;
|
|
4824
|
+
};
|
|
3675
4825
|
declare class NeoGuidebook {
|
|
3676
|
-
private
|
|
4826
|
+
private identifier;
|
|
3677
4827
|
private book_pages;
|
|
3678
4828
|
private size;
|
|
3679
4829
|
private background_image;
|
|
3680
4830
|
private debug_mode;
|
|
3681
4831
|
private system;
|
|
3682
|
-
private
|
|
3683
|
-
private
|
|
4832
|
+
private content_panel_name;
|
|
4833
|
+
private content_panel_id;
|
|
4834
|
+
private buttons_panel_name;
|
|
4835
|
+
private buttons_panel_id;
|
|
3684
4836
|
private root_panel_elements;
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
4837
|
+
private custom_buttons;
|
|
4838
|
+
private button_visibility;
|
|
4839
|
+
private textures;
|
|
4840
|
+
private dirty;
|
|
4841
|
+
constructor(identifier: string, path: string, size?: [number, number], options?: NeoGuidebookOptions);
|
|
4842
|
+
getPageIds(): string[];
|
|
4843
|
+
getPageCount(): number;
|
|
4844
|
+
addCustomButton(config: CustomButtonConfig): this;
|
|
3692
4845
|
addSinglePageStack(page_id: string, page_content: Panel): void;
|
|
3693
|
-
|
|
3694
|
-
|
|
4846
|
+
addDoublePageStack(page_id: string, left_page: Panel, right_page: Panel, ratio?: [string, string]): void;
|
|
4847
|
+
private flush;
|
|
3695
4848
|
private createPagesPanel;
|
|
3696
4849
|
private initUI;
|
|
3697
|
-
private
|
|
3698
|
-
|
|
4850
|
+
private createNavButtons;
|
|
4851
|
+
private createCustomButtons;
|
|
4852
|
+
private updateUI;
|
|
4853
|
+
private tex;
|
|
3699
4854
|
private createCloseButton;
|
|
3700
|
-
/** 创建翻页按钮(通用方法) */
|
|
3701
4855
|
private createPageButton;
|
|
3702
|
-
/**创建返回章节目录按键 */
|
|
3703
4856
|
private createHomeButton;
|
|
3704
|
-
/**创建书页 */
|
|
3705
4857
|
private createBookPage;
|
|
3706
|
-
/**创建调试数据内容文本 */
|
|
3707
4858
|
private createDebugText;
|
|
3708
|
-
/**
|
|
3709
|
-
* 向系统注册一个元素
|
|
3710
|
-
* @param {UIElement} element
|
|
3711
|
-
*/
|
|
3712
4859
|
registerElement(element: UIElement): this;
|
|
3713
|
-
/**
|
|
3714
|
-
* 向根面板添加元素
|
|
3715
|
-
*/
|
|
3716
4860
|
addRootElement(element: UIElement): this;
|
|
3717
|
-
/**
|
|
3718
|
-
* 向根面板添加多个元素
|
|
3719
|
-
* @param {Array} elements
|
|
3720
|
-
*/
|
|
3721
4861
|
addRootElements(elements: UIElement[]): this;
|
|
3722
4862
|
}
|
|
3723
4863
|
|
|
4864
|
+
/**
|
|
4865
|
+
* @deprecated 图标/纹理按钮请改用 FormButton(@common.button + 三态纹理 + 门控绑定)。
|
|
4866
|
+
* 本类仅为兼容 NeoGuidebook 保留;后续随 guidebook 迁移一并移除。
|
|
4867
|
+
*/
|
|
4868
|
+
declare class SapdonTexturedButton extends UIElement {
|
|
4869
|
+
constructor(id: string, bindingButtonName?: string);
|
|
4870
|
+
setDefaultTexture(texture: string): this;
|
|
4871
|
+
setHoverTexture(texture: string): this;
|
|
4872
|
+
setPressedTexture(texture: string): this;
|
|
4873
|
+
/** 设置锚点对齐 */
|
|
4874
|
+
setAnchor(anchor: string, size?: [number | string, number | string]): this;
|
|
4875
|
+
}
|
|
4876
|
+
|
|
3724
4877
|
declare class EmptySpace extends Panel {
|
|
3725
4878
|
constructor(id: string, size?: [string, string]);
|
|
3726
4879
|
}
|
|
3727
4880
|
declare class BookTitle extends Label {
|
|
3728
4881
|
constructor(id: string, title: string, size?: [string, string]);
|
|
3729
4882
|
}
|
|
4883
|
+
declare class BookText extends Label {
|
|
4884
|
+
constructor(id: string, text: string, size?: [string, string]);
|
|
4885
|
+
}
|
|
3730
4886
|
declare class BookTitleBar extends Panel {
|
|
3731
4887
|
private size;
|
|
3732
4888
|
constructor(id: string, text: string, size?: [string, string]);
|
|
@@ -3735,7 +4891,7 @@ declare class BookTitleBar extends Panel {
|
|
|
3735
4891
|
declare class Divider extends StackPanel {
|
|
3736
4892
|
constructor(id: string, size?: [string, string]);
|
|
3737
4893
|
}
|
|
3738
|
-
declare class BookButton extends
|
|
4894
|
+
declare class BookButton extends SapdonTexturedButton {
|
|
3739
4895
|
constructor(id: string, texture: string, size?: [string, string]);
|
|
3740
4896
|
}
|
|
3741
4897
|
declare class BookImage extends Image {
|
|
@@ -3751,7 +4907,7 @@ declare class BookRecipeGrid extends StackPanel {
|
|
|
3751
4907
|
constructor(id: string, row: number, col: number, items: string[]);
|
|
3752
4908
|
}
|
|
3753
4909
|
declare class ChapterItem extends Panel {
|
|
3754
|
-
constructor(index: number, chapterName: string, texture: string);
|
|
4910
|
+
constructor(index: number, chapterName: string, texture: string, prefix?: string);
|
|
3755
4911
|
}
|
|
3756
4912
|
declare class NeoGuidebookPage {
|
|
3757
4913
|
private panel;
|
|
@@ -3773,7 +4929,9 @@ declare class NeoGuidebookPage {
|
|
|
3773
4929
|
chapter_name: string;
|
|
3774
4930
|
chapter_texture: string;
|
|
3775
4931
|
}>): this;
|
|
3776
|
-
buildChapterList(): this;
|
|
4932
|
+
buildChapterList(prefix?: string): this;
|
|
4933
|
+
addControl(control: UIElement): this;
|
|
4934
|
+
addStack(size: [string, string], control: UIElement, debug?: boolean): this;
|
|
3777
4935
|
getPanel(): StackPanel;
|
|
3778
4936
|
clear(): this;
|
|
3779
4937
|
}
|
|
@@ -3797,6 +4955,257 @@ declare class HudStatePanel {
|
|
|
3797
4955
|
getPanel(): Panel;
|
|
3798
4956
|
}
|
|
3799
4957
|
|
|
4958
|
+
declare class ChestUISystem {
|
|
4959
|
+
static chest_screen: UISystem;
|
|
4960
|
+
static registerContainerUI(new_container_title: string, ui_system_root_panel: string): void;
|
|
4961
|
+
}
|
|
4962
|
+
|
|
4963
|
+
type Any = any;
|
|
4964
|
+
/**
|
|
4965
|
+
* 自定义容器 UI 系统类,用于创建和管理容器界面。
|
|
4966
|
+
* 支持动态添加网格项、设置标题、调整尺寸等功能。
|
|
4967
|
+
*/
|
|
4968
|
+
declare class ContainerUISystem {
|
|
4969
|
+
#private;
|
|
4970
|
+
system: UISystem;
|
|
4971
|
+
title: string;
|
|
4972
|
+
root_panel_size: [number, number];
|
|
4973
|
+
gridDimension: [number, number];
|
|
4974
|
+
output_grids: number[][];
|
|
4975
|
+
main_panel: Panel;
|
|
4976
|
+
grids: Grid;
|
|
4977
|
+
constructor(identifier: string, path: string);
|
|
4978
|
+
setInputGrid(output_arr: number[][]): void;
|
|
4979
|
+
/**
|
|
4980
|
+
* 向网格中添加一个网格项。
|
|
4981
|
+
* @param {number[]} grid_position - 网格项的位置 [行, 列] 用于定位实体的背包槽。
|
|
4982
|
+
* @param {number[]} offset - 网格项的偏移量 [x, y]。
|
|
4983
|
+
* @param {Object} [options] - 可选参数,用于配置网格项。
|
|
4984
|
+
* @param {boolean} [options.enable=true] - 是否启用该网格项,默认为 true。
|
|
4985
|
+
* @param {number[]} [options.size] - 网格项的大小 [宽度, 高度]。
|
|
4986
|
+
* @param {UIElement[]} [options.background_images] - 网格项的背景图片控件。
|
|
4987
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
4988
|
+
*/
|
|
4989
|
+
addGridItem(grid_position: Offset2, offset: Offset2, options?: {
|
|
4990
|
+
enable?: boolean;
|
|
4991
|
+
size?: Any;
|
|
4992
|
+
background_images?: Any;
|
|
4993
|
+
}): this;
|
|
4994
|
+
addInputGrid(grid_position: Offset2, offset: Offset2, options?: {
|
|
4995
|
+
enable?: boolean;
|
|
4996
|
+
size?: Any;
|
|
4997
|
+
background_images?: Any;
|
|
4998
|
+
}): void;
|
|
4999
|
+
addOutputGrid(grid_position: Offset2, offset: Offset2, options?: {
|
|
5000
|
+
enable?: boolean;
|
|
5001
|
+
size?: Any;
|
|
5002
|
+
background_images?: Any;
|
|
5003
|
+
}): void;
|
|
5004
|
+
/**
|
|
5005
|
+
* 向主面板中添加一个 UI 元素。
|
|
5006
|
+
* @param {Any} element - 要添加的 UI 元素。
|
|
5007
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
5008
|
+
*/
|
|
5009
|
+
addElementToMain(element: Any): this;
|
|
5010
|
+
/**
|
|
5011
|
+
* 设置网格的维度(行和列)。
|
|
5012
|
+
* @param {number[]} dimension - 网格的维度 [行数, 列数]。
|
|
5013
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
5014
|
+
*/
|
|
5015
|
+
setGridDimension(dimension: number[]): this;
|
|
5016
|
+
/**
|
|
5017
|
+
* 设置容器的标题。
|
|
5018
|
+
* @param {string} title - 容器的标题。
|
|
5019
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
5020
|
+
*/
|
|
5021
|
+
setTitle(title: string): this;
|
|
5022
|
+
/**
|
|
5023
|
+
* 设置根面板的尺寸。
|
|
5024
|
+
* @param {number[]} size - 根面板的尺寸 [宽度, 高度]。
|
|
5025
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
5026
|
+
*/
|
|
5027
|
+
setSize(size: number[]): this;
|
|
5028
|
+
setItemMatrix(n: number, matrix: number[][]): void;
|
|
5029
|
+
}
|
|
5030
|
+
|
|
5031
|
+
/**
|
|
5032
|
+
* sapdon_ui: 页面壳路由系统(生成 server_form.json)
|
|
5033
|
+
*
|
|
5034
|
+
* 采用 Bedrock Wiki「Modifying Server Forms — Action Form」官方路由:
|
|
5035
|
+
* main_screen_content ─(modification: insert_back controls)→ sapdon_form_factory
|
|
5036
|
+
* └─ factory { name: server_form_factory, control_ids.long_form } → @server_form.sapdon_long_form_panel
|
|
5037
|
+
* └─ (modifications insert_back) 所有注册页 Panel($panel_id 前缀门控)
|
|
5038
|
+
* └─ content@$user_content_panel (下) + buttons@$user_buttons_panel (上)
|
|
5039
|
+
* vanilla long_form ─(modification: bindings)→ title 含 'sapdon_ui:' 时隐藏原生表单
|
|
5040
|
+
*
|
|
5041
|
+
* 关键收益:自定义页处于 main_screen_content 作用域 → #form_text / #title_text 均可解析。
|
|
5042
|
+
*/
|
|
5043
|
+
interface SapdonPageRegistration {
|
|
5044
|
+
panelId: string;
|
|
5045
|
+
contentPanel: UIElement | string;
|
|
5046
|
+
buttonsPanel?: UIElement | string;
|
|
5047
|
+
/** 页面控件名(默认 pageN) */
|
|
5048
|
+
name?: string;
|
|
5049
|
+
}
|
|
5050
|
+
declare class SapdonServerUI {
|
|
5051
|
+
static readonly MARKER = "sapdon_ui:";
|
|
5052
|
+
static readonly NS = "server_form";
|
|
5053
|
+
private static _system;
|
|
5054
|
+
private static _factories;
|
|
5055
|
+
private static _pageCount;
|
|
5056
|
+
private static _ensureBuilt;
|
|
5057
|
+
/** 页面根壳:在页面自己的 UISystem 里生成 <name> 元素(门控 + content/buttons 子控件 + 变量),供工厂 long_form 引用 */
|
|
5058
|
+
static createPageRoot(reg: {
|
|
5059
|
+
name: string;
|
|
5060
|
+
panelId: string;
|
|
5061
|
+
contentRef: string;
|
|
5062
|
+
buttonsRef: string;
|
|
5063
|
+
}): UIElement;
|
|
5064
|
+
/** 注册一个自定义页面:向 main_screen_content 追加一个纯 gated factory(long_form → @<页ns>.<name>),门控在页面根 */
|
|
5065
|
+
static registerPage(reg: SapdonPageRegistration): void;
|
|
5066
|
+
static getSystem(): UISystem | null;
|
|
5067
|
+
}
|
|
5068
|
+
|
|
5069
|
+
/**
|
|
5070
|
+
* SapdonPanel:一个自定义页面 = 一个 UI 文件(text_ui_xxx.json)
|
|
5071
|
+
* 由「内容面板 + 按键面板」两个元素组成。
|
|
5072
|
+
*/
|
|
5073
|
+
declare class SapdonPanel {
|
|
5074
|
+
private system;
|
|
5075
|
+
constructor(namespace: string);
|
|
5076
|
+
/** 设置内容面板元素 */
|
|
5077
|
+
setContent(content: UIElement): this;
|
|
5078
|
+
/** 设置按键面板元素 */
|
|
5079
|
+
setButtons(buttons: UIElement): this;
|
|
5080
|
+
build(): UISystem;
|
|
5081
|
+
}
|
|
5082
|
+
|
|
5083
|
+
/**
|
|
5084
|
+
* FormButton:服务端表单按钮(纯样式)。
|
|
5085
|
+
* 只管长什么样(三态纹理 / 尺寸 / 锚点 / 门控键),不含几何与绑定。
|
|
5086
|
+
* 必须 addButton 进 FormButtonGrid 才被注入集合/门控绑定并定位生效。
|
|
5087
|
+
*/
|
|
5088
|
+
declare class FormButton extends Button {
|
|
5089
|
+
constructor(id: string);
|
|
5090
|
+
/** 三态纹理 default/hover/pressed */
|
|
5091
|
+
setTexture(defaultTex: string, hoverTex: string, pressedTex: string): this;
|
|
5092
|
+
/** 尺寸(原地改,保留锚点/offset) */
|
|
5093
|
+
setSize(w: number | string, h: number | string): this;
|
|
5094
|
+
/** 锚点对齐(原地改,导航贴角用) */
|
|
5095
|
+
setAnchor(anchor: string): this;
|
|
5096
|
+
/** 门控键:仅当运行时 emit 的 #form_button_text 等于该键时可见(绑定由 Grid 注入) */
|
|
5097
|
+
setBinding(key: string): this;
|
|
5098
|
+
}
|
|
5099
|
+
|
|
5100
|
+
/**
|
|
5101
|
+
* FormButtonGrid:按键格盘(几何 + 激活)。
|
|
5102
|
+
* 内部一个 Grid(collection: form_buttons),把面板按 dimensions 分格;
|
|
5103
|
+
* addButton 时按 index 派生基准格 base 并注入 FormButton 的三组绑定。
|
|
5104
|
+
*/
|
|
5105
|
+
declare class FormButtonGrid {
|
|
5106
|
+
private grid;
|
|
5107
|
+
private cols;
|
|
5108
|
+
private rows;
|
|
5109
|
+
private index;
|
|
5110
|
+
private debug;
|
|
5111
|
+
private static readonly RED;
|
|
5112
|
+
constructor(id: string, options: {
|
|
5113
|
+
dimensions: [number, number];
|
|
5114
|
+
size: [number | string, number | string];
|
|
5115
|
+
});
|
|
5116
|
+
/** 给每个格子描红调试框 */
|
|
5117
|
+
enableDebug(): this;
|
|
5118
|
+
/** 加一枚内容:index 决定基准格(off_col = index%c, off_row = index/c);给 pos 则叠加。仅 FormButton 注入集合/门控绑定。 */
|
|
5119
|
+
addButton(index: number, btn: FormButton | UIElement, pos?: [number, number]): this;
|
|
5120
|
+
/** 注入 FormButton 的集合/门控绑定(离开 Grid 则无效) */
|
|
5121
|
+
private injectBindings;
|
|
5122
|
+
build(): UIElement;
|
|
5123
|
+
}
|
|
5124
|
+
|
|
5125
|
+
/**
|
|
5126
|
+
* SapdonGuideBook —— 帕秋莉式手册(分类索引 INDEX + 词条列表 CAT + 内容页 ENT + home/prev/next 导航)。
|
|
5127
|
+
*
|
|
5128
|
+
* 线协议(运行时发射):
|
|
5129
|
+
* body = "INDEX" → 显示分类索引网格(子按钮 = 各分类,setBinding 精确门控)
|
|
5130
|
+
* body = "CAT:<id>|p<N>" → 分类页(p0 左简介/右 list,p1+ 左右 list)
|
|
5131
|
+
* body = "ENT:<id>:<gi>|p<N>" → 词条内容页(按 pageType 渲染、可分页)
|
|
5132
|
+
* title = "sapdon_ui:<name>"
|
|
5133
|
+
* button(...) → 集合 form_buttons:分类按钮 or 导航,均 exact-match 门控
|
|
5134
|
+
*/
|
|
5135
|
+
type GuideBookPageType = 'text' | 'crafting' | 'spotlight' | 'image';
|
|
5136
|
+
interface GuideBookChapter {
|
|
5137
|
+
name: string;
|
|
5138
|
+
icon: string;
|
|
5139
|
+
/** 词条正文(多行,ENT 页逐行渲染;text 类型按 5 行/半页分页) */
|
|
5140
|
+
lines: string[];
|
|
5141
|
+
/** 页类型(默认 text) */
|
|
5142
|
+
pageType?: GuideBookPageType;
|
|
5143
|
+
/** crafting:3×3 合成格(9 项,空位 '')+ 输出图标 */
|
|
5144
|
+
craft?: {
|
|
5145
|
+
grid: string[];
|
|
5146
|
+
output: string;
|
|
5147
|
+
};
|
|
5148
|
+
/** spotlight:大图标 + 描述 */
|
|
5149
|
+
spotlight?: {
|
|
5150
|
+
icon: string;
|
|
5151
|
+
desc: string;
|
|
5152
|
+
};
|
|
5153
|
+
/** image:整页图 + 说明 */
|
|
5154
|
+
image?: {
|
|
5155
|
+
texture: string;
|
|
5156
|
+
caption: string;
|
|
5157
|
+
};
|
|
5158
|
+
}
|
|
5159
|
+
interface GuideBookCategory {
|
|
5160
|
+
/** 英文 id(路由用,如 intro / routing / controls / undecided) */
|
|
5161
|
+
id: string;
|
|
5162
|
+
/** 中文标题(左页标题 / 索引卡名称) */
|
|
5163
|
+
title: string;
|
|
5164
|
+
/** 分类图标(索引卡) */
|
|
5165
|
+
icon: string;
|
|
5166
|
+
/** 简介正文(左页,多行,逐行渲染) */
|
|
5167
|
+
introLines: string[];
|
|
5168
|
+
/** 右页章节条目 */
|
|
5169
|
+
chapters: GuideBookChapter[];
|
|
5170
|
+
}
|
|
5171
|
+
declare class SapdonGuideBook {
|
|
5172
|
+
private system;
|
|
5173
|
+
private namespace;
|
|
5174
|
+
private name;
|
|
5175
|
+
private size;
|
|
5176
|
+
private background;
|
|
5177
|
+
private debug;
|
|
5178
|
+
private coverTitle;
|
|
5179
|
+
private coverLines;
|
|
5180
|
+
constructor(identifier: string, size?: [number, number], background?: string);
|
|
5181
|
+
enableDebug(): this;
|
|
5182
|
+
/** 自定义封面:标题(可含 \n)+ 简介行 */
|
|
5183
|
+
setCover(title: string, lines: string[]): this;
|
|
5184
|
+
/** 布局容器:<tag> 命中 #form_text(含 tag 即显示) */
|
|
5185
|
+
private gateLayout;
|
|
5186
|
+
private navButton;
|
|
5187
|
+
private closeButton;
|
|
5188
|
+
/** NeoGuidebook 书页纸面:页脊 + 页边模板(左/右半页) */
|
|
5189
|
+
private bookPagePane;
|
|
5190
|
+
/** 全幅纸页基底:横向 50/50 左右半页(crease+edge),layer 0 常显 */
|
|
5191
|
+
private bookPageBase;
|
|
5192
|
+
/** 给游离 FormButton 注入集合/门控绑定(非 FormButtonGrid 场景,如章节条目行) */
|
|
5193
|
+
private wireButton;
|
|
5194
|
+
/** 章节列表列(章节标题 + 分割线 + ≤8 行条目) */
|
|
5195
|
+
private catListColumn;
|
|
5196
|
+
/** 介绍列(标题 + 分割线 + 简介逐行)——仅 p0 左页 */
|
|
5197
|
+
private catIntroColumn;
|
|
5198
|
+
/**
|
|
5199
|
+
* CAT 页(L2):按词条数分页容器,门控 CAT:<id>|p<N>。
|
|
5200
|
+
* p0:左=介绍,右=章节 list(≤8);p1+:左、右都是章节 list(容量 8+8=16,先填左列再右列)。
|
|
5201
|
+
*/
|
|
5202
|
+
private catPages;
|
|
5203
|
+
/** ENT 词条内容页(L3):按 pageType 分派布局;text 按 5 行/半页分页;门控 ENT:<id>:<gi>|p<N> */
|
|
5204
|
+
private entPages;
|
|
5205
|
+
build(categories: GuideBookCategory[]): this;
|
|
5206
|
+
getSystem(): UISystem;
|
|
5207
|
+
}
|
|
5208
|
+
|
|
3800
5209
|
declare class ItemTextureManager {
|
|
3801
5210
|
static item_texture_sets: Map<any, any>;
|
|
3802
5211
|
static getItemTextureSet(): Map<any, any>;
|
|
@@ -3846,13 +5255,6 @@ interface ISerializer {
|
|
|
3846
5255
|
declare function jsonEncoderReplacer(_: string, v: any): any;
|
|
3847
5256
|
declare const defaultSerializer: ISerializer;
|
|
3848
5257
|
declare function Serializable(serializer?: ISerializer): (_: any, ctx: DecoratorContext) => void;
|
|
3849
|
-
/**
|
|
3850
|
-
* 只能应用一个 Serializer
|
|
3851
|
-
*
|
|
3852
|
-
* 重复的 Serializer 会被覆盖
|
|
3853
|
-
* @param target
|
|
3854
|
-
* @param ctx
|
|
3855
|
-
*/
|
|
3856
5258
|
declare const Serializer: MethodDecorator;
|
|
3857
5259
|
declare function serialize<R, T extends object>(inst: T): R;
|
|
3858
5260
|
declare const jsonEncodeDecoder: EncodeDecoder<any, string>;
|
|
@@ -3881,5 +5283,5 @@ declare namespace registry {
|
|
|
3881
5283
|
function submit(): void;
|
|
3882
5284
|
}
|
|
3883
5285
|
|
|
3884
|
-
export { AddonAnimationController, AddonAnimationStateMachine, AddonAttachable, AddonAttachableDefinition, AddonAttachableDescription, AddonBiome, AddonBiomeDefinition, AddonBiomeDescription, AddonBlock, AddonBlockDefinition, AddonBlockDescription, AddonClientEntity, AddonClientEntityDefinition, AddonClientEntityDescription, AddonEntity, AddonEntityDefinition, AddonEntityDescription, AddonFeatureRule, AddonFeatureRuleDecription, AddonFeatureRuleDenifition, AddonItem, AddonItemDefinition, AddonItemDescription, AddonManifest, AddonManifestDependency, AddonManifestHeader, AddonManifestMetadata, AddonManifestModule, AddonMenuCategory, AddonOreFeature, AddonOreFeatureDefinition, AddonOreFeatureDescription, AddonRecipe, AddonRecipeFurnace, AddonRecipeFurnace_1_12, AddonRecipeFurnace_1_17, AddonRecipeShaped, AddonRecipeShaped_1_12, AddonRecipeShaped_1_17, AddonRecipeShaped_1_19, AddonRecipeShaped_1_20, AddonRecipeShapeless, AddonRecipeShapeless_1_12, AddonRecipeShapeless_1_17, AddonRenderController, AddonRenderControllerGroup, AddonSemanticVersion, Armor, Attachable, BasicBlock, BasicBundle, BasicEntity, BasicMovementBundle, Biome, BiomeAPI, BiomeComponent, BiomeFilter, Block, BlockAPI, BlockComponent, BookButton, BookCategoryGrid, BookImage, BookRecipeGrid, BookTitle, BookTitleBar,
|
|
3885
|
-
export type { ConstructorOf, EncodeDecoder, FlipbookItemOptions, FloatLiteral, ISerializer, RawType };
|
|
5286
|
+
export { AddonAnimationController, AddonAnimationStateMachine, AddonAttachable, AddonAttachableDefinition, AddonAttachableDescription, AddonBiome, AddonBiomeDefinition, AddonBiomeDescription, AddonBlock, AddonBlockDefinition, AddonBlockDescription, AddonClientEntity, AddonClientEntityDefinition, AddonClientEntityDescription, AddonEntity, AddonEntityDefinition, AddonEntityDescription, AddonFeatureRule, AddonFeatureRuleDecription, AddonFeatureRuleDenifition, AddonItem, AddonItemDefinition, AddonItemDescription, AddonManifest, AddonManifestDependency, AddonManifestHeader, AddonManifestMetadata, AddonManifestModule, AddonMenuCategory, AddonOreFeature, AddonOreFeatureDefinition, AddonOreFeatureDescription, AddonRecipe, AddonRecipeFurnace, AddonRecipeFurnace_1_12, AddonRecipeFurnace_1_17, AddonRecipeShaped, AddonRecipeShaped_1_12, AddonRecipeShaped_1_17, AddonRecipeShaped_1_19, AddonRecipeShaped_1_20, AddonRecipeShapeless, AddonRecipeShapeless_1_12, AddonRecipeShapeless_1_17, AddonRenderController, AddonRenderControllerGroup, AddonSemanticVersion, Armor, ArmorType, Attachable, BasicBlock, BasicBundle, BasicEntity, BasicMovementBundle, Biome, BiomeAPI, BiomeComponent, BiomeFilter, Block, BlockAPI, BlockComponent, BlockCustomComponentBuilder, BookButton, BookCategoryGrid, BookImage, BookRecipeGrid, BookText, BookTitle, BookTitleBar, Button, ButtonMapping, ChapterItem, ChestUISystem, ClientEntity, CollectionPanel, ContainerUISystem, Control, CoordinateDistribution, CropBlock, DataBinding, DataBindingObject, Divider, DummyEntity, EmptySpace, Entity, EntityAPI, EntityComponent, Factory, FeatureAPI, FeatureConditions, FeatureDistribution, FeatureRule, FenceBlock, FlipbookItem, FlipbookTextureConfig, FlipbookTextures, FollowMobBehavior, FollowParentBehavior, Food, FormButton, FormButtonGrid, GeometryBlock, GlassBlock, GoHomeBehavior, Grid, GridProp, HeadBlock, HudProgressBar, HudStatePanel, HudUISystem, Image, Input, Item, ItemAPI, ItemCatalog, ItemCategory, ItemComponent, ItemTextureManager, Label, Layout, Modifications, MoveTowardsHomeRestrictionBehavior, NativeEntity, NativeEntityData, Navigation, NearestAttackableTargetBehavor, NeoGuidebook, NeoGuidebookPage, NonNullMap, OreBlock, OreFeature, Panel, PickupItemsBehavior, Projectile, RandomStrollBehavior, RecipeAPI, RecipeInputTags, RecipeTags, RecipeTypes, RotatableBlock, RotationTypes, SapdonGuideBook, SapdonPanel, SapdonServerUI, SapdonTexturedButton, ScrollView, ScrollingPanel, Serializable, Serializer, Sound, Sprite, StackPanel, StairBlock, TemptBehavior, TerrainTextureManager, Text, TextureVariationConfig, TileBlock, TintMethod, TrapdoorBlock, UIElement, UISystem, UISystemRegistry, UiAPI, decode, defaultSerializer, encode, f64, getMetadata, getOrCreateMetadata, isRawJSON, jsonEncodeDecoder, jsonEncoderReplacer, mixin, registerBlock, registerEntity, registry, serialize };
|
|
5287
|
+
export type { ArmorOptions, ArmorSpec, BeforeOnPlayerPlaceEvent, BlockCustomComponentHandlers, BlockDescriptor, BlockPlacerOptions, ConstructorOf, CooldownOptions, CreateModelItemOptions, DiggerOptions, DurabilitySensorOptions, DurabilityThreshold, EncodeDecoder, EntityPlacerOptions, FlipbookEntry, FlipbookItemOptions, FloatLiteral, FoodComponentOptions, FoodOptions, GuideBookCategory, GuideBookChapter, GuideBookPageType, ISerializer, IconTextures, ItemCatalogCategory, ItemCatalogGroupOptions, ItemComponentMap, ItemOptions, ItemRarity, KineticWeaponOptions, ModelBoneTransform, OnBlockStateChangeEvent, OnBreakEvent, OnEntityEvent, OnEntityFallOnEvent, OnPlaceEvent, OnPlayerBreakEvent, OnPlayerInteractEvent, OnRandomTickEvent, OnRedstoneUpdateEvent, OnStepOffEvent, OnStepOnEvent, OnTickEvent, PiercingWeaponOptions, Range, RawType, RecordOptions, RepairItem, SapdonPageRegistration, SerializedElement, ShooterAmmunition, ShooterOptions, StorageItemOptions, SwingSoundsOptions, TextureEntry, TextureVariation, ThrowableOptions, UseModifiersOptions };
|