sapdon 3.0.2 → 3.0.3
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/dist/cli/build.d.ts +7 -0
- package/dist/cli/build.js +234 -0
- package/dist/cli/dev-server/client.d.ts +2 -0
- package/dist/cli/dev-server/client.js +21 -0
- package/dist/cli/dev-server/config.d.ts +3 -0
- package/dist/cli/dev-server/config.js +3 -0
- package/dist/cli/dev-server/handles.d.ts +4 -0
- package/dist/cli/dev-server/handles.js +5 -0
- package/dist/cli/dev-server/hmr.d.ts +1 -0
- package/dist/cli/dev-server/hmr.js +13 -0
- package/dist/cli/dev-server/index.d.ts +4 -0
- package/dist/cli/dev-server/index.js +17 -0
- package/dist/cli/dev-server/server.d.ts +14 -0
- package/dist/cli/dev-server/server.js +59 -0
- package/dist/cli/dev-server/syncFiles.d.ts +3 -0
- package/dist/cli/dev-server/syncFiles.js +37 -0
- package/dist/cli/index.d.ts +23 -0
- package/dist/cli/index.js +1 -0
- package/dist/cli/init.d.ts +9 -0
- package/dist/cli/init.js +80 -0
- package/dist/cli/load.d.ts +3 -0
- package/dist/cli/load.js +94 -0
- package/dist/cli/start.d.ts +2 -0
- package/dist/cli/start.js +2 -0
- package/dist/cli/tools/textureSet.d.ts +13 -0
- package/dist/cli/tools/textureSet.js +103 -0
- package/dist/cli/utils.d.ts +13 -0
- package/dist/cli/utils.js +89 -0
- package/dist/core/addon/biome.d.ts +22 -0
- package/dist/core/addon/biome.js +27 -0
- package/dist/core/addon/block/block.d.ts +41 -0
- package/dist/core/addon/block/block.js +46 -0
- package/dist/core/addon/controllers/animationController.d.ts +43 -0
- package/dist/core/addon/controllers/animationController.js +73 -0
- package/dist/core/addon/entity/clientEntity.d.ts +107 -0
- package/dist/core/addon/entity/clientEntity.js +149 -0
- package/dist/core/addon/entity/entity.d.ts +42 -0
- package/dist/core/addon/entity/entity.js +50 -0
- package/dist/core/addon/feature/oreFeature.d.ts +19 -0
- package/dist/core/addon/feature/oreFeature.js +24 -0
- package/dist/core/addon/featureRule.d.ts +20 -0
- package/dist/core/addon/featureRule.js +25 -0
- package/dist/core/addon/item/attachable.d.ts +94 -0
- package/dist/core/addon/item/attachable.js +134 -0
- package/dist/core/addon/item/item.d.ts +19 -0
- package/dist/core/addon/item/item.js +26 -0
- package/dist/core/addon/manifest.d.ts +49 -0
- package/dist/core/addon/manifest.js +65 -0
- package/dist/core/addon/menuCategory.d.ts +6 -0
- package/dist/core/addon/menuCategory.js +7 -0
- package/dist/core/addon/recipe/baseRecipe.d.ts +12 -0
- package/dist/core/addon/recipe/baseRecipe.js +23 -0
- package/dist/core/addon/recipe/data.d.ts +66 -0
- package/dist/core/addon/recipe/data.js +74 -0
- package/dist/core/addon/recipe/furnace.d.ts +17 -0
- package/dist/core/addon/recipe/furnace.js +43 -0
- package/dist/core/addon/recipe/shaped.d.ts +26 -0
- package/dist/core/addon/recipe/shaped.js +53 -0
- package/dist/core/addon/recipe/shapeless.d.ts +18 -0
- package/dist/core/addon/recipe/shapeless.js +36 -0
- package/dist/core/biome/biome.d.ts +14 -0
- package/dist/core/biome/biome.js +23 -0
- package/dist/core/biome/biomeComponent.d.ts +46 -0
- package/dist/core/biome/biomeComponent.js +77 -0
- package/dist/core/block/basicBlock.d.ts +48 -0
- package/dist/core/block/basicBlock.js +105 -0
- package/dist/core/block/block.d.ts +32 -0
- package/dist/core/block/block.js +92 -0
- package/dist/core/block/blockComponent.d.ts +187 -0
- package/dist/core/block/blockComponent.js +500 -0
- package/dist/core/block/cropBlock.d.ts +4 -0
- package/dist/core/block/cropBlock.js +27 -0
- package/dist/core/block/geometryBlock.d.ts +12 -0
- package/dist/core/block/geometryBlock.js +16 -0
- package/dist/core/block/oreBlock.d.ts +9 -0
- package/dist/core/block/oreBlock.js +25 -0
- package/dist/core/block/rotatableBlock.d.ts +27 -0
- package/dist/core/block/rotatableBlock.js +107 -0
- package/dist/core/block/tileBlock.d.ts +17 -0
- package/dist/core/block/tileBlock.js +125 -0
- package/dist/core/entity/basicEntity.d.ts +111 -0
- package/dist/core/entity/basicEntity.js +170 -0
- package/dist/core/entity/behavior/followMob.d.ts +12 -0
- package/dist/core/entity/behavior/followMob.js +35 -0
- package/dist/core/entity/behavior/followParent.d.ts +7 -0
- package/dist/core/entity/behavior/followParent.js +15 -0
- package/dist/core/entity/behavior/randomStroll.d.ts +31 -0
- package/dist/core/entity/behavior/randomStroll.js +63 -0
- package/dist/core/entity/behavior/tempt.d.ts +73 -0
- package/dist/core/entity/behavior/tempt.js +134 -0
- package/dist/core/entity/bundles/basicBundle.d.ts +13 -0
- package/dist/core/entity/bundles/basicBundle.js +45 -0
- package/dist/core/entity/clientEntity.d.ts +20 -0
- package/dist/core/entity/clientEntity.js +37 -0
- package/dist/core/entity/componets/entityComponet.d.ts +202 -0
- package/dist/core/entity/componets/entityComponet.js +347 -0
- package/dist/core/entity/data/nativeEntityData.d.ts +9 -0
- package/dist/core/entity/data/nativeEntityData.js +38 -0
- package/dist/core/entity/entity.d.ts +15 -0
- package/dist/core/entity/entity.js +18 -0
- package/dist/core/entity/nativeEntity.d.ts +8 -0
- package/dist/core/entity/nativeEntity.js +28 -0
- package/dist/core/entity/navigation/walk.d.ts +23 -0
- package/dist/core/entity/navigation/walk.js +56 -0
- package/dist/core/entity/projectile.d.ts +3 -0
- package/dist/core/entity/projectile.js +7 -0
- package/dist/core/factory/biomeFactory.d.ts +4 -0
- package/dist/core/factory/biomeFactory.js +13 -0
- package/dist/core/factory/blockFactory.d.ts +34 -0
- package/dist/core/factory/blockFactory.js +143 -0
- package/dist/core/factory/entityFactory.d.ts +17 -0
- package/dist/core/factory/entityFactory.js +75 -0
- package/dist/core/factory/featureFactory.d.ts +6 -0
- package/dist/core/factory/featureFactory.js +23 -0
- package/dist/core/factory/itemExtra.d.ts +8 -0
- package/dist/core/factory/itemExtra.js +9 -0
- package/dist/core/factory/itemFactory.d.ts +27 -0
- package/dist/core/factory/itemFactory.js +112 -0
- package/dist/core/factory/recipeFactory.d.ts +18 -0
- package/dist/core/factory/recipeFactory.js +39 -0
- package/dist/core/factory/uiFactory.d.ts +12 -0
- package/dist/core/factory/uiFactory.js +32 -0
- package/dist/core/feature/oreFeature.d.ts +10 -0
- package/dist/core/feature/oreFeature.js +11 -0
- package/dist/core/feature-rule/condition/biomeFilter.d.ts +26 -0
- package/dist/core/feature-rule/condition/biomeFilter.js +36 -0
- package/dist/core/feature-rule/condition/featureConditions.d.ts +27 -0
- package/dist/core/feature-rule/condition/featureConditions.js +37 -0
- package/dist/core/feature-rule/distribution/coordinateDistribution.d.ts +17 -0
- package/dist/core/feature-rule/distribution/coordinateDistribution.js +23 -0
- package/dist/core/feature-rule/distribution/featureDistribution.d.ts +31 -0
- package/dist/core/feature-rule/distribution/featureDistribution.js +41 -0
- package/dist/core/feature-rule/featureRule.d.ts +17 -0
- package/dist/core/feature-rule/featureRule.js +26 -0
- package/dist/core/index.d.ts +2062 -0
- package/dist/core/index.js +1 -0
- package/dist/core/item/armor.d.ts +21 -0
- package/dist/core/item/armor.js +90 -0
- package/dist/core/item/attachable.d.ts +6 -0
- package/dist/core/item/attachable.js +26 -0
- package/dist/core/item/food.d.ts +24 -0
- package/dist/core/item/food.js +38 -0
- package/dist/core/item/item.d.ts +36 -0
- package/dist/core/item/item.js +69 -0
- package/dist/core/item/itemComponents.d.ts +113 -0
- package/dist/core/item/itemComponents.js +225 -0
- package/dist/core/registry.d.ts +12 -0
- package/dist/core/registry.js +16 -0
- package/dist/core/texture.d.ts +18 -0
- package/dist/core/texture.js +38 -0
- package/dist/core/ui/buttonMapping.d.ts +97 -0
- package/dist/core/ui/buttonMapping.js +132 -0
- package/dist/core/ui/dataBindingObject.d.ts +97 -0
- package/dist/core/ui/dataBindingObject.js +134 -0
- package/dist/core/ui/elements/button.d.ts +21 -0
- package/dist/core/ui/elements/button.js +101 -0
- package/dist/core/ui/elements/collectionPanel.d.ts +12 -0
- package/dist/core/ui/elements/collectionPanel.js +53 -0
- package/dist/core/ui/elements/grid.d.ts +8 -0
- package/dist/core/ui/elements/grid.js +33 -0
- package/dist/core/ui/elements/image.d.ts +13 -0
- package/dist/core/ui/elements/image.js +55 -0
- package/dist/core/ui/elements/label.d.ts +14 -0
- package/dist/core/ui/elements/label.js +61 -0
- package/dist/core/ui/elements/panel.d.ts +11 -0
- package/dist/core/ui/elements/panel.js +49 -0
- package/dist/core/ui/elements/scrollingPanel.d.ts +14 -0
- package/dist/core/ui/elements/scrollingPanel.js +59 -0
- package/dist/core/ui/elements/stackPanel.d.ts +14 -0
- package/dist/core/ui/elements/stackPanel.js +37 -0
- package/dist/core/ui/elements/uiElement.d.ts +53 -0
- package/dist/core/ui/elements/uiElement.js +129 -0
- package/dist/core/ui/properties/control.d.ts +214 -0
- package/dist/core/ui/properties/control.js +286 -0
- package/dist/core/ui/properties/dataBinding.d.ts +6 -0
- package/dist/core/ui/properties/dataBinding.js +16 -0
- package/dist/core/ui/properties/factory.d.ts +37 -0
- package/dist/core/ui/properties/factory.js +62 -0
- package/dist/core/ui/properties/gridProp.d.ts +65 -0
- package/dist/core/ui/properties/gridProp.js +90 -0
- package/dist/core/ui/properties/input.d.ts +97 -0
- package/dist/core/ui/properties/input.js +134 -0
- package/dist/core/ui/properties/layout.d.ts +105 -0
- package/dist/core/ui/properties/layout.js +145 -0
- package/dist/core/ui/properties/scrollView.d.ts +105 -0
- package/dist/core/ui/properties/scrollView.js +145 -0
- package/dist/core/ui/properties/sound.d.ts +47 -0
- package/dist/core/ui/properties/sound.js +66 -0
- package/dist/core/ui/properties/sprite.d.ts +161 -0
- package/dist/core/ui/properties/sprite.js +222 -0
- package/dist/core/ui/properties/text.d.ts +135 -0
- package/dist/core/ui/properties/text.js +187 -0
- package/dist/core/ui/registry/uiSystemRegistry.d.ts +8 -0
- package/dist/core/ui/registry/uiSystemRegistry.js +26 -0
- package/dist/core/ui/systems/chest.d.ts +5 -0
- package/dist/core/ui/systems/chest.js +21 -0
- package/dist/core/ui/systems/containerUISystem.d.ts +67 -0
- package/dist/core/ui/systems/containerUISystem.js +214 -0
- package/dist/core/ui/systems/guidebook.d.ts +9 -0
- package/dist/core/ui/systems/guidebook.js +206 -0
- package/dist/core/ui/systems/serverForm.d.ts +13 -0
- package/dist/core/ui/systems/serverForm.js +116 -0
- package/dist/core/ui/systems/system.d.ts +16 -0
- package/dist/core/ui/systems/system.js +37 -0
- package/dist/oc/index.d.ts +142 -0
- package/dist/oc/index.js +1 -0
- package/doc/sapdon-ts.md +35 -1
- package/package.json +6 -8
|
@@ -0,0 +1,2062 @@
|
|
|
1
|
+
declare enum ItemCategory {
|
|
2
|
+
Commands = "commands",
|
|
3
|
+
Construction = "construction",
|
|
4
|
+
Equipment = "equipment",
|
|
5
|
+
Nature = "nature",
|
|
6
|
+
Items = "items",
|
|
7
|
+
None = "none"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare class Item {
|
|
11
|
+
/**
|
|
12
|
+
* 物品类
|
|
13
|
+
* @param {string} identifier 物品唯一标识符
|
|
14
|
+
* @param {string} category 菜单栏分类 可选:"construction", "nature", "equipment", "items", and "none"
|
|
15
|
+
* @param {string} texture 物品纹理
|
|
16
|
+
* @param {Object} options 可选参数
|
|
17
|
+
* @param {string} options.group 分组
|
|
18
|
+
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
19
|
+
*/
|
|
20
|
+
constructor(identifier: string, category: string, texture: string, options?: {
|
|
21
|
+
group: string;
|
|
22
|
+
hide_in_command: boolean;
|
|
23
|
+
});
|
|
24
|
+
identifier: string;
|
|
25
|
+
category: string;
|
|
26
|
+
texture: string;
|
|
27
|
+
group: string;
|
|
28
|
+
hide_in_command: boolean;
|
|
29
|
+
components: Map<any, any>;
|
|
30
|
+
/**
|
|
31
|
+
* 添加组件
|
|
32
|
+
* @param {Map} componentMap 组件 Map
|
|
33
|
+
*/
|
|
34
|
+
addComponent(componentMap: Map<any, any>): this;
|
|
35
|
+
/**
|
|
36
|
+
* 移除组件
|
|
37
|
+
* @param {string} key 组件名称
|
|
38
|
+
*/
|
|
39
|
+
removeComponent(key: string): this;
|
|
40
|
+
/**
|
|
41
|
+
* 将物品转换为 JSON 格式
|
|
42
|
+
* @returns {Object} JSON 格式的物品对象
|
|
43
|
+
*/
|
|
44
|
+
toJson(): Object;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare class Food extends Item {
|
|
48
|
+
/**
|
|
49
|
+
* 物品类
|
|
50
|
+
* @param {string} identifier 物品唯一标识符
|
|
51
|
+
* @param {string} category 菜单栏分类 可选:"construction", "nature", "equipment", "items", and "none"
|
|
52
|
+
* @param {string} texture 物品纹理
|
|
53
|
+
* @param {Object} options 可选参数
|
|
54
|
+
* @param {string} options.group 分组
|
|
55
|
+
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
56
|
+
* @param {string} options.animation 使用动画,默认为 "eat"
|
|
57
|
+
* @param {boolean} options.canAlwaysEat 是否总是可以食用,默认为 false
|
|
58
|
+
* @param {number} options.nutrition 营养价值,默认为 0
|
|
59
|
+
* @param {number} options.saturationModifier 饱和度修正值,默认为 1
|
|
60
|
+
*/
|
|
61
|
+
constructor(identifier: string, category: string, texture: string, options?: {
|
|
62
|
+
group: string;
|
|
63
|
+
hide_in_command: boolean;
|
|
64
|
+
animation: string;
|
|
65
|
+
canAlwaysEat: boolean;
|
|
66
|
+
nutrition: number;
|
|
67
|
+
saturationModifier: number;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare class AddonAttachableDescription {
|
|
72
|
+
/**
|
|
73
|
+
* 可附着物描述类
|
|
74
|
+
* @param {string} identifier 标识符
|
|
75
|
+
*/
|
|
76
|
+
constructor(identifier: string);
|
|
77
|
+
identifier: string;
|
|
78
|
+
/**
|
|
79
|
+
* 添加材质
|
|
80
|
+
* @param {string} name 材质名称
|
|
81
|
+
* @param {string} material 材质路径
|
|
82
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
83
|
+
*/
|
|
84
|
+
addMaterial(name: string, material: string): AddonAttachableDescription;
|
|
85
|
+
materials: {} | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* 添加纹理
|
|
88
|
+
* @param {string} name 纹理名称
|
|
89
|
+
* @param {string} texture 纹理路径
|
|
90
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
91
|
+
*/
|
|
92
|
+
addTexture(name: string, texture: string): AddonAttachableDescription;
|
|
93
|
+
textures: {} | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* 添加几何体
|
|
96
|
+
* @param {string} name 几何体名称
|
|
97
|
+
* @param {string} geometry 几何体路径
|
|
98
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
99
|
+
*/
|
|
100
|
+
addGeometry(name: string, geometry: string): AddonAttachableDescription;
|
|
101
|
+
geometry: {} | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* 添加动画
|
|
104
|
+
* @param {string} name 动画名称
|
|
105
|
+
* @param {string} animation 动画路径
|
|
106
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
107
|
+
*/
|
|
108
|
+
addAnimation(name: string, animation: string): AddonAttachableDescription;
|
|
109
|
+
animations: {} | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* 添加动画控制器
|
|
112
|
+
* @param {string} name 控制器名称
|
|
113
|
+
* @param {string} controller 控制器路径
|
|
114
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
115
|
+
*/
|
|
116
|
+
addAnimationController(name: string, controller: string): AddonAttachableDescription;
|
|
117
|
+
animation_controllers: any[] | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* 添加渲染控制器
|
|
120
|
+
* @param {string} controller 渲染控制器路径
|
|
121
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
122
|
+
*/
|
|
123
|
+
addRenderController(controller: string): AddonAttachableDescription;
|
|
124
|
+
render_controllers: any[] | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* 添加定位器
|
|
127
|
+
* @param {string} name 定位器名称
|
|
128
|
+
* @param {Object} locator 定位器数据
|
|
129
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
130
|
+
*/
|
|
131
|
+
addLocator(name: string, locator: Object): AddonAttachableDescription;
|
|
132
|
+
locators: {} | undefined;
|
|
133
|
+
/**
|
|
134
|
+
* 设置脚本
|
|
135
|
+
* @param {string} key 脚本键
|
|
136
|
+
* @param {string} value 脚本值
|
|
137
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
138
|
+
*/
|
|
139
|
+
setScript(key: string, value: string): AddonAttachableDescription;
|
|
140
|
+
scripts: {} | undefined;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
declare class Attachable extends AddonAttachableDescription {
|
|
144
|
+
constructor(identifier: any);
|
|
145
|
+
getId(): string;
|
|
146
|
+
toJson(): Object;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
declare class Armor {
|
|
150
|
+
constructor(identifier: any, category: any, item_texture: any, texture_path: any, options?: {});
|
|
151
|
+
identifier: any;
|
|
152
|
+
item: Item;
|
|
153
|
+
attachable: Attachable;
|
|
154
|
+
setArrachableGeometry(key: any, geometry: any): this;
|
|
155
|
+
}
|
|
156
|
+
declare class Chestplate extends Armor {
|
|
157
|
+
constructor(identifier: any, item_texture: any, texture_path: any, options?: {});
|
|
158
|
+
}
|
|
159
|
+
declare class Boot extends Armor {
|
|
160
|
+
constructor(identifier: any, item_texture: any, texture_path: any, options?: {});
|
|
161
|
+
}
|
|
162
|
+
declare class Leggings extends Armor {
|
|
163
|
+
constructor(identifier: any, item_texture: any, texture_path: any, options?: {});
|
|
164
|
+
}
|
|
165
|
+
declare class Helmet extends Armor {
|
|
166
|
+
constructor(identifier: any, item_texture: any, texture_path: any, options?: {});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
declare namespace ItemAPI {
|
|
170
|
+
function createItem(identifier: string, category: string, texture: string, options?: {
|
|
171
|
+
group: string;
|
|
172
|
+
hight_resolution: boolean;
|
|
173
|
+
hide_in_command: boolean;
|
|
174
|
+
}): Item;
|
|
175
|
+
function createFood(identifier: string, category: string, texture: string, options?: {
|
|
176
|
+
group: string;
|
|
177
|
+
hide_in_command: boolean;
|
|
178
|
+
animation: string;
|
|
179
|
+
canAlwaysEat: boolean;
|
|
180
|
+
nutrition: number;
|
|
181
|
+
saturationModifier: number;
|
|
182
|
+
}): Food;
|
|
183
|
+
function createAttachable(identifier: string, texture: string, material: string, options?: Object): Attachable;
|
|
184
|
+
function createChestplateArmor(identifier: any, item_texture: any, texture_path: any, options?: {}): Chestplate;
|
|
185
|
+
function createHelmetArmor(identifier: any, item_texture: any, texture_path: any, options?: {}): Helmet;
|
|
186
|
+
function createBootArmor(identifier: any, item_texture: any, texture_path: any, options?: {}): Boot;
|
|
187
|
+
function createLeggingsArmor(identifier: any, item_texture: any, texture_path: any, options?: {}): Leggings;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
declare class BasicBlock {
|
|
191
|
+
/**
|
|
192
|
+
* 基础方块类
|
|
193
|
+
* @param {string} identifier 方块唯一标识符
|
|
194
|
+
* @param {string} category 菜单栏分类 可选:"construction", "nature", "equipment", "items", and "none"
|
|
195
|
+
* @param {Array} textures_arr 纹理数组 [上,下,东,西,南,北]
|
|
196
|
+
* @param {Object} options 可选参数
|
|
197
|
+
* @param {string} options.group 分组,默认为 "construction"
|
|
198
|
+
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
199
|
+
*/
|
|
200
|
+
constructor(identifier: string, category: string, textures_arr: any[], options?: {
|
|
201
|
+
group: string;
|
|
202
|
+
hide_in_command: boolean;
|
|
203
|
+
});
|
|
204
|
+
identifier: string;
|
|
205
|
+
category: string;
|
|
206
|
+
textures: any[];
|
|
207
|
+
group: string;
|
|
208
|
+
hide_in_command: boolean;
|
|
209
|
+
traits: Map<any, any>;
|
|
210
|
+
states: Map<any, any>;
|
|
211
|
+
components: Map<any, any>;
|
|
212
|
+
permutations: any[];
|
|
213
|
+
getId(): string;
|
|
214
|
+
registerTrait(key: any, value: any): this;
|
|
215
|
+
registerState(key: any, value: any): this;
|
|
216
|
+
/**
|
|
217
|
+
* 添加组件
|
|
218
|
+
* @param {Map} componentMap 组件 Map
|
|
219
|
+
*/
|
|
220
|
+
addComponent(componentMap: Map<any, any>): this;
|
|
221
|
+
/**
|
|
222
|
+
* 移除组件
|
|
223
|
+
* @param {string} key 组件名称
|
|
224
|
+
*/
|
|
225
|
+
removeComponent(key: string): this;
|
|
226
|
+
/**
|
|
227
|
+
* 添加方块变体
|
|
228
|
+
* @param {string} condition 变体条件
|
|
229
|
+
* @param {Map} componentMap 组件 Map
|
|
230
|
+
*/
|
|
231
|
+
addPermutation(condition: string, componentMap: Map<any, any>): this;
|
|
232
|
+
/**
|
|
233
|
+
* 将方块对象转换为 JSON 格式
|
|
234
|
+
* @returns {Object} JSON 格式的方块对象
|
|
235
|
+
*/
|
|
236
|
+
toJson(): Object;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare class Block extends BasicBlock {
|
|
240
|
+
/**
|
|
241
|
+
* 方块类
|
|
242
|
+
* @param {string} identifier 方块的唯一标识符
|
|
243
|
+
* @param {string} category 方块的分类 "construction", "nature", "equipment", "items", and "none"
|
|
244
|
+
* @param {Array} variantDatas 方块的变体数据,包含每个变体的状态标签和纹理
|
|
245
|
+
* @param {Object} options 可选参数
|
|
246
|
+
* @param {string} options.group 分组,默认为 "construction"
|
|
247
|
+
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
248
|
+
* @param {boolean} options.ambient_occlusion 是否应用环境光遮蔽,默认为 false
|
|
249
|
+
* @param {boolean} options.face_dimming 是否根据面的方向进行亮度调整,默认为 false
|
|
250
|
+
* @param {string} options.render_method 渲染方法,默认为 "alpha_test"
|
|
251
|
+
*/
|
|
252
|
+
constructor(identifier: string, category: string, variantDatas: any[], options?: {
|
|
253
|
+
group: string;
|
|
254
|
+
hide_in_command: boolean;
|
|
255
|
+
ambient_occlusion: boolean;
|
|
256
|
+
face_dimming: boolean;
|
|
257
|
+
render_method: string;
|
|
258
|
+
});
|
|
259
|
+
options: {
|
|
260
|
+
group: string;
|
|
261
|
+
hide_in_command: boolean;
|
|
262
|
+
ambient_occlusion: boolean;
|
|
263
|
+
face_dimming: boolean;
|
|
264
|
+
render_method: string;
|
|
265
|
+
};
|
|
266
|
+
variantDatas: any[];
|
|
267
|
+
addVariantComponent(variantIndex: any, componentMap: any): this;
|
|
268
|
+
#private;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
declare class RotatableBlock extends BasicBlock {
|
|
272
|
+
/**
|
|
273
|
+
* 可旋转方块类
|
|
274
|
+
* @param {string} identifier 方块唯一标识符
|
|
275
|
+
* @param {string} category 菜单栏分类
|
|
276
|
+
* @param {Array} textures_arr 纹理数组 [上,下,东,西,南,北]
|
|
277
|
+
* @param {Object} options 可选参数
|
|
278
|
+
* @param {string} options.group 分组,默认为 "construction"
|
|
279
|
+
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
280
|
+
* @param {string} options.rotationType 旋转类型,默认为 "cardinal"
|
|
281
|
+
* @param {number} options.yRotationOffset 初始旋转偏移量,默认为 180
|
|
282
|
+
*/
|
|
283
|
+
constructor(identifier: string, category: string, textures_arr: any[], options?: {
|
|
284
|
+
group: string;
|
|
285
|
+
hide_in_command: boolean;
|
|
286
|
+
rotationType: string;
|
|
287
|
+
yRotationOffset: number;
|
|
288
|
+
});
|
|
289
|
+
#private;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
declare class GeometryBlock extends BasicBlock {
|
|
293
|
+
/**
|
|
294
|
+
* 带模型方块类
|
|
295
|
+
* @param {string} identifier 方块标识符 由命名空间和方块名组成 例如 "my_mod:stone"
|
|
296
|
+
* @param {string} category 方块的分类 "construction", "nature", "equipment", "items", and "none"
|
|
297
|
+
* @param {string} geometry 模型标识符
|
|
298
|
+
* @param {Object} material_instances 材质实例对象
|
|
299
|
+
* @param {Object} options 可选参数
|
|
300
|
+
*/
|
|
301
|
+
constructor(identifier: string, category: string, geometry: string, material_instances: Object, options?: Object);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
declare class OreFeature {
|
|
305
|
+
constructor(identifier: any, count: any, replace_rules: any);
|
|
306
|
+
identifier: any;
|
|
307
|
+
count: any;
|
|
308
|
+
replace_rules: any;
|
|
309
|
+
toJson(): {
|
|
310
|
+
format_version: any;
|
|
311
|
+
"minecraft:ore_feature": any;
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* 表示生物群系过滤条件的类
|
|
317
|
+
*/
|
|
318
|
+
declare class BiomeFilter {
|
|
319
|
+
filters: any[];
|
|
320
|
+
/**
|
|
321
|
+
* 添加一个逻辑条件组(如 any_of, all_of)
|
|
322
|
+
* @param {"any_of" | "all_of"} logicType - 逻辑类型
|
|
323
|
+
* @param {Array<Object>} conditions - 条件数组
|
|
324
|
+
* @returns {BiomeFilter} 返回自身以支持链式调用
|
|
325
|
+
*/
|
|
326
|
+
addLogicGroup(logicType: "any_of" | "all_of", conditions: Array<Object>): BiomeFilter;
|
|
327
|
+
/**
|
|
328
|
+
* 添加一个简单条件(如 has_biome_tag)
|
|
329
|
+
* @param {string} test - 测试类型(如 "has_biome_tag")
|
|
330
|
+
* @param {"==" | "!="} operator - 操作符
|
|
331
|
+
* @param {string} value - 目标值(如 "overworld")
|
|
332
|
+
* @returns {BiomeFilter} 返回自身以支持链式调用
|
|
333
|
+
*/
|
|
334
|
+
addSimpleCondition(test: string, operator: "==" | "!=", value: string): BiomeFilter;
|
|
335
|
+
/**
|
|
336
|
+
* 转换为 JSON 格式
|
|
337
|
+
* @returns {Array<Object>} 返回生物群系过滤条件数组
|
|
338
|
+
*/
|
|
339
|
+
toJson(): Array<Object>;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* 表示功能规则生成条件的类
|
|
344
|
+
*/
|
|
345
|
+
declare class FeatureConditions {
|
|
346
|
+
conditions: {
|
|
347
|
+
placement_pass: string;
|
|
348
|
+
"minecraft:biome_filter": never[];
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* 设置生成阶段(placement_pass)
|
|
352
|
+
* @param {string} pass - 生成阶段标识符(如 "underground_pass")
|
|
353
|
+
* @returns {FeatureConditions} 返回自身以支持链式调用
|
|
354
|
+
*/
|
|
355
|
+
setPlacementPass(pass: string): FeatureConditions;
|
|
356
|
+
/**
|
|
357
|
+
* 设置生物群系过滤器
|
|
358
|
+
* @param {BiomeFilter} biomeFilter - 生物群系过滤条件对象
|
|
359
|
+
* @returns {FeatureConditions} 返回自身以支持链式调用
|
|
360
|
+
*/
|
|
361
|
+
setBiomeFilter(biomeFilter: BiomeFilter): FeatureConditions;
|
|
362
|
+
/**
|
|
363
|
+
* 转换为 JSON 格式
|
|
364
|
+
* @returns {Object} 返回生成条件对象
|
|
365
|
+
*/
|
|
366
|
+
toJson(): Object;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* 表示单个坐标轴(x/y/z)分布规则的类
|
|
371
|
+
*/
|
|
372
|
+
declare class CoordinateDistribution {
|
|
373
|
+
/**
|
|
374
|
+
* @param {"uniform" | "triangle"} distribution - 分布类型
|
|
375
|
+
* @param {Array<number>} extent - 范围(如 [0, 16])
|
|
376
|
+
*/
|
|
377
|
+
constructor(distribution?: "uniform" | "triangle", extent?: Array<number>);
|
|
378
|
+
distribution: "uniform" | "triangle";
|
|
379
|
+
extent: number[];
|
|
380
|
+
/**
|
|
381
|
+
* 转换为 JSON 格式
|
|
382
|
+
* @returns {Object} 返回坐标分布配置
|
|
383
|
+
*/
|
|
384
|
+
toJson(): Object;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* 表示功能规则分布配置的类
|
|
389
|
+
*/
|
|
390
|
+
declare class FeatureDistribution {
|
|
391
|
+
distribution: {
|
|
392
|
+
iterations: number;
|
|
393
|
+
coordinate_eval_order: string;
|
|
394
|
+
x: Object;
|
|
395
|
+
y: Object;
|
|
396
|
+
z: Object;
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* 设置迭代次数
|
|
400
|
+
* @param {number} iterations - 放置尝试次数
|
|
401
|
+
* @returns {FeatureDistribution} 返回自身以支持链式调用
|
|
402
|
+
*/
|
|
403
|
+
setIterations(iterations: number): FeatureDistribution;
|
|
404
|
+
/**
|
|
405
|
+
* 设置坐标轴的分布规则
|
|
406
|
+
* @param {"x" | "y" | "z"} axis - 坐标轴
|
|
407
|
+
* @param {CoordinateDistribution} config - 分布配置
|
|
408
|
+
* @returns {FeatureDistribution} 返回自身以支持链式调用
|
|
409
|
+
*/
|
|
410
|
+
setAxisDistribution(axis: "x" | "y" | "z", config: CoordinateDistribution): FeatureDistribution;
|
|
411
|
+
/**
|
|
412
|
+
* 转换为 JSON 格式
|
|
413
|
+
* @returns {Object} 返回分布规则对象
|
|
414
|
+
*/
|
|
415
|
+
toJson(): Object;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
declare class FeatureRule {
|
|
419
|
+
constructor(identifier: any, places_feature: any);
|
|
420
|
+
identifier: any;
|
|
421
|
+
places_feature: any;
|
|
422
|
+
condition: FeatureConditions;
|
|
423
|
+
distribution: FeatureDistribution;
|
|
424
|
+
setPlacementPass(pass: any): void;
|
|
425
|
+
setBiomeFilter(biomeFilter: any): void;
|
|
426
|
+
setIterations(iterations: any): void;
|
|
427
|
+
setAxisDistribution(axis: any, config: any): void;
|
|
428
|
+
toJson(): {
|
|
429
|
+
format_version: any;
|
|
430
|
+
"minecraft:feature_rules": any;
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
declare class OreBlock {
|
|
435
|
+
constructor(identifier: any, category: any, textures_arr: any, options?: {});
|
|
436
|
+
block: BasicBlock;
|
|
437
|
+
feature: OreFeature;
|
|
438
|
+
feature_rules: FeatureRule;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
declare class CropBlock extends Block {
|
|
442
|
+
stageNum: number;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
declare namespace BlockAPI {
|
|
446
|
+
function createBasicBlock(identifier: string, category: string, textures_arr: any[], options?: {
|
|
447
|
+
group: string;
|
|
448
|
+
hide_in_command: boolean;
|
|
449
|
+
}): BasicBlock;
|
|
450
|
+
function createBlock(identifier: string, category: string, variantDatas: any[], options?: {
|
|
451
|
+
group: string;
|
|
452
|
+
hide_in_command: boolean;
|
|
453
|
+
ambient_occlusion: boolean;
|
|
454
|
+
face_dimming: boolean;
|
|
455
|
+
render_method: string;
|
|
456
|
+
}): Block;
|
|
457
|
+
function createRotatableBlock(identifier: string, category: string, textures_arr: any[], options?: {
|
|
458
|
+
group: string;
|
|
459
|
+
hide_in_command: boolean;
|
|
460
|
+
rotationType: string;
|
|
461
|
+
yRotationOffset: number;
|
|
462
|
+
}): RotatableBlock;
|
|
463
|
+
function createGeometryBlock(identifier: any, category: any, geometry: any, material_instances: any, options?: {}): GeometryBlock;
|
|
464
|
+
function createOreBlock(identifier: any, category: any, textures_arr: any, options?: {}): OreBlock;
|
|
465
|
+
function createCropBlock(identifier: string, category: string, variantDatas: any[], options?: {
|
|
466
|
+
group: string;
|
|
467
|
+
hide_in_command: boolean;
|
|
468
|
+
ambient_occlusion: boolean;
|
|
469
|
+
face_dimming: boolean;
|
|
470
|
+
render_method: string;
|
|
471
|
+
}): CropBlock;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
declare namespace FeatureAPI {
|
|
475
|
+
function createOreFeature(identifier: any, count: any, replace_rules: any): OreFeature;
|
|
476
|
+
function createFeatureRules(identifier: any, places_feature: any): FeatureRule;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
declare class BasicEntity {
|
|
480
|
+
/**
|
|
481
|
+
* 构造函数
|
|
482
|
+
* @param {string} identifier - 实体的唯一标识符
|
|
483
|
+
* @param {Object} options - 配置选项
|
|
484
|
+
* @param {boolean} [options.is_spawnable=true] - 是否可生成
|
|
485
|
+
* @param {boolean} [options.is_summonable=true] - 是否可召唤
|
|
486
|
+
* @param {string} [options.runtime_identifier] - 复刻标识符
|
|
487
|
+
* @param {Object} data - 继承的数据
|
|
488
|
+
* @param {Object} [data.components={}] - 继承的组件
|
|
489
|
+
* @param {Object} [data.component_groups={}] - 继承的组件组
|
|
490
|
+
* @param {Object} [data.events={}] - 继承的事件
|
|
491
|
+
*/
|
|
492
|
+
constructor(identifier: string, options?: {
|
|
493
|
+
is_spawnable?: boolean | undefined;
|
|
494
|
+
is_summonable?: boolean | undefined;
|
|
495
|
+
runtime_identifier?: string | undefined;
|
|
496
|
+
}, data?: {
|
|
497
|
+
components?: Object | undefined;
|
|
498
|
+
component_groups?: Object | undefined;
|
|
499
|
+
events?: Object | undefined;
|
|
500
|
+
});
|
|
501
|
+
identifier: string;
|
|
502
|
+
is_spawnable: boolean;
|
|
503
|
+
is_summonable: boolean;
|
|
504
|
+
runtime_identifier: string | undefined;
|
|
505
|
+
properties: Map<string, any>;
|
|
506
|
+
components: Map<string, any>;
|
|
507
|
+
component_groups: Map<string, any>;
|
|
508
|
+
events: Map<string, any>;
|
|
509
|
+
/**
|
|
510
|
+
* 添加属性到实体
|
|
511
|
+
* @param {string} name 属性名称
|
|
512
|
+
* @param {Object} value 属性值
|
|
513
|
+
* @returns
|
|
514
|
+
*/
|
|
515
|
+
addProperty(name: string, value: Object): this;
|
|
516
|
+
/**
|
|
517
|
+
* 移除属性
|
|
518
|
+
* @param {string} name 属性名称
|
|
519
|
+
* @returns
|
|
520
|
+
*/
|
|
521
|
+
removeProperty(name: string): this;
|
|
522
|
+
/**
|
|
523
|
+
* 移除所有属性
|
|
524
|
+
* @returns
|
|
525
|
+
*/
|
|
526
|
+
clearProperties(): this;
|
|
527
|
+
/**
|
|
528
|
+
* 添加事件到实体
|
|
529
|
+
* @param {string} name - 事件名称
|
|
530
|
+
* @param {Map} eventMap - 事件的键值对 Map
|
|
531
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
532
|
+
*/
|
|
533
|
+
addEvent(name: string, eventMap: Map<any, any>): BasicEntity;
|
|
534
|
+
/**
|
|
535
|
+
* 删除事件
|
|
536
|
+
* @param {string} name - 事件名称
|
|
537
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
538
|
+
*/
|
|
539
|
+
removeEvent(name: string): BasicEntity;
|
|
540
|
+
/**
|
|
541
|
+
* 清除所有事件
|
|
542
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
543
|
+
*/
|
|
544
|
+
clearEvents(): BasicEntity;
|
|
545
|
+
/**
|
|
546
|
+
* 添加组件组到实体
|
|
547
|
+
* @param {string} name - 组件组名称
|
|
548
|
+
* @param {Map} componentMap - 组件组的键值对 Map
|
|
549
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
550
|
+
*/
|
|
551
|
+
addComponentGroup(name: string, componentMap: Map<any, any>): BasicEntity;
|
|
552
|
+
/**
|
|
553
|
+
* 删除组件组
|
|
554
|
+
* @param {string} name - 组件组名称
|
|
555
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
556
|
+
*/
|
|
557
|
+
removeComponentGroup(name: string): BasicEntity;
|
|
558
|
+
/**
|
|
559
|
+
* 清除所有组件组
|
|
560
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
561
|
+
*/
|
|
562
|
+
clearComponentGroups(): BasicEntity;
|
|
563
|
+
/**
|
|
564
|
+
* 添加组件到实体
|
|
565
|
+
* @param {Map} componentMap - 组件的键值对 Map
|
|
566
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
567
|
+
*/
|
|
568
|
+
addComponent(componentMap: Map<any, any>): BasicEntity;
|
|
569
|
+
/**
|
|
570
|
+
* 删除组件
|
|
571
|
+
* @param {string} key - 组件名称
|
|
572
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
573
|
+
*/
|
|
574
|
+
removeComponent(key: string): BasicEntity;
|
|
575
|
+
/**
|
|
576
|
+
* 清除所有组件
|
|
577
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
578
|
+
*/
|
|
579
|
+
clearComponents(): BasicEntity;
|
|
580
|
+
/**
|
|
581
|
+
* 清除所有数据
|
|
582
|
+
*/
|
|
583
|
+
clearAll(): this;
|
|
584
|
+
/**
|
|
585
|
+
* 将实体转换为 JSON 格式
|
|
586
|
+
* @returns {Object} - 返回 JSON 格式的实体数据
|
|
587
|
+
*/
|
|
588
|
+
toJson(): Object;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
declare class AddonClientEntityDescription {
|
|
592
|
+
/**
|
|
593
|
+
* 实体描述类
|
|
594
|
+
* @param {string} identifier 实体标识符
|
|
595
|
+
* @param {string} min_engine_version 最低引擎版本
|
|
596
|
+
*/
|
|
597
|
+
constructor(identifier: string, min_engine_version: string);
|
|
598
|
+
identifier: string;
|
|
599
|
+
min_engine_version: string;
|
|
600
|
+
/**
|
|
601
|
+
* 添加材质
|
|
602
|
+
* @param {string} name 材质名称
|
|
603
|
+
* @param {string} material 材质路径
|
|
604
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
605
|
+
*/
|
|
606
|
+
addMaterial(name: string, material: string): AddonClientEntityDescription;
|
|
607
|
+
materials: {} | undefined;
|
|
608
|
+
/**
|
|
609
|
+
* 添加纹理
|
|
610
|
+
* @param {string} name 纹理名称
|
|
611
|
+
* @param {string} texture 纹理路径
|
|
612
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
613
|
+
*/
|
|
614
|
+
addTexture(name: string, texture: string): AddonClientEntityDescription;
|
|
615
|
+
textures: {} | undefined;
|
|
616
|
+
/**
|
|
617
|
+
* 添加几何体
|
|
618
|
+
* @param {string} name 几何体名称
|
|
619
|
+
* @param {string} geometry 几何体路径
|
|
620
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
621
|
+
*/
|
|
622
|
+
addGeometry(name: string, geometry: string): AddonClientEntityDescription;
|
|
623
|
+
geometry: {} | undefined;
|
|
624
|
+
/**
|
|
625
|
+
* 添加动画
|
|
626
|
+
* @param {string} name 动画名称
|
|
627
|
+
* @param {string} animation 动画路径
|
|
628
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
629
|
+
*/
|
|
630
|
+
addAnimation(name: string, animation: string): AddonClientEntityDescription;
|
|
631
|
+
animations: {} | undefined;
|
|
632
|
+
/**
|
|
633
|
+
* 添加动画控制器
|
|
634
|
+
* @param {string} name 控制器名称
|
|
635
|
+
* @param {string} controller 控制器路径
|
|
636
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
637
|
+
*/
|
|
638
|
+
addAnimationController(name: string, controller: string): AddonClientEntityDescription;
|
|
639
|
+
animation_controllers: any[] | undefined;
|
|
640
|
+
/**
|
|
641
|
+
* 添加渲染控制器
|
|
642
|
+
* @param {string} controller 渲染控制器路径
|
|
643
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
644
|
+
*/
|
|
645
|
+
addRenderController(controller: string): AddonClientEntityDescription;
|
|
646
|
+
render_controllers: any[] | undefined;
|
|
647
|
+
/**
|
|
648
|
+
* 添加定位器
|
|
649
|
+
* @param {string} name 定位器名称
|
|
650
|
+
* @param {Object} locator 定位器数据
|
|
651
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
652
|
+
*/
|
|
653
|
+
addLocator(name: string, locator: Object): AddonClientEntityDescription;
|
|
654
|
+
locators: {} | undefined;
|
|
655
|
+
/**
|
|
656
|
+
* 设置生成蛋
|
|
657
|
+
* @param {string} texture 生成蛋纹理
|
|
658
|
+
* @param {number} texture_index 生成蛋纹理索引
|
|
659
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
660
|
+
*/
|
|
661
|
+
setSpawnEgg(texture: string, texture_index: number): AddonClientEntityDescription;
|
|
662
|
+
spawn_egg: {
|
|
663
|
+
texture: string;
|
|
664
|
+
texture_index: number;
|
|
665
|
+
} | undefined;
|
|
666
|
+
/**
|
|
667
|
+
* 设置脚本
|
|
668
|
+
* @param {string} key 脚本键
|
|
669
|
+
* @param {string} value 脚本值
|
|
670
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
671
|
+
*/
|
|
672
|
+
setScript(key: string, value: string): AddonClientEntityDescription;
|
|
673
|
+
scripts: {} | undefined;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* ClientEntity 类,用于表示客户端实体。
|
|
678
|
+
* 继承自 AddonClientEntityDescription,并扩展了实体的数据加载和 JSON 序列化功能。
|
|
679
|
+
*/
|
|
680
|
+
declare class ClientEntity extends AddonClientEntityDescription {
|
|
681
|
+
/**
|
|
682
|
+
* 构造函数,用于创建一个客户端实体实例。
|
|
683
|
+
*
|
|
684
|
+
* @param {string} identifier - 实体的唯一标识符。
|
|
685
|
+
* @param {Object} data - 实体的初始数据,默认为空对象。
|
|
686
|
+
*/
|
|
687
|
+
constructor(identifier: string, data?: Object);
|
|
688
|
+
/**
|
|
689
|
+
* 将当前实体实例转换为 JSON 格式。
|
|
690
|
+
*
|
|
691
|
+
* @returns {Object} - 表示实体的 JSON 对象。
|
|
692
|
+
*/
|
|
693
|
+
toJson(): Object;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
declare namespace EntityAPI {
|
|
697
|
+
function createNativeEntity(identifier: string, proto_id: string, options?: Object): {
|
|
698
|
+
behavior: BasicEntity;
|
|
699
|
+
resource: ClientEntity;
|
|
700
|
+
};
|
|
701
|
+
function createEntity(identifier: string, texture: string, behData: Object, resData: Object, options?: Object): {
|
|
702
|
+
behavior: BasicEntity;
|
|
703
|
+
resource: ClientEntity;
|
|
704
|
+
};
|
|
705
|
+
function createProjectile(identifier: string, texture: string, options?: Object): {
|
|
706
|
+
behavior: BasicEntity;
|
|
707
|
+
resource: ClientEntity;
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
declare class AddonRecipe {
|
|
712
|
+
constructor(format_version: any, recipe_type: any, definitions?: {});
|
|
713
|
+
format_version: any;
|
|
714
|
+
recipe_type: any;
|
|
715
|
+
definitions: {};
|
|
716
|
+
getId(): any;
|
|
717
|
+
identifier(identifier: any): this;
|
|
718
|
+
tags(tags: any): this;
|
|
719
|
+
toJson(): {
|
|
720
|
+
format_version: any;
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
declare class AddonRecipeFurnace extends AddonRecipe {
|
|
725
|
+
/**
|
|
726
|
+
* @param {'1.12'|'1.17'} ver
|
|
727
|
+
* @param {any} def
|
|
728
|
+
*/
|
|
729
|
+
static create(ver: "1.12" | "1.17", def: any): AddonRecipeFurnace;
|
|
730
|
+
constructor(format_version: any, definitions: any);
|
|
731
|
+
input(item: any, data: any, count: any): this;
|
|
732
|
+
output(item: any): this;
|
|
733
|
+
}
|
|
734
|
+
declare class AddonRecipeFurnace_1_17 extends AddonRecipeFurnace {
|
|
735
|
+
constructor(definitions?: {});
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
declare class AddonRecipeShaped extends AddonRecipe {
|
|
739
|
+
/**
|
|
740
|
+
* @param {'1.12'|'1.17'|'1.19'|'1.20'} ver
|
|
741
|
+
* @param {any} def
|
|
742
|
+
*/
|
|
743
|
+
static create(ver: "1.12" | "1.17" | "1.19" | "1.20", def: any): AddonRecipeShaped;
|
|
744
|
+
constructor(format_version: any, definitions: any);
|
|
745
|
+
assumeSymmetry(): void;
|
|
746
|
+
key(key: any): this;
|
|
747
|
+
pattern(pattern: any): this;
|
|
748
|
+
priority(priority: any): this;
|
|
749
|
+
output(item: any): this;
|
|
750
|
+
}
|
|
751
|
+
declare class AddonRecipeShaped_1_20 extends AddonRecipeShaped {
|
|
752
|
+
constructor(definitions: any);
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
declare class AddonRecipeShapeless extends AddonRecipe {
|
|
756
|
+
/**
|
|
757
|
+
* @param {'1.12'|'1.17'} ver
|
|
758
|
+
* @param {any} def
|
|
759
|
+
*/
|
|
760
|
+
static create(ver: "1.12" | "1.17", def: any): AddonRecipeShapeless;
|
|
761
|
+
constructor(format_version: any, definitions: any);
|
|
762
|
+
priority(priority: any): this;
|
|
763
|
+
ingredients(ingredients: any): this;
|
|
764
|
+
output(item: any): this;
|
|
765
|
+
}
|
|
766
|
+
declare class AddonRecipeShapeless_1_17 extends AddonRecipeShapeless {
|
|
767
|
+
constructor(definitions: any);
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
declare const RecipeAPI: RecipeRegistry;
|
|
771
|
+
declare class RecipeRegistry {
|
|
772
|
+
/**
|
|
773
|
+
*
|
|
774
|
+
* @param {AddonRecipeFurnace_1_17} recipe
|
|
775
|
+
*/
|
|
776
|
+
registerRecipe(recipe: AddonRecipeFurnace_1_17): void;
|
|
777
|
+
registerSimpleFurnace(identifier: any, output: any, input: any): AddonRecipeFurnace_1_17;
|
|
778
|
+
registerFurnace(identifier: any): AddonRecipeFurnace_1_17;
|
|
779
|
+
registerSimpleShaped(identifier: any, output: any, pattern: any, key: any): AddonRecipeShaped_1_20;
|
|
780
|
+
registerShaped(identifier: any): AddonRecipeShaped_1_20;
|
|
781
|
+
registerSimpleShapeless(identifier: any, output: any, ingredients: any): AddonRecipeShapeless_1_17;
|
|
782
|
+
registerShapeless(identifier: any): AddonRecipeShapeless_1_17;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
declare class BlockComponent {
|
|
786
|
+
static setTick(interval_range: any, looping: any): Map<any, any>;
|
|
787
|
+
/**
|
|
788
|
+
*
|
|
789
|
+
* @param {Array} custom_components
|
|
790
|
+
* @returns
|
|
791
|
+
*/
|
|
792
|
+
static setCustomComponents(custom_components: any[]): Map<any, any>;
|
|
793
|
+
/**
|
|
794
|
+
* 创建一个用于 Minecraft 方块的变换对象,并返回一个 Map。
|
|
795
|
+
* @param {number[]} [translation=[0, 0, 0]] - 平移向量 [x, y, z]。
|
|
796
|
+
* @param {number[]} [scale=[1, 1, 1]] - 缩放向量 [x, y, z]。
|
|
797
|
+
* @param {number[]} [scale_pivot=[0, 0, 0]] - 缩放的枢轴点 [x, y, z]。
|
|
798
|
+
* @param {number[]} [rotation=[0, 0, 0]] - 旋转向量(角度)[x, y, z]。
|
|
799
|
+
* @param {number[]} [rotation_pivot=[0, 0, 0]] - 旋转的枢轴点 [x, y, z]。
|
|
800
|
+
* @returns {Map} - 一个包含变换数据的 Map 对象。
|
|
801
|
+
* @throws {Error} - 如果任何参数无效,则抛出错误。
|
|
802
|
+
*/
|
|
803
|
+
static setTransformation(translation?: number[], scale?: number[], scale_pivot?: number[], rotation?: number[], rotation_pivot?: number[]): Map<any, any>;
|
|
804
|
+
/**
|
|
805
|
+
* 设置方块的呼吸行为。
|
|
806
|
+
* @param {String} value - 呼吸行为,可选值为 "solid" 或 "air"。
|
|
807
|
+
* @returns {Map} - 新的组件集合。
|
|
808
|
+
*/
|
|
809
|
+
static setBreathability(value: string): Map<any, any>;
|
|
810
|
+
/**
|
|
811
|
+
* 启用或禁用方块的碰撞箱。
|
|
812
|
+
* @param {Boolean} enabled - 是否启用碰撞箱。
|
|
813
|
+
* @returns {Map} - 新的组件集合。
|
|
814
|
+
*/
|
|
815
|
+
static setCollisionBoxEnabled(enabled: boolean): Map<any, any>;
|
|
816
|
+
/**
|
|
817
|
+
* 设置自定义的碰撞箱。
|
|
818
|
+
* @param {Array} origin - 碰撞箱的起点坐标 [x, y, z]。
|
|
819
|
+
* @param {Array} size - 碰撞箱的大小 [width, height, depth]。
|
|
820
|
+
* @returns {Map} - 新的组件集合。
|
|
821
|
+
*/
|
|
822
|
+
static setCollisionBoxCustom(origin: any[], size: any[]): Map<any, any>;
|
|
823
|
+
/**
|
|
824
|
+
* 设置方块的合成台属性。
|
|
825
|
+
* @param {Array} craftingTags - 合成标签。
|
|
826
|
+
* @param {String} tableName - 合成台名称。
|
|
827
|
+
* @returns {Map} - 新的组件集合。
|
|
828
|
+
*/
|
|
829
|
+
static setCraftingTable(craftingTags: any[], tableName: string): Map<any, any>;
|
|
830
|
+
/**
|
|
831
|
+
* 启用或禁用方块的爆炸抗性。
|
|
832
|
+
* @param {Boolean} enabled - 是否启用爆炸抗性。
|
|
833
|
+
* @returns {Map} - 新的组件集合。
|
|
834
|
+
*/
|
|
835
|
+
static setDestructibleByExplosionEnabled(enabled: boolean): Map<any, any>;
|
|
836
|
+
/**
|
|
837
|
+
* 设置自定义的爆炸抗性。
|
|
838
|
+
* @param {Number} explosionResistance - 爆炸抗性值。
|
|
839
|
+
* @returns {Map} - 新的组件集合。
|
|
840
|
+
*/
|
|
841
|
+
static setDestructibleByExplosionCustom(explosionResistance: number): Map<any, any>;
|
|
842
|
+
/**
|
|
843
|
+
* 启用或禁用方块的挖掘抗性。
|
|
844
|
+
* @param {Boolean} enabled - 是否启用挖掘抗性。
|
|
845
|
+
* @returns {Map} - 新的组件集合。
|
|
846
|
+
*/
|
|
847
|
+
static setDestructibleByMiningEnabled(enabled: boolean): Map<any, any>;
|
|
848
|
+
/**
|
|
849
|
+
* 设置自定义的挖掘抗性。
|
|
850
|
+
* @param {Number} secondsToDestroy - 破坏所需时间(秒)。
|
|
851
|
+
* @param {Array} itemSpecificSpeeds - 特定工具的挖掘速度。
|
|
852
|
+
* @returns {Map} - 新的组件集合。
|
|
853
|
+
*/
|
|
854
|
+
static setDestructibleByMiningCustom(secondsToDestroy: number, itemSpecificSpeeds: any[]): Map<any, any>;
|
|
855
|
+
/**
|
|
856
|
+
* 设置方块的显示名称。
|
|
857
|
+
* @param {String} displayName - 显示名称。
|
|
858
|
+
* @returns {Map} - 新的组件集合。
|
|
859
|
+
*/
|
|
860
|
+
static setDisplayName(displayName: string): Map<any, any>;
|
|
861
|
+
/**
|
|
862
|
+
* 启用或禁用方块的易燃性。
|
|
863
|
+
* @param {Boolean} enabled - 是否启用易燃性。
|
|
864
|
+
* @returns {Map} - 新的组件集合。
|
|
865
|
+
*/
|
|
866
|
+
static setFlammableEnabled(enabled: boolean): Map<any, any>;
|
|
867
|
+
/**
|
|
868
|
+
* 设置自定义的易燃性。
|
|
869
|
+
* @param {Number} catchChanceModifier - 着火概率。
|
|
870
|
+
* @param {Number} destroyChanceModifier - 被火焰摧毁的概率。
|
|
871
|
+
* @returns {Map} - 新的组件集合。
|
|
872
|
+
*/
|
|
873
|
+
static setFlammableCustom(catchChanceModifier: number, destroyChanceModifier: number): Map<any, any>;
|
|
874
|
+
/**
|
|
875
|
+
* 设置方块的摩擦力。
|
|
876
|
+
* @param {Number} value - 摩擦力值,范围为 0.0 到 0.9。
|
|
877
|
+
* @returns {Map} - 新的组件集合。
|
|
878
|
+
*/
|
|
879
|
+
static setFriction(value: number): Map<any, any>;
|
|
880
|
+
/**
|
|
881
|
+
* 设置方块的几何模型。
|
|
882
|
+
* @param {String} identifier - 几何模型标识符。
|
|
883
|
+
* @param {Object} bone_visibility - 骨骼可见性配置。
|
|
884
|
+
* @returns {Map} - 新的组件集合。
|
|
885
|
+
*/
|
|
886
|
+
static setGeometry(identifier: string, bone_visibility: Object): Map<any, any>;
|
|
887
|
+
/**
|
|
888
|
+
* 设置方块的物品视觉属性。
|
|
889
|
+
* @param {String} geometry - 几何模型标识符。
|
|
890
|
+
* @param {Object} materialInstances - 材质实例配置。
|
|
891
|
+
* @returns {Map} - 新的组件集合。
|
|
892
|
+
*/
|
|
893
|
+
static setItemVisual(geometry: string, materialInstances: Object): Map<any, any>;
|
|
894
|
+
/**
|
|
895
|
+
* 设置方块的光衰减值。
|
|
896
|
+
* @param {Number} value - 光的衰减值,范围为 0 到 15。
|
|
897
|
+
* @returns {Map} - 新的组件集合。
|
|
898
|
+
*/
|
|
899
|
+
static setLightDampening(value: number): Map<any, any>;
|
|
900
|
+
/**
|
|
901
|
+
* 设置方块的光照强度。
|
|
902
|
+
* @param {Number} value - 光照强度,范围为 0 到 15。
|
|
903
|
+
* @returns {Map} - 新的组件集合。
|
|
904
|
+
*/
|
|
905
|
+
static setLightEmission(value: number): Map<any, any>;
|
|
906
|
+
/**
|
|
907
|
+
* 设置方块的液体检测属性。
|
|
908
|
+
* @param {Boolean} canContainLiquid - 是否可以包含液体。
|
|
909
|
+
* @param {String} liquidType - 液体类型。
|
|
910
|
+
* @param {String} onLiquidTouches - 对液体的反应方式。
|
|
911
|
+
* @param {Array} stopsLiquidFlowingFromDirection - 阻止液体流动的方向。
|
|
912
|
+
* @returns {Map} - 新的组件集合。
|
|
913
|
+
*/
|
|
914
|
+
static setLiquidDetection(canContainLiquid: boolean, liquidType: string, onLiquidTouches: string, stopsLiquidFlowingFromDirection: any[]): Map<any, any>;
|
|
915
|
+
/**
|
|
916
|
+
* 设置方块的战利品表路径。
|
|
917
|
+
* @param {String} path - 战利品表路径。
|
|
918
|
+
* @returns {Map} - 新的组件集合。
|
|
919
|
+
*/
|
|
920
|
+
static setLoot(path: string): Map<any, any>;
|
|
921
|
+
/**
|
|
922
|
+
* 设置方块的地图颜色。
|
|
923
|
+
* @param {String|Array} value - 地图颜色,可以是十六进制字符串或 RGB 数组。
|
|
924
|
+
* @returns {Map} - 新的组件集合。
|
|
925
|
+
*/
|
|
926
|
+
static setMapColor(value: string | any[]): Map<any, any>;
|
|
927
|
+
/**
|
|
928
|
+
* 设置方块的材质实例。
|
|
929
|
+
* @param {Object} instances - 材质实例配置。
|
|
930
|
+
* @returns {Map} - 新的组件集合。
|
|
931
|
+
*/
|
|
932
|
+
static setMaterialInstances(instances: Object): Map<any, any>;
|
|
933
|
+
/**
|
|
934
|
+
* 设置方块的放置过滤条件。
|
|
935
|
+
* @param {Array} conditions - 放置条件列表。
|
|
936
|
+
* @returns {Map} - 新的组件集合。
|
|
937
|
+
*/
|
|
938
|
+
static setPlacementFilter(conditions: any[]): Map<any, any>;
|
|
939
|
+
/**
|
|
940
|
+
* 设置方块的红石导电性。
|
|
941
|
+
* @param {Boolean} allowsWireToStepDown - 是否允许红石线向下阶梯连接。
|
|
942
|
+
* @param {Boolean} redstoneConductor - 方块是否可以被红石信号激活。
|
|
943
|
+
* @returns {Map} - 新的组件集合。
|
|
944
|
+
*/
|
|
945
|
+
static setRedstoneConductivity(allowsWireToStepDown: boolean, redstoneConductor: boolean): Map<any, any>;
|
|
946
|
+
/**
|
|
947
|
+
* 启用或禁用方块的选择框。
|
|
948
|
+
* @param {Boolean} enabled - 是否启用选择框。
|
|
949
|
+
* @returns {Map} - 新的组件集合。
|
|
950
|
+
*/
|
|
951
|
+
static setSelectionBoxEnabled(enabled: boolean): Map<any, any>;
|
|
952
|
+
/**
|
|
953
|
+
* 设置自定义的选择框。
|
|
954
|
+
* @param {Array} origin - 选择框的起点坐标 [x, y, z]。
|
|
955
|
+
* @param {Array} size - 选择框的大小 [width, height, depth]。
|
|
956
|
+
* @returns {Map} - 新的组件集合。
|
|
957
|
+
*/
|
|
958
|
+
static setSelectionBoxCustom(origin: any[], size: any[]): Map<any, any>;
|
|
959
|
+
/**
|
|
960
|
+
* 将多个组件集合合并为一个。
|
|
961
|
+
* @param {...Map} componentMaps - 多个组件集合。
|
|
962
|
+
* @returns {Map} - 合并后的组件集合。
|
|
963
|
+
*/
|
|
964
|
+
static combineComponents(...componentMaps: Map<any, any>[]): Map<any, any>;
|
|
965
|
+
/**
|
|
966
|
+
* 获取当前组件的 JSON 表示。
|
|
967
|
+
* @param {Map} components - 组件集合。
|
|
968
|
+
* @returns {Object} - 组件的 JSON 对象。
|
|
969
|
+
*/
|
|
970
|
+
static toJSON(components: Map<any, any>): Object;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
declare class ItemComponent {
|
|
974
|
+
/**
|
|
975
|
+
* 物品的耐久度组件
|
|
976
|
+
* @param {number} max_durability 最大耐久
|
|
977
|
+
* @param {number} damage_chance_min 损坏最小几率
|
|
978
|
+
* @param {number} damage_chance_max 损坏最大几率
|
|
979
|
+
* @returns {ItemComponent}
|
|
980
|
+
*/
|
|
981
|
+
static setDurability(max_durability: number, damage_chance_min?: number, damage_chance_max?: number): ItemComponent;
|
|
982
|
+
static setBlockPlacer(block: any, replace_block_item: any, use_on: any): Map<any, any>;
|
|
983
|
+
/**
|
|
984
|
+
*
|
|
985
|
+
* @param {Array} custom_components
|
|
986
|
+
* @returns
|
|
987
|
+
*/
|
|
988
|
+
static setCustomComponents(custom_components: any[]): Map<any, any>;
|
|
989
|
+
/**
|
|
990
|
+
* 设置物品的可投掷组件。
|
|
991
|
+
* @param {Boolean} doSwingAnimation - 是否使用挥动动画。
|
|
992
|
+
* @param {Number} launchPowerScale - 投掷力量的缩放比例。
|
|
993
|
+
* @param {Number} maxDrawDuration - 最大蓄力时间。
|
|
994
|
+
* @param {Number} maxLaunchPower - 最大投掷力量。
|
|
995
|
+
* @param {Number} minDrawDuration - 最小蓄力时间。
|
|
996
|
+
* @param {Boolean} scalePowerByDrawDuration - 投掷力量是否随蓄力时间增加。
|
|
997
|
+
* @returns {Map} - 新的组件集合。
|
|
998
|
+
*/
|
|
999
|
+
static setThrowable(doSwingAnimation?: boolean, launchPowerScale?: number, maxDrawDuration?: number, maxLaunchPower?: number, minDrawDuration?: number, scalePowerByDrawDuration?: boolean): Map<any, any>;
|
|
1000
|
+
/**
|
|
1001
|
+
* 设置物品的显示名称。
|
|
1002
|
+
* @param {String} displayName - 显示名称或本地化键。
|
|
1003
|
+
* @returns {Map} - 新的组件集合。
|
|
1004
|
+
*/
|
|
1005
|
+
static setDisplayName(displayName: string): Map<any, any>;
|
|
1006
|
+
/**
|
|
1007
|
+
* 设置物品的食物组件。
|
|
1008
|
+
* @param {Boolean} canAlwaysEat - 是否随时可以食用。
|
|
1009
|
+
* @param {Number} nutrition - 营养值。
|
|
1010
|
+
* @param {Number} saturationModifier - 饱和度修正值。
|
|
1011
|
+
* @param {String} [usingConvertsTo] - 食用后转换的目标物品。
|
|
1012
|
+
* @returns {Map} - 新的组件集合。
|
|
1013
|
+
*/
|
|
1014
|
+
static setFoodComponent(canAlwaysEat: boolean, nutrition: number, saturationModifier: number, usingConvertsTo?: string): Map<any, any>;
|
|
1015
|
+
/**
|
|
1016
|
+
* 设置物品的燃料组件。
|
|
1017
|
+
* @param {Number} duration - 燃料燃烧的持续时间(秒),最小值为 0.05。
|
|
1018
|
+
* @returns {Map} - 新的组件集合。
|
|
1019
|
+
*/
|
|
1020
|
+
static setFuel(duration: number): Map<any, any>;
|
|
1021
|
+
/**
|
|
1022
|
+
* 设置物品的附魔光效组件。
|
|
1023
|
+
* @param {Boolean} hasGlint - 是否显示附魔光效。
|
|
1024
|
+
* @returns {Map} - 新的组件集合。
|
|
1025
|
+
*/
|
|
1026
|
+
static setGlint(hasGlint: boolean): Map<any, any>;
|
|
1027
|
+
/**
|
|
1028
|
+
* 设置物品的手持渲染方式组件。
|
|
1029
|
+
* @param {Boolean} isHandEquipped - 是否像工具一样渲染。
|
|
1030
|
+
* @returns {Map} - 新的组件集合。
|
|
1031
|
+
*/
|
|
1032
|
+
static setHandEquipped(isHandEquipped: boolean): Map<any, any>;
|
|
1033
|
+
/**
|
|
1034
|
+
* 设置物品的图标组件。
|
|
1035
|
+
* @param {String} texture - 图标纹理名称。
|
|
1036
|
+
* @returns {Map} - 新的组件集合。
|
|
1037
|
+
*/
|
|
1038
|
+
static setIcon(texture: string): Map<any, any>;
|
|
1039
|
+
/**
|
|
1040
|
+
* 设置物品的最大堆叠数量组件。
|
|
1041
|
+
* @param {Number} maxStackSize - 最大堆叠数量,默认值为 64。
|
|
1042
|
+
* @returns {Map} - 新的组件集合。
|
|
1043
|
+
*/
|
|
1044
|
+
static setMaxStackSize(maxStackSize?: number): Map<any, any>;
|
|
1045
|
+
/**
|
|
1046
|
+
* 设置物品的投射物组件。
|
|
1047
|
+
* @param {Number} [minimumCriticalPower] - 投射物需要蓄力多久才能造成暴击。
|
|
1048
|
+
* @param {String} [projectileEntity] - 作为投射物发射的实体名称。
|
|
1049
|
+
* @returns {Map} - 新的组件集合。
|
|
1050
|
+
*/
|
|
1051
|
+
static setProjectile(minimumCriticalPower?: number, projectileEntity?: string): Map<any, any>;
|
|
1052
|
+
/**
|
|
1053
|
+
* 设置物品的使用修饰组件。
|
|
1054
|
+
* @param {Number} [movementModifier] - 使用物品时玩家移动速度的缩放值。
|
|
1055
|
+
* @param {Number} [useDuration] - 物品使用所需的时间(秒)。
|
|
1056
|
+
* @returns {Map} - 新的组件集合。
|
|
1057
|
+
*/
|
|
1058
|
+
static setUseModifiers(movementModifier?: number, useDuration?: number): Map<any, any>;
|
|
1059
|
+
/**
|
|
1060
|
+
* 设置物品的可穿戴组件。
|
|
1061
|
+
* @param {Number} [protection=0] - 物品提供的保护值。
|
|
1062
|
+
* @param {String} [slot] - 物品可以穿戴的槽位(如 "head"、"chest" 等)。
|
|
1063
|
+
* @returns {Map} - 新的组件集合。
|
|
1064
|
+
*/
|
|
1065
|
+
static setWearable(protection?: number, slot?: string): Map<any, any>;
|
|
1066
|
+
/**
|
|
1067
|
+
* 设置物品的使用动画组件。
|
|
1068
|
+
* @param {String} animation - 物品使用时的动画类型(如 "eat"、"drink" 等)。
|
|
1069
|
+
* @returns {Map} - 新的组件集合。
|
|
1070
|
+
* @throws {Error} - 如果 animation 不是字符串类型。
|
|
1071
|
+
*/
|
|
1072
|
+
static setUseAnimation(animation: string): Map<any, any>;
|
|
1073
|
+
/**
|
|
1074
|
+
* 将多个组件集合合并为一个。
|
|
1075
|
+
* @param {...Map} componentMaps - 多个组件集合。
|
|
1076
|
+
* @returns {Map} - 合并后的组件集合。
|
|
1077
|
+
*/
|
|
1078
|
+
static combineComponents(...componentMaps: Map<any, any>[]): Map<any, any>;
|
|
1079
|
+
/**
|
|
1080
|
+
* 获取当前组件的 JSON 表示。
|
|
1081
|
+
* @param {Map} components - 组件集合。
|
|
1082
|
+
* @returns {Object} - 组件的 JSON 对象。
|
|
1083
|
+
*/
|
|
1084
|
+
static toJSON(components: Map<any, any>): Object;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
/**
|
|
1088
|
+
* Control Class
|
|
1089
|
+
*
|
|
1090
|
+
* This class represents a UI control element with various properties and methods to manipulate its state.
|
|
1091
|
+
*
|
|
1092
|
+
* Properties:
|
|
1093
|
+
* - visible: boolean - If the UI element should be visible (default: true)
|
|
1094
|
+
* - enabled: boolean - If true and if the UI element or any of its children have the locked state then they will be in the locked (default: true)
|
|
1095
|
+
* - layer: int - Z-Index/Layer (like zindex in CSS) relative to parent element. Higher layers will render above (default: 0)
|
|
1096
|
+
* - alpha: float - Alpha/transparency of the element. It will only affect the UI element. Its children will be unaffected. (default: 1.0)
|
|
1097
|
+
* - propagate_alpha: boolean - If alpha should not only apply to the parent if possible but also all its children (default: false)
|
|
1098
|
+
* - clips_children: boolean - Cuts off visually and interactively everything beyond the boundaries of the UI element (default: false)
|
|
1099
|
+
* - allow_clipping: boolean - If clips_children works in the UI element. Otherwise, it won't have any effect (default: true)
|
|
1100
|
+
* - clip_offset: Vector [x, y] - Offset from the start of the clipping (default: [0, 0])
|
|
1101
|
+
* - clip_state_change_event: string - Event triggered when the clip state changes
|
|
1102
|
+
* - enable_scissor_test: boolean - Enables scissor test for clipping (default: false)
|
|
1103
|
+
* - property_bag: object - Property bag contains properties/variables that are more related with the data than the actual structure and look of the UI element
|
|
1104
|
+
* - selected: boolean - If the text box is selected by default
|
|
1105
|
+
* - use_child_anchors: boolean - Use the anchor_from and anchor_to of the child of the UI element (default: false)
|
|
1106
|
+
* - controls: array - For adding children to the element
|
|
1107
|
+
* - anims: string[] - Array of the animation names
|
|
1108
|
+
* - disable_anim_fast_forward: boolean - Disables fast-forwarding animations
|
|
1109
|
+
* - animation_reset_name: string - Name of the animation to reset to
|
|
1110
|
+
* - ignored: boolean - If the UI element should be ignored (default: false)
|
|
1111
|
+
* - variables: array or object - A bunch of conditions that change the variables values
|
|
1112
|
+
* - modifications: array - Allows to modify the UI files of resource packs below (vanilla being the most bottom one)
|
|
1113
|
+
* - 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
|
|
1114
|
+
* - collection_index: int - Index that the control takes in the collection
|
|
1115
|
+
*/
|
|
1116
|
+
/**
|
|
1117
|
+
* Control 类
|
|
1118
|
+
*
|
|
1119
|
+
* 该类表示一个具有各种属性和方法的 UI 控件元素,用于操作其状态。
|
|
1120
|
+
*
|
|
1121
|
+
* 属性:
|
|
1122
|
+
* - visible: boolean - 控制 UI 元素是否可见(默认值:true)
|
|
1123
|
+
* - enabled: boolean - 如果为 true,且 UI 元素或其任何子元素处于锁定状态,则它们将被锁定(默认值:true)
|
|
1124
|
+
* - layer: int - 相对于父元素的 Z-Index/层级(类似于 CSS 中的 zindex)。较高的层级将渲染在上方(默认值:0)
|
|
1125
|
+
* - alpha: float - 元素的透明度。仅影响 UI 元素本身,其子元素不受影响。如果希望透明度同时应用于父元素和子元素,请使用 propagate_alpha(默认值:1.0)
|
|
1126
|
+
* - propagate_alpha: boolean - 透明度是否应同时应用于父元素及其所有子元素(默认值:false)
|
|
1127
|
+
* - clips_children: boolean - 是否在视觉上和交互上裁剪超出 UI 元素边界的内容(默认值:false)
|
|
1128
|
+
* - allow_clipping: boolean - 是否允许在 UI 元素中启用裁剪。否则,clips_children 将无效(默认值:true)
|
|
1129
|
+
* - clip_offset: Vector [x, y] - 裁剪起始点的偏移量(默认值:[0, 0])
|
|
1130
|
+
* - clip_state_change_event: string - 裁剪状态更改时触发的事件
|
|
1131
|
+
* - enable_scissor_test: boolean - 是否启用裁剪测试(默认值:false)
|
|
1132
|
+
* - property_bag: object - 属性包,包含与数据相关的属性/变量,而不是 UI 元素的实际结构和外观
|
|
1133
|
+
* - selected: boolean - 文本框是否默认被选中
|
|
1134
|
+
* - use_child_anchors: boolean - 是否使用 UI 元素子元素的 anchor_from 和 anchor_to(默认值:false)
|
|
1135
|
+
* - controls: array - 用于向元素添加子元素
|
|
1136
|
+
* - anims: string[] - 动画名称数组
|
|
1137
|
+
* - disable_anim_fast_forward: boolean - 是否禁用动画快进
|
|
1138
|
+
* - animation_reset_name: string - 重置动画的名称
|
|
1139
|
+
* - ignored: boolean - 是否忽略该 UI 元素(默认值:false)
|
|
1140
|
+
* - variables: array 或 object - 一组条件,用于更改变量的值
|
|
1141
|
+
* - modifications: array - 允许修改资源包中的 UI 文件(最底层为原版资源包)
|
|
1142
|
+
* - grid_position: Vector [row, column] - 控件在网格中的位置。此属性还允许修改硬编码网格中的特定网格项
|
|
1143
|
+
* - collection_index: int - 控件在集合中的索引
|
|
1144
|
+
*/
|
|
1145
|
+
declare class Control {
|
|
1146
|
+
/**
|
|
1147
|
+
* 设置控件的可见性。
|
|
1148
|
+
* @param {boolean} visible - 控件是否可见(默认值:true)
|
|
1149
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1150
|
+
*/
|
|
1151
|
+
setVisible(visible?: boolean): Control;
|
|
1152
|
+
visible: boolean | undefined;
|
|
1153
|
+
/**
|
|
1154
|
+
* 设置控件的启用状态。
|
|
1155
|
+
* @param {boolean} enabled - 控件是否启用(默认值:true)
|
|
1156
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1157
|
+
*/
|
|
1158
|
+
setEnabled(enabled?: boolean): Control;
|
|
1159
|
+
enabled: boolean | undefined;
|
|
1160
|
+
/**
|
|
1161
|
+
* 设置控件的层级(z-index)。
|
|
1162
|
+
* @param {number} layer - 要设置的层级(默认值:0)
|
|
1163
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1164
|
+
*/
|
|
1165
|
+
setLayer(layer?: number): Control;
|
|
1166
|
+
layer: number | undefined;
|
|
1167
|
+
/**
|
|
1168
|
+
* 设置控件的透明度。
|
|
1169
|
+
* @param {number} alpha - 要设置的透明度值(默认值:1.0)
|
|
1170
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1171
|
+
*/
|
|
1172
|
+
setAlpha(alpha?: number): Control;
|
|
1173
|
+
alpha: number | undefined;
|
|
1174
|
+
/**
|
|
1175
|
+
* 设置透明度是否应传播到子元素。
|
|
1176
|
+
* @param {boolean} propagate - 透明度是否应传播(默认值:false)
|
|
1177
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1178
|
+
*/
|
|
1179
|
+
setPropagateAlpha(propagate?: boolean): Control;
|
|
1180
|
+
propagate_alpha: boolean | undefined;
|
|
1181
|
+
/**
|
|
1182
|
+
* 设置控件是否应裁剪其子元素。
|
|
1183
|
+
* @param {boolean} clips - 控件是否应裁剪其子元素(默认值:false)
|
|
1184
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1185
|
+
*/
|
|
1186
|
+
setClipsChildren(clips?: boolean): Control;
|
|
1187
|
+
clips_children: boolean | undefined;
|
|
1188
|
+
/**
|
|
1189
|
+
* 设置控件是否允许裁剪。
|
|
1190
|
+
* @param {boolean} allow - 是否允许裁剪(默认值:true)
|
|
1191
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1192
|
+
*/
|
|
1193
|
+
setAllowClipping(allow?: boolean): Control;
|
|
1194
|
+
allow_clipping: boolean | undefined;
|
|
1195
|
+
/**
|
|
1196
|
+
* 设置控件的裁剪偏移量。
|
|
1197
|
+
* @param {number[]} offset - 裁剪偏移量,格式为 [x, y](默认值:[0, 0])
|
|
1198
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1199
|
+
*/
|
|
1200
|
+
setClipOffset(offset?: number[]): Control;
|
|
1201
|
+
clip_offset: number[] | undefined;
|
|
1202
|
+
/**
|
|
1203
|
+
* 设置裁剪状态更改事件。
|
|
1204
|
+
* @param {string} event - 裁剪状态更改时触发的事件名称
|
|
1205
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1206
|
+
*/
|
|
1207
|
+
setClipStateChangeEvent(event: string): Control;
|
|
1208
|
+
clip_state_change_event: string | undefined;
|
|
1209
|
+
/**
|
|
1210
|
+
* 设置是否启用裁剪测试。
|
|
1211
|
+
* @param {boolean} enable - 是否启用裁剪测试(默认值:false)
|
|
1212
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1213
|
+
*/
|
|
1214
|
+
setEnableScissorTest(enable?: boolean): Control;
|
|
1215
|
+
enable_scissor_test: boolean | undefined;
|
|
1216
|
+
/**
|
|
1217
|
+
* 设置控件的属性包。
|
|
1218
|
+
* @param {object} bag - 要设置的属性包
|
|
1219
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1220
|
+
*/
|
|
1221
|
+
setPropertyBag(bag: object): Control;
|
|
1222
|
+
property_bag: object | undefined;
|
|
1223
|
+
/**
|
|
1224
|
+
* 设置控件是否被选中。
|
|
1225
|
+
* @param {boolean} selected - 控件是否被选中(默认值:false)
|
|
1226
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1227
|
+
*/
|
|
1228
|
+
setSelected(selected?: boolean): Control;
|
|
1229
|
+
selected: boolean | undefined;
|
|
1230
|
+
/**
|
|
1231
|
+
* 设置控件是否使用子元素的锚点。
|
|
1232
|
+
* @param {boolean} use - 是否使用子元素的锚点(默认值:false)
|
|
1233
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1234
|
+
*/
|
|
1235
|
+
setUseChildAnchors(use?: boolean): Control;
|
|
1236
|
+
use_child_anchors: boolean | undefined;
|
|
1237
|
+
/**
|
|
1238
|
+
* 向控件添加子控件。
|
|
1239
|
+
* @param {Control} control - 要添加的子控件
|
|
1240
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1241
|
+
*/
|
|
1242
|
+
addControl(control: Control): Control;
|
|
1243
|
+
controls: any[] | undefined;
|
|
1244
|
+
/**
|
|
1245
|
+
* 设置控件的动画。
|
|
1246
|
+
* @param {string[]} anims - 动画名称数组
|
|
1247
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1248
|
+
*/
|
|
1249
|
+
setAnimations(anims: string[]): Control;
|
|
1250
|
+
anims: string[] | undefined;
|
|
1251
|
+
/**
|
|
1252
|
+
* 设置是否禁用动画快进。
|
|
1253
|
+
* @param {boolean} disable - 是否禁用动画快进(默认值:false)
|
|
1254
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1255
|
+
*/
|
|
1256
|
+
setDisableAnimFastForward(disable?: boolean): Control;
|
|
1257
|
+
disable_anim_fast_forward: boolean | undefined;
|
|
1258
|
+
/**
|
|
1259
|
+
* 设置动画重置名称。
|
|
1260
|
+
* @param {string} name - 要重置的动画名称
|
|
1261
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1262
|
+
*/
|
|
1263
|
+
setAnimationResetName(name: string): Control;
|
|
1264
|
+
animation_reset_name: string | undefined;
|
|
1265
|
+
/**
|
|
1266
|
+
* 设置是否忽略该控件。
|
|
1267
|
+
* @param {boolean} ignored - 是否忽略该控件(默认值:false)
|
|
1268
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1269
|
+
*/
|
|
1270
|
+
setIgnored(ignored?: boolean): Control;
|
|
1271
|
+
ignored: boolean | undefined;
|
|
1272
|
+
/**
|
|
1273
|
+
* 设置控件的变量。
|
|
1274
|
+
* @param {object} variables - 要设置的变量
|
|
1275
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1276
|
+
*/
|
|
1277
|
+
setVariables(variables: object): Control;
|
|
1278
|
+
variables: object | undefined;
|
|
1279
|
+
/**
|
|
1280
|
+
* 设置控件的修改项。
|
|
1281
|
+
* @param {array} modifications - 要设置的修改项
|
|
1282
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1283
|
+
*/
|
|
1284
|
+
setModifications(modifications: array): Control;
|
|
1285
|
+
modifications: any;
|
|
1286
|
+
/**
|
|
1287
|
+
* 设置控件在网格中的位置。
|
|
1288
|
+
* @param {number[]} position - 网格位置,格式为 [行, 列]
|
|
1289
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1290
|
+
*/
|
|
1291
|
+
setGridPosition(position: number[]): Control;
|
|
1292
|
+
grid_position: number[] | undefined;
|
|
1293
|
+
/**
|
|
1294
|
+
* 设置控件在集合中的索引。
|
|
1295
|
+
* @param {number} index - 要设置的索引
|
|
1296
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
1297
|
+
*/
|
|
1298
|
+
setCollectionIndex(index: number): Control;
|
|
1299
|
+
collection_index: number | undefined;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
declare class UIElement {
|
|
1303
|
+
constructor(name: any, type: any, template: any);
|
|
1304
|
+
type: any;
|
|
1305
|
+
id: any;
|
|
1306
|
+
name: any;
|
|
1307
|
+
control: Control;
|
|
1308
|
+
properties: Map<any, any>;
|
|
1309
|
+
variables: Map<any, any>;
|
|
1310
|
+
modifications: any[];
|
|
1311
|
+
enableDebug(): this;
|
|
1312
|
+
setControl(control: any): this;
|
|
1313
|
+
addControl(control: any): this;
|
|
1314
|
+
addControls(controls: any): this;
|
|
1315
|
+
addVariable(name: any, value: any): this;
|
|
1316
|
+
addProp(name: any, value: any): this;
|
|
1317
|
+
addModification(modification: any): this;
|
|
1318
|
+
serialize(): {
|
|
1319
|
+
[x: number]: any;
|
|
1320
|
+
};
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* Sprite 类
|
|
1325
|
+
*
|
|
1326
|
+
* 该类表示一个 Sprite 控件,用于管理图像纹理及其相关属性。
|
|
1327
|
+
*
|
|
1328
|
+
* 属性:
|
|
1329
|
+
* - texture: string - 图像路径(从包根目录开始,例如:"textures/ui/White")
|
|
1330
|
+
* - allow_debug_missing_texture: boolean - 是否在纹理未找到时显示缺失纹理(默认值:true)
|
|
1331
|
+
* - uv: Vector [u, v] - 纹理映射的起始位置
|
|
1332
|
+
* - uv_size: Vector [width, height] - 纹理映射的大小
|
|
1333
|
+
* - texture_file_system: string - 纹理来源(默认值:InUserPackage)
|
|
1334
|
+
* - nineslice_size: int or Vector [x0, y0, x1, y1] - 9-slice 分割大小
|
|
1335
|
+
* - tiled: boolean or enum - 是否平铺纹理(可能值:true/false, x, y)
|
|
1336
|
+
* - tiled_scale: Vector [sX, sY] - 平铺纹理的缩放比例(默认值:false)
|
|
1337
|
+
* - clip_direction: enum - 裁剪方向的起始点(可能值:left, right, up, down, center)
|
|
1338
|
+
* - clip_ratio: float - 裁剪比例(范围:0.0 到 1.0)
|
|
1339
|
+
* - clip_pixelperfect: boolean - 是否尽可能保持像素精确裁剪
|
|
1340
|
+
* - keep_ratio: boolean - 是否在调整大小时保持比例(默认值:true)
|
|
1341
|
+
* - bilinear: boolean - 是否在调整大小时使用双线性函数(默认值:false)
|
|
1342
|
+
* - fill: boolean - 是否拉伸图像以适应大小(默认值:false)
|
|
1343
|
+
* - $fit_to_width: boolean - 是否适应宽度
|
|
1344
|
+
* - zip_folder: string - 压缩文件夹路径
|
|
1345
|
+
* - grayscale: boolean - 是否以黑白渲染图像(默认值:false)
|
|
1346
|
+
* - force_texture_reload: boolean - 是否在纹理路径更改时强制重新加载图像
|
|
1347
|
+
* - base_size: Vector [width, height] - 基础大小
|
|
1348
|
+
*/
|
|
1349
|
+
declare class Sprite {
|
|
1350
|
+
/**
|
|
1351
|
+
* 设置图像纹理路径。
|
|
1352
|
+
* @param {string} texture - 图像路径(例如:"textures/ui/White")
|
|
1353
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1354
|
+
*/
|
|
1355
|
+
setTexture(texture: string): Sprite;
|
|
1356
|
+
texture: string | undefined;
|
|
1357
|
+
/**
|
|
1358
|
+
* 设置是否在纹理未找到时显示缺失纹理。
|
|
1359
|
+
* @param {boolean} allow - 是否显示缺失纹理(默认值:true)
|
|
1360
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1361
|
+
*/
|
|
1362
|
+
setAllowDebugMissingTexture(allow?: boolean): Sprite;
|
|
1363
|
+
allow_debug_missing_texture: boolean | undefined;
|
|
1364
|
+
/**
|
|
1365
|
+
* 设置纹理映射的起始位置。
|
|
1366
|
+
* @param {number[]} uv - 起始位置,格式为 [u, v]
|
|
1367
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1368
|
+
*/
|
|
1369
|
+
setUV(uv: number[]): Sprite;
|
|
1370
|
+
uv: number[] | undefined;
|
|
1371
|
+
/**
|
|
1372
|
+
* 设置纹理映射的大小。
|
|
1373
|
+
* @param {number[]} uvSize - 大小,格式为 [width, height]
|
|
1374
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1375
|
+
*/
|
|
1376
|
+
setUVSize(uvSize: number[]): Sprite;
|
|
1377
|
+
uv_size: number[] | undefined;
|
|
1378
|
+
/**
|
|
1379
|
+
* 设置纹理来源。
|
|
1380
|
+
* @param {string} source - 纹理来源(可能值:InUserPackage, InAppPackage, RawPath, RawPersistent, InSettingsDir, InExternalDir, InServerPackage, InDataDir, InUserDir, InWorldDir, StoreCache, Usage is Unknown)
|
|
1381
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1382
|
+
*/
|
|
1383
|
+
setTextureFileSystem(source?: string): Sprite;
|
|
1384
|
+
texture_file_system: string | undefined;
|
|
1385
|
+
/**
|
|
1386
|
+
* 设置 9-slice 分割大小。
|
|
1387
|
+
* @param {number|number[]} size - 9-slice 分割大小(可以是单个数字或 [x0, y0, x1, y1] 数组)
|
|
1388
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1389
|
+
*/
|
|
1390
|
+
setNineSliceSize(size: number | number[]): Sprite;
|
|
1391
|
+
nineslice_size: number | number[] | undefined;
|
|
1392
|
+
/**
|
|
1393
|
+
* 设置是否平铺纹理。
|
|
1394
|
+
* @param {boolean|string} tiled - 是否平铺纹理(可能值:true/false, x, y)
|
|
1395
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1396
|
+
*/
|
|
1397
|
+
setTiled(tiled: boolean | string): Sprite;
|
|
1398
|
+
tiled: string | boolean | undefined;
|
|
1399
|
+
/**
|
|
1400
|
+
* 设置平铺纹理的缩放比例。
|
|
1401
|
+
* @param {number[]} scale - 缩放比例,格式为 [sX, sY](默认值:[1, 1])
|
|
1402
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1403
|
+
*/
|
|
1404
|
+
setTiledScale(scale?: number[]): Sprite;
|
|
1405
|
+
tiled_scale: number[] | undefined;
|
|
1406
|
+
/**
|
|
1407
|
+
* 设置裁剪方向的起始点。
|
|
1408
|
+
* @param {string} direction - 裁剪方向(可能值:left, right, up, down, center)
|
|
1409
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1410
|
+
*/
|
|
1411
|
+
setClipDirection(direction: string): Sprite;
|
|
1412
|
+
clip_direction: string | undefined;
|
|
1413
|
+
/**
|
|
1414
|
+
* 设置裁剪比例。
|
|
1415
|
+
* @param {number} ratio - 裁剪比例(范围:0.0 到 1.0)
|
|
1416
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1417
|
+
*/
|
|
1418
|
+
setClipRatio(ratio: number): Sprite;
|
|
1419
|
+
clip_ratio: number | undefined;
|
|
1420
|
+
/**
|
|
1421
|
+
* 设置是否尽可能保持像素精确裁剪。
|
|
1422
|
+
* @param {boolean} pixelPerfect - 是否保持像素精确裁剪
|
|
1423
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1424
|
+
*/
|
|
1425
|
+
setClipPixelPerfect(pixelPerfect?: boolean): Sprite;
|
|
1426
|
+
clip_pixelperfect: boolean | undefined;
|
|
1427
|
+
/**
|
|
1428
|
+
* 设置是否在调整大小时保持比例。
|
|
1429
|
+
* @param {boolean} keep - 是否保持比例(默认值:true)
|
|
1430
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1431
|
+
*/
|
|
1432
|
+
setKeepRatio(keep?: boolean): Sprite;
|
|
1433
|
+
keep_ratio: boolean | undefined;
|
|
1434
|
+
/**
|
|
1435
|
+
* 设置是否在调整大小时使用双线性函数。
|
|
1436
|
+
* @param {boolean} bilinear - 是否使用双线性函数(默认值:false)
|
|
1437
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1438
|
+
*/
|
|
1439
|
+
setBilinear(bilinear?: boolean): Sprite;
|
|
1440
|
+
bilinear: boolean | undefined;
|
|
1441
|
+
/**
|
|
1442
|
+
* 设置是否拉伸图像以适应大小。
|
|
1443
|
+
* @param {boolean} fill - 是否拉伸图像(默认值:false)
|
|
1444
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1445
|
+
*/
|
|
1446
|
+
setFill(fill?: boolean): Sprite;
|
|
1447
|
+
fill: boolean | undefined;
|
|
1448
|
+
/**
|
|
1449
|
+
* 设置是否适应宽度。
|
|
1450
|
+
* @param {boolean} fit - 是否适应宽度
|
|
1451
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1452
|
+
*/
|
|
1453
|
+
setFitToWidth(fit?: boolean): Sprite;
|
|
1454
|
+
$fit_to_width: boolean | undefined;
|
|
1455
|
+
/**
|
|
1456
|
+
* 设置压缩文件夹路径。
|
|
1457
|
+
* @param {string} folder - 压缩文件夹路径
|
|
1458
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1459
|
+
*/
|
|
1460
|
+
setZipFolder(folder: string): Sprite;
|
|
1461
|
+
zip_folder: string | undefined;
|
|
1462
|
+
/**
|
|
1463
|
+
* 设置是否以黑白渲染图像。
|
|
1464
|
+
* @param {boolean} grayscale - 是否以黑白渲染图像(默认值:false)
|
|
1465
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1466
|
+
*/
|
|
1467
|
+
setGrayscale(grayscale?: boolean): Sprite;
|
|
1468
|
+
grayscale: boolean | undefined;
|
|
1469
|
+
/**
|
|
1470
|
+
* 设置是否在纹理路径更改时强制重新加载图像。
|
|
1471
|
+
* @param {boolean} force - 是否强制重新加载图像
|
|
1472
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1473
|
+
*/
|
|
1474
|
+
setForceTextureReload(force?: boolean): Sprite;
|
|
1475
|
+
force_texture_reload: boolean | undefined;
|
|
1476
|
+
/**
|
|
1477
|
+
* 设置基础大小。
|
|
1478
|
+
* @param {number[]} size - 基础大小,格式为 [width, height]
|
|
1479
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
1480
|
+
*/
|
|
1481
|
+
setBaseSize(size: number[]): Sprite;
|
|
1482
|
+
base_size: number[] | undefined;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* Layout 类
|
|
1487
|
+
*
|
|
1488
|
+
* 该类表示一个具有各种属性和方法的 UI 布局元素,用于操作其布局和大小。
|
|
1489
|
+
*
|
|
1490
|
+
* 属性:
|
|
1491
|
+
* - size: Vector [width, height] - UI 元素的大小(默认值:["default", "default"])
|
|
1492
|
+
* - max_size: Vector [width, height] - UI 元素的最大大小(默认值:["default", "default"])
|
|
1493
|
+
* - min_size: Vector [width, height] - UI 元素的最小大小(默认值:["default", "default"])
|
|
1494
|
+
* - offset: Vector [x, y] - UI 元素相对于父元素的位置(默认值:[0, 0])
|
|
1495
|
+
* - anchor_from: enum - 父元素中的锚点(默认值:center)
|
|
1496
|
+
* - anchor_to: enum - 元素自身的锚点(默认值:center)
|
|
1497
|
+
* - inherit_max_sibling_width: boolean - 是否使用兄弟元素的最大宽度(默认值:false)
|
|
1498
|
+
* - inherit_max_sibling_height: boolean - 是否使用兄弟元素的最大高度(默认值:false)
|
|
1499
|
+
* - use_anchored_offset: boolean - 是否使用基于锚点的偏移(默认值:false)
|
|
1500
|
+
* - contained: boolean - 是否限制元素在父元素边界内(默认值:false)
|
|
1501
|
+
* - draggable: enum - 是否使元素可拖动(可能值:vertical, horizontal, both)
|
|
1502
|
+
* - follows_cursor: boolean - 是否使元素跟随光标(默认值:false)
|
|
1503
|
+
*/
|
|
1504
|
+
declare class Layout {
|
|
1505
|
+
/**
|
|
1506
|
+
* 设置 UI 元素的大小。
|
|
1507
|
+
* @param {any[]} size - 大小,格式为 [width, height](默认值:["default", "default"])
|
|
1508
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
1509
|
+
*/
|
|
1510
|
+
setSize(size?: any[]): Layout;
|
|
1511
|
+
size: any[] | undefined;
|
|
1512
|
+
/**
|
|
1513
|
+
* 设置 UI 元素的最大大小。
|
|
1514
|
+
* @param {string[]} maxSize - 最大大小,格式为 [width, height](默认值:["default", "default"])
|
|
1515
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
1516
|
+
*/
|
|
1517
|
+
setMaxSize(maxSize?: string[]): Layout;
|
|
1518
|
+
max_size: string[] | undefined;
|
|
1519
|
+
/**
|
|
1520
|
+
* 设置 UI 元素的最小大小。
|
|
1521
|
+
* @param {string[]} minSize - 最小大小,格式为 [width, height](默认值:["default", "default"])
|
|
1522
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
1523
|
+
*/
|
|
1524
|
+
setMinSize(minSize?: string[]): Layout;
|
|
1525
|
+
min_size: string[] | undefined;
|
|
1526
|
+
/**
|
|
1527
|
+
* 设置 UI 元素相对于父元素的位置。
|
|
1528
|
+
* @param {number[]} offset - 偏移量,格式为 [x, y](默认值:[0, 0])
|
|
1529
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
1530
|
+
*/
|
|
1531
|
+
setOffset(offset?: number[]): Layout;
|
|
1532
|
+
offset: number[] | undefined;
|
|
1533
|
+
/**
|
|
1534
|
+
* 设置父元素中的锚点。
|
|
1535
|
+
* @param {string} anchorFrom - 锚点(可能值:top_left, top_middle, top_right, left_middle, center, right_middle, bottom_left, bottom_middle, bottom_right)(默认值:center)
|
|
1536
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
1537
|
+
*/
|
|
1538
|
+
setAnchorFrom(anchorFrom?: string): Layout;
|
|
1539
|
+
anchor_from: string | undefined;
|
|
1540
|
+
/**
|
|
1541
|
+
* 设置元素自身的锚点。
|
|
1542
|
+
* @param {string} anchorTo - 锚点(可能值:top_left, top_middle, top_right, left_middle, center, right_middle, bottom_left, bottom_middle, bottom_right)(默认值:center)
|
|
1543
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
1544
|
+
*/
|
|
1545
|
+
setAnchorTo(anchorTo?: string): Layout;
|
|
1546
|
+
anchor_to: string | undefined;
|
|
1547
|
+
/**
|
|
1548
|
+
* 设置是否使用兄弟元素的最大宽度。
|
|
1549
|
+
* @param {boolean} inherit - 是否使用兄弟元素的最大宽度(默认值:false)
|
|
1550
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
1551
|
+
*/
|
|
1552
|
+
setInheritMaxSiblingWidth(inherit?: boolean): Layout;
|
|
1553
|
+
inherit_max_sibling_width: boolean | undefined;
|
|
1554
|
+
/**
|
|
1555
|
+
* 设置是否使用兄弟元素的最大高度。
|
|
1556
|
+
* @param {boolean} inherit - 是否使用兄弟元素的最大高度(默认值:false)
|
|
1557
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
1558
|
+
*/
|
|
1559
|
+
setInheritMaxSiblingHeight(inherit?: boolean): Layout;
|
|
1560
|
+
inherit_max_sibling_height: boolean | undefined;
|
|
1561
|
+
/**
|
|
1562
|
+
* 设置是否使用基于锚点的偏移。
|
|
1563
|
+
* @param {boolean} use - 是否使用基于锚点的偏移(默认值:false)
|
|
1564
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
1565
|
+
*/
|
|
1566
|
+
setUseAnchoredOffset(use?: boolean): Layout;
|
|
1567
|
+
use_anchored_offset: boolean | undefined;
|
|
1568
|
+
/**
|
|
1569
|
+
* 设置是否限制元素在父元素边界内。
|
|
1570
|
+
* @param {boolean} contained - 是否限制元素在父元素边界内(默认值:false)
|
|
1571
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
1572
|
+
*/
|
|
1573
|
+
setContained(contained?: boolean): Layout;
|
|
1574
|
+
contained: boolean | undefined;
|
|
1575
|
+
/**
|
|
1576
|
+
* 设置是否使元素可拖动。
|
|
1577
|
+
* @param {string} draggable - 是否使元素可拖动(可能值:vertical, horizontal, both)
|
|
1578
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
1579
|
+
*/
|
|
1580
|
+
setDraggable(draggable: string): Layout;
|
|
1581
|
+
draggable: string | undefined;
|
|
1582
|
+
/**
|
|
1583
|
+
* 设置是否使元素跟随光标。
|
|
1584
|
+
* @param {boolean} follows - 是否使元素跟随光标(默认值:false)
|
|
1585
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
1586
|
+
*/
|
|
1587
|
+
setFollowsCursor(follows?: boolean): Layout;
|
|
1588
|
+
follows_cursor: boolean | undefined;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
declare class DataBinding {
|
|
1592
|
+
setBinding(binding: any): this;
|
|
1593
|
+
bindings: any[] | undefined;
|
|
1594
|
+
binding: any;
|
|
1595
|
+
addDataBinding(dataBindingObject: any): this;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
/**
|
|
1599
|
+
* Factory 类
|
|
1600
|
+
*
|
|
1601
|
+
* 该类表示一个工厂控件,用于管理子控件的名称和 ID。
|
|
1602
|
+
*
|
|
1603
|
+
* 属性:
|
|
1604
|
+
* - control_name: string - 工厂的子控件名
|
|
1605
|
+
* - control_ids: object - 工厂的子控件 ID 对象组
|
|
1606
|
+
*/
|
|
1607
|
+
declare class Factory {
|
|
1608
|
+
/**
|
|
1609
|
+
* 设置工厂的名。
|
|
1610
|
+
* @param {string} name - 名(格式:name)
|
|
1611
|
+
* @returns {Factory} 返回当前实例以支持链式调用
|
|
1612
|
+
*/
|
|
1613
|
+
setName(name: string): Factory;
|
|
1614
|
+
factory: {} | undefined;
|
|
1615
|
+
/**
|
|
1616
|
+
* 设置工厂的子控件名。
|
|
1617
|
+
* @param {string} name - 子控件名(格式:namespace.controls_name)
|
|
1618
|
+
* @returns {Factory} 返回当前实例以支持链式调用
|
|
1619
|
+
*/
|
|
1620
|
+
setControlName(name: string): Factory;
|
|
1621
|
+
/**
|
|
1622
|
+
* 设置工厂的子控件 ID 对象组。
|
|
1623
|
+
* @param {object} ids - 子控件 ID 对象组
|
|
1624
|
+
* @returns {Factory} 返回当前实例以支持链式调用
|
|
1625
|
+
*/
|
|
1626
|
+
setControlIds(ids: object): Factory;
|
|
1627
|
+
/**
|
|
1628
|
+
* 添加一个子控件 ID。
|
|
1629
|
+
* @param {string} key - 子控件的键名
|
|
1630
|
+
* @param {string} value - 子控件的 ID 值
|
|
1631
|
+
* @returns {Factory} 返回当前实例以支持链式调用
|
|
1632
|
+
*/
|
|
1633
|
+
addControlId(key: string, value: string): Factory;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
declare class Image extends UIElement {
|
|
1637
|
+
constructor(id: any, template: any);
|
|
1638
|
+
sprite: Sprite;
|
|
1639
|
+
layout: Layout;
|
|
1640
|
+
dataBinding: DataBinding;
|
|
1641
|
+
factory: Factory;
|
|
1642
|
+
setSprite(sprite: any): this;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
declare class Panel extends UIElement {
|
|
1646
|
+
constructor(id: any, template: any);
|
|
1647
|
+
layout: Layout;
|
|
1648
|
+
dataBinding: DataBinding;
|
|
1649
|
+
factory: Factory;
|
|
1650
|
+
setLayout(layout: any): this;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* Text 类
|
|
1655
|
+
*
|
|
1656
|
+
* 该类表示一个文本控件,用于管理文本内容及其样式属性。
|
|
1657
|
+
*
|
|
1658
|
+
* 属性:
|
|
1659
|
+
* - text: string - 文本内容(默认值:空字符串)
|
|
1660
|
+
* - color: Vector [r, g, b] - 文本颜色(RGB 值,范围 0.0 到 1.0,默认值:[1.0, 1.0, 1.0])
|
|
1661
|
+
* - locked_color: Vector [r, g, b] - 父级禁用时的文本颜色
|
|
1662
|
+
* - shadow: boolean - 是否显示文本阴影(默认值:false)
|
|
1663
|
+
* - hide_hyphen: boolean - 是否隐藏断词连字符(默认值:false)
|
|
1664
|
+
* - notify_on_ellipses: string[] - 文本出现省略号时需通知的控件名称数组
|
|
1665
|
+
* - enable_profanity_filter: boolean - 是否启用脏话过滤(默认值:false)
|
|
1666
|
+
* - locked_alpha: float - 父级禁用时的透明度
|
|
1667
|
+
* - font_size: enum - 字体大小(可能值:small, normal, large, extra_large,默认值:normal)
|
|
1668
|
+
* - font_scale_factor: float - 字体缩放比例(默认值:1.0)
|
|
1669
|
+
* - localize: boolean - 是否启用本地化翻译(默认值:false)
|
|
1670
|
+
* - line_padding: number - 行间距
|
|
1671
|
+
* - font_type: enum - 字体类型(可能值:default, rune, unicode, smooth, MinecraftTen 或自定义字体,默认值:default)
|
|
1672
|
+
* - backup_font_type: enum - 备用字体类型(默认值:default)
|
|
1673
|
+
* - text_alignment: enum - 文本对齐方式(未定义时根据 anchor_from 和 anchor_to 自动调整)
|
|
1674
|
+
*/
|
|
1675
|
+
declare class Text {
|
|
1676
|
+
/**
|
|
1677
|
+
* 设置文本内容。
|
|
1678
|
+
* @param {string} text - 文本内容
|
|
1679
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1680
|
+
*/
|
|
1681
|
+
setText(text?: string): Text;
|
|
1682
|
+
text: string | undefined;
|
|
1683
|
+
/**
|
|
1684
|
+
* 设置文本颜色。
|
|
1685
|
+
* @param {number[]} color - RGB 颜色值(格式:[r, g, b],默认值:[1.0, 1.0, 1.0])
|
|
1686
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1687
|
+
*/
|
|
1688
|
+
setColor(color?: number[]): Text;
|
|
1689
|
+
color: number[] | undefined;
|
|
1690
|
+
/**
|
|
1691
|
+
* 设置父级禁用时的文本颜色。
|
|
1692
|
+
* @param {number[]} lockedColor - RGB 颜色值(格式:[r, g, b])
|
|
1693
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1694
|
+
*/
|
|
1695
|
+
setLockedColor(lockedColor: number[]): Text;
|
|
1696
|
+
locked_color: number[] | undefined;
|
|
1697
|
+
/**
|
|
1698
|
+
* 设置是否显示文本阴影。
|
|
1699
|
+
* @param {boolean} shadow - 是否显示阴影(默认值:false)
|
|
1700
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1701
|
+
*/
|
|
1702
|
+
setShadow(shadow?: boolean): Text;
|
|
1703
|
+
shadow: boolean | undefined;
|
|
1704
|
+
/**
|
|
1705
|
+
* 设置是否隐藏断词连字符。
|
|
1706
|
+
* @param {boolean} hide - 是否隐藏连字符(默认值:false)
|
|
1707
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1708
|
+
*/
|
|
1709
|
+
setHideHyphen(hide?: boolean): Text;
|
|
1710
|
+
hide_hyphen: boolean | undefined;
|
|
1711
|
+
/**
|
|
1712
|
+
* 设置文本出现省略号时需通知的控件名称数组。
|
|
1713
|
+
* @param {string[]} controls - 控件名称数组
|
|
1714
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1715
|
+
*/
|
|
1716
|
+
setNotifyOnEllipses(controls: string[]): Text;
|
|
1717
|
+
notify_on_ellipses: string[] | undefined;
|
|
1718
|
+
/**
|
|
1719
|
+
* 添加一个需通知省略号事件的控件名称。
|
|
1720
|
+
* @param {string} controlName - 控件名称
|
|
1721
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1722
|
+
*/
|
|
1723
|
+
addNotifyOnEllipses(controlName: string): Text;
|
|
1724
|
+
/**
|
|
1725
|
+
* 设置是否启用脏话过滤。
|
|
1726
|
+
* @param {boolean} enable - 是否启用过滤(默认值:false)
|
|
1727
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1728
|
+
*/
|
|
1729
|
+
setEnableProfanityFilter(enable?: boolean): Text;
|
|
1730
|
+
enable_profanity_filter: boolean | undefined;
|
|
1731
|
+
/**
|
|
1732
|
+
* 设置父级禁用时的透明度。
|
|
1733
|
+
* @param {number} alpha - 透明度(范围:0.0 到 1.0)
|
|
1734
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1735
|
+
*/
|
|
1736
|
+
setLockedAlpha(alpha: number): Text;
|
|
1737
|
+
locked_alpha: number | undefined;
|
|
1738
|
+
/**
|
|
1739
|
+
* 设置字体大小。
|
|
1740
|
+
* @param {string} size - 字体大小(可能值:small, normal, large, extra_large,默认值:normal)
|
|
1741
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1742
|
+
*/
|
|
1743
|
+
setFontSize(size?: string): Text;
|
|
1744
|
+
font_size: string | undefined;
|
|
1745
|
+
/**
|
|
1746
|
+
* 设置字体缩放比例。
|
|
1747
|
+
* @param {number} factor - 缩放比例(默认值:1.0)
|
|
1748
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1749
|
+
*/
|
|
1750
|
+
setFontScaleFactor(factor?: number): Text;
|
|
1751
|
+
font_scale_factor: number | undefined;
|
|
1752
|
+
/**
|
|
1753
|
+
* 设置是否启用本地化翻译。
|
|
1754
|
+
* @param {boolean} localize - 是否启用本地化(默认值:false)
|
|
1755
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1756
|
+
*/
|
|
1757
|
+
setLocalize(localize?: boolean): Text;
|
|
1758
|
+
localize: boolean | undefined;
|
|
1759
|
+
/**
|
|
1760
|
+
* 设置行间距。
|
|
1761
|
+
* @param {number} padding - 行间距
|
|
1762
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1763
|
+
*/
|
|
1764
|
+
setLinePadding(padding: number): Text;
|
|
1765
|
+
line_padding: number | undefined;
|
|
1766
|
+
/**
|
|
1767
|
+
* 设置字体类型。
|
|
1768
|
+
* @param {string} font - 字体类型(可能值:default, rune, unicode 等,默认值:default)
|
|
1769
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1770
|
+
*/
|
|
1771
|
+
setFontType(font?: string): Text;
|
|
1772
|
+
font_type: string | undefined;
|
|
1773
|
+
/**
|
|
1774
|
+
* 设置备用字体类型。
|
|
1775
|
+
* @param {string} backupFont - 备用字体类型(默认值:default)
|
|
1776
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1777
|
+
*/
|
|
1778
|
+
setBackupFontType(backupFont?: string): Text;
|
|
1779
|
+
backup_font_type: string | undefined;
|
|
1780
|
+
/**
|
|
1781
|
+
* 设置文本对齐方式。
|
|
1782
|
+
* @param {string} alignment - 对齐方式(例如:left, right, center)
|
|
1783
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1784
|
+
*/
|
|
1785
|
+
setTextAlignment(alignment: string): Text;
|
|
1786
|
+
text_alignment: string | undefined;
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
declare class Label extends UIElement {
|
|
1790
|
+
constructor(id: any, template: any);
|
|
1791
|
+
text: Text;
|
|
1792
|
+
layout: Layout;
|
|
1793
|
+
dataBinding: DataBinding;
|
|
1794
|
+
factory: Factory;
|
|
1795
|
+
setLayout(layout: any): this;
|
|
1796
|
+
setText(text: any): this;
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
declare class UISystem {
|
|
1800
|
+
constructor(identifier: any, path: any);
|
|
1801
|
+
identifier: any;
|
|
1802
|
+
namespace: any;
|
|
1803
|
+
name: any;
|
|
1804
|
+
path: any;
|
|
1805
|
+
elements: Map<any, any>;
|
|
1806
|
+
animations: Map<any, any>;
|
|
1807
|
+
addElement(element: any): this;
|
|
1808
|
+
getElement(element_name: any): any;
|
|
1809
|
+
addAnimation(name: any, value: any): void;
|
|
1810
|
+
getAnimation(animation_name: any): any;
|
|
1811
|
+
toJson(): {
|
|
1812
|
+
namespace: any;
|
|
1813
|
+
};
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
/**
|
|
1817
|
+
* DataBinding 类
|
|
1818
|
+
*
|
|
1819
|
+
* 该类表示数据绑定配置,用于将硬编码值或变量绑定到元素属性。
|
|
1820
|
+
*
|
|
1821
|
+
* 属性:
|
|
1822
|
+
* - ignored: boolean - 是否忽略绑定(默认值:false)
|
|
1823
|
+
* - binding_type: enum - 绑定类型(可能值:global, view, collection, collection_details, none)
|
|
1824
|
+
* - binding_name: string - 数据绑定名称或条件的值
|
|
1825
|
+
* - binding_name_override: string - 应用 binding_name 值的 UI 元素属性名称
|
|
1826
|
+
* - binding_collection_name: string - 要使用的集合名称
|
|
1827
|
+
* - binding_collection_prefix: string - 集合前缀
|
|
1828
|
+
* - binding_condition: enum - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
1829
|
+
* - source_control_name: string - 要观察其属性值的 UI 元素名称
|
|
1830
|
+
* - source_property_name: string - 存储 source_control_name 引用的 UI 元素的属性值
|
|
1831
|
+
* - target_property_name: string - 应用 source_property_name 值的 UI 元素属性
|
|
1832
|
+
* - resolve_sibling_scope: boolean - 是否允许选择同级元素而非子元素(默认值:false)
|
|
1833
|
+
*/
|
|
1834
|
+
declare class DataBindingObject {
|
|
1835
|
+
/**
|
|
1836
|
+
* 设置是否忽略绑定。
|
|
1837
|
+
* @param {boolean} ignored - 是否忽略绑定(默认值:false)
|
|
1838
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1839
|
+
*/
|
|
1840
|
+
setIgnored(ignored?: boolean): DataBindingObject;
|
|
1841
|
+
ignored: boolean | undefined;
|
|
1842
|
+
/**
|
|
1843
|
+
* 设置绑定类型。
|
|
1844
|
+
* @param {string} type - 绑定类型(可能值:global, view, collection, collection_details, none)
|
|
1845
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1846
|
+
*/
|
|
1847
|
+
setBindingType(type: string): DataBindingObject;
|
|
1848
|
+
binding_type: string | undefined;
|
|
1849
|
+
/**
|
|
1850
|
+
* 设置数据绑定名称或条件的值。
|
|
1851
|
+
* @param {string} name - 数据绑定名称或条件的值
|
|
1852
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1853
|
+
*/
|
|
1854
|
+
setBindingName(name: string): DataBindingObject;
|
|
1855
|
+
binding_name: string | undefined;
|
|
1856
|
+
/**
|
|
1857
|
+
* 设置应用 binding_name 值的 UI 元素属性名称。
|
|
1858
|
+
* @param {string} nameOverride - 应用 binding_name 值的 UI 元素属性名称
|
|
1859
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1860
|
+
*/
|
|
1861
|
+
setBindingNameOverride(nameOverride: string): DataBindingObject;
|
|
1862
|
+
binding_name_override: string | undefined;
|
|
1863
|
+
/**
|
|
1864
|
+
* 设置要使用的集合名称。
|
|
1865
|
+
* @param {string} collectionName - 集合名称
|
|
1866
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1867
|
+
*/
|
|
1868
|
+
setBindingCollectionName(collectionName: string): DataBindingObject;
|
|
1869
|
+
binding_collection_name: string | undefined;
|
|
1870
|
+
/**
|
|
1871
|
+
* 设置集合前缀。
|
|
1872
|
+
* @param {string} prefix - 集合前缀
|
|
1873
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1874
|
+
*/
|
|
1875
|
+
setBindingCollectionPrefix(prefix: string): DataBindingObject;
|
|
1876
|
+
binding_collection_prefix: string | undefined;
|
|
1877
|
+
/**
|
|
1878
|
+
* 设置数据绑定的条件。
|
|
1879
|
+
* @param {string} condition - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
1880
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1881
|
+
*/
|
|
1882
|
+
setBindingCondition(condition: string): DataBindingObject;
|
|
1883
|
+
binding_condition: string | undefined;
|
|
1884
|
+
/**
|
|
1885
|
+
* 设置要观察其属性值的 UI 元素名称。
|
|
1886
|
+
* @param {string} controlName - UI 元素名称
|
|
1887
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1888
|
+
*/
|
|
1889
|
+
setSourceControlName(controlName: string): DataBindingObject;
|
|
1890
|
+
source_control_name: string | undefined;
|
|
1891
|
+
/**
|
|
1892
|
+
* 设置存储 source_control_name 引用的 UI 元素的属性值。
|
|
1893
|
+
* @param {string} propertyName - 属性名称
|
|
1894
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1895
|
+
*/
|
|
1896
|
+
setSourcePropertyName(propertyName: string): DataBindingObject;
|
|
1897
|
+
source_property_name: string | undefined;
|
|
1898
|
+
/**
|
|
1899
|
+
* 设置应用 source_property_name 值的 UI 元素属性。
|
|
1900
|
+
* @param {string} propertyName - 属性名称
|
|
1901
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1902
|
+
*/
|
|
1903
|
+
setTargetPropertyName(propertyName: string): DataBindingObject;
|
|
1904
|
+
target_property_name: string | undefined;
|
|
1905
|
+
/**
|
|
1906
|
+
* 设置是否允许选择同级元素而非子元素。
|
|
1907
|
+
* @param {boolean} resolve - 是否允许选择同级元素(默认值:false)
|
|
1908
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1909
|
+
*/
|
|
1910
|
+
setResolveSiblingScope(resolve?: boolean): DataBindingObject;
|
|
1911
|
+
resolve_sibling_scope: boolean | undefined;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
declare const ServerFormSystem: UISystem;
|
|
1915
|
+
declare class ServerUISystem {
|
|
1916
|
+
static "__#4256@#binding_map": Map<any, any>;
|
|
1917
|
+
static "__#4256@#binding_title_list": any[];
|
|
1918
|
+
static addBindingTitle(title_name: any): void;
|
|
1919
|
+
static getBindingTitleList(): any[];
|
|
1920
|
+
static getBindingContentList(): any[];
|
|
1921
|
+
static bindingTitlewithContent(title_name: any, content: any): void;
|
|
1922
|
+
static "__#4256@#updateServerFormSystem"(): void;
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
declare class ItemTextureManager {
|
|
1926
|
+
static item_texture_sets: Map<any, any>;
|
|
1927
|
+
static getItemTextureSet(): Map<any, any>;
|
|
1928
|
+
static getItemTextures(): any;
|
|
1929
|
+
static registerTextureData(texture_name: any, texture_data: any): void;
|
|
1930
|
+
static registerTexture(texture_name: any, texture_path: any): void;
|
|
1931
|
+
}
|
|
1932
|
+
declare class terrainTextureManager {
|
|
1933
|
+
static terrain_texture_sets: Map<any, any>;
|
|
1934
|
+
static getTerrainTextureSet(): Map<any, any>;
|
|
1935
|
+
static getTerrainTextures(): any;
|
|
1936
|
+
static registerTextureData(texture_name: any, texture_data: any): void;
|
|
1937
|
+
static registerTexture(texture_name: any, texture_path: any): void;
|
|
1938
|
+
}
|
|
1939
|
+
declare namespace FlipbookTextures {
|
|
1940
|
+
let flipbook_textures: never[];
|
|
1941
|
+
function registerFlipbookTexture(atlas_tile: any, texture: any, ticks_per_frame: any, options?: {}): void;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
declare class GRegistry {
|
|
1945
|
+
static dataList: any[];
|
|
1946
|
+
/**
|
|
1947
|
+
* 生成注册器
|
|
1948
|
+
* @param {string} name 文件名字
|
|
1949
|
+
* @param {string} root 根目录,如 "behavior"、"resource" 等
|
|
1950
|
+
* @param {string} path 数据的路径,如 "blocks/"、"items/"、"recipes/" 等
|
|
1951
|
+
* @param {string} data 实例 必须包含 toJson 方法
|
|
1952
|
+
*/
|
|
1953
|
+
static register(name: string, root: string, path: string, data: string): void;
|
|
1954
|
+
static getDataList(): any[];
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
declare class UISystemRegistry {
|
|
1958
|
+
static "__#4255@#ui_system_map": Map<any, any>;
|
|
1959
|
+
static "__#4255@#ui_def_list": any[];
|
|
1960
|
+
static registerUISystem(ui_system: any): void;
|
|
1961
|
+
static getUISystemList(): any[];
|
|
1962
|
+
static addOuterUIdefs(ui_defs: any): void;
|
|
1963
|
+
static getUIdefList(): any[];
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
declare class CollectionPanel extends UIElement {
|
|
1967
|
+
constructor(id: any, template: any);
|
|
1968
|
+
layout: Layout;
|
|
1969
|
+
dataBinding: DataBinding;
|
|
1970
|
+
factory: Factory;
|
|
1971
|
+
setCollectionName(collection_name: any): this;
|
|
1972
|
+
setLayout(layout: any): this;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* Grid 类
|
|
1977
|
+
*
|
|
1978
|
+
* 该类表示一个网格控件属性,用于管理网格布局及其相关属性。
|
|
1979
|
+
*
|
|
1980
|
+
* 属性:
|
|
1981
|
+
* - grid_dimensions: Vector [columns, rows] - 网格的列数和行数
|
|
1982
|
+
* - maximum_grid_items: int - 网格生成的最大项目数
|
|
1983
|
+
* - grid_dimension_binding: string - 网格尺寸的绑定名称
|
|
1984
|
+
* - grid_rescaling_type: enum - 网格重新缩放方向(可能值:vertical, horizontal, none,默认值:none)
|
|
1985
|
+
* - grid_fill_direction: enum - 网格填充方向(可能值:vertical, horizontal, none,默认值:none)
|
|
1986
|
+
* - grid_item_template: string - 处理集合的子元素名称(例如:"common.container_item")
|
|
1987
|
+
* - precached_grid_item_count: int - 预缓存的网格项目数量
|
|
1988
|
+
*/
|
|
1989
|
+
declare class GridProp {
|
|
1990
|
+
/**
|
|
1991
|
+
* 设置网格的列数和行数。
|
|
1992
|
+
* @param {number[]} dimensions - 格式为 [columns, rows]
|
|
1993
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
1994
|
+
*/
|
|
1995
|
+
setGridDimensions(dimensions: number[]): GridProp;
|
|
1996
|
+
grid_dimensions: number[] | undefined;
|
|
1997
|
+
/**
|
|
1998
|
+
* 设置网格生成的最大项目数。
|
|
1999
|
+
* @param {number} maxItems - 最大项目数
|
|
2000
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
2001
|
+
*/
|
|
2002
|
+
setMaximumGridItems(maxItems: number): GridProp;
|
|
2003
|
+
maximum_grid_items: number | undefined;
|
|
2004
|
+
/**
|
|
2005
|
+
* 设置网格尺寸的绑定名称。
|
|
2006
|
+
* @param {string} binding - 绑定名称
|
|
2007
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
2008
|
+
*/
|
|
2009
|
+
setGridDimensionBinding(binding: string): GridProp;
|
|
2010
|
+
grid_dimension_binding: string | undefined;
|
|
2011
|
+
/**
|
|
2012
|
+
* 设置网格重新缩放方向。
|
|
2013
|
+
* @param {string} type - 可能值:vertical, horizontal, none(默认值:none)
|
|
2014
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
2015
|
+
*/
|
|
2016
|
+
setGridRescalingType(type?: string): GridProp;
|
|
2017
|
+
grid_rescaling_type: string | undefined;
|
|
2018
|
+
/**
|
|
2019
|
+
* 设置网格填充方向。
|
|
2020
|
+
* @param {string} direction - 可能值:vertical, horizontal, none(默认值:none)
|
|
2021
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
2022
|
+
*/
|
|
2023
|
+
setGridFillDirection(direction?: string): GridProp;
|
|
2024
|
+
grid_fill_direction: string | undefined;
|
|
2025
|
+
/**
|
|
2026
|
+
* 设置处理集合的子元素名称。
|
|
2027
|
+
* @param {string} template - 元素名称(例如:"common.container_item")
|
|
2028
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
2029
|
+
*/
|
|
2030
|
+
setGridItemTemplate(template: string): GridProp;
|
|
2031
|
+
grid_item_template: string | undefined;
|
|
2032
|
+
/**
|
|
2033
|
+
* 设置预缓存的网格项目数量。
|
|
2034
|
+
* @param {number} count - 预缓存数量
|
|
2035
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
2036
|
+
*/
|
|
2037
|
+
setPrecachedGridItemCount(count: number): GridProp;
|
|
2038
|
+
precached_grid_item_count: number | undefined;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
declare class Grid extends CollectionPanel {
|
|
2042
|
+
gridNum: number;
|
|
2043
|
+
grid: GridProp;
|
|
2044
|
+
setGridProp(grid_prop: any): this;
|
|
2045
|
+
addGridItem(grid_position: any, content: any): this;
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
declare class StackPanel extends Panel {
|
|
2049
|
+
type: string;
|
|
2050
|
+
orientation: string;
|
|
2051
|
+
stackNum: number;
|
|
2052
|
+
addStack(size: any, content: any, debug?: boolean): this;
|
|
2053
|
+
/**
|
|
2054
|
+
* Possible values:
|
|
2055
|
+
vertical
|
|
2056
|
+
horizontal
|
|
2057
|
+
* @param {*} orientation
|
|
2058
|
+
*/
|
|
2059
|
+
setOrientation(orientation: any): this;
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
export { BlockAPI, BlockComponent, DataBindingObject, EntityAPI, FeatureAPI, FlipbookTextures, GRegistry, Grid, Image, ItemAPI, ItemCategory, ItemComponent, ItemTextureManager, Label, Panel, RecipeAPI, ServerFormSystem, ServerUISystem, StackPanel, UIElement, UISystem, UISystemRegistry, terrainTextureManager };
|