sapdon 3.0.3 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/doc/api.md +2 -2
- package/doc/oc/index.md +0 -0
- package/doc/sapdon-ts.md +7 -5
- package/package.json +18 -19
- package/{dist/cli/dev-server/server.d.ts → prod/cli/index.d.ts} +9 -3
- package/prod/cli/index.js +1 -0
- package/prod/cli/start.js +1428 -0
- package/{dist → prod}/core/index.d.ts +2325 -1643
- package/prod/core/index.js +59017 -0
- package/{dist → prod}/oc/index.d.ts +3 -3
- package/prod/oc/index.js +1 -0
- package/prod/utils/index.d.ts +41 -0
- package/prod/utils/index.js +1 -0
- package/dist/cli/build.d.ts +0 -7
- package/dist/cli/build.js +0 -234
- package/dist/cli/dev-server/client.d.ts +0 -2
- package/dist/cli/dev-server/client.js +0 -21
- package/dist/cli/dev-server/config.d.ts +0 -3
- package/dist/cli/dev-server/config.js +0 -3
- package/dist/cli/dev-server/handles.d.ts +0 -4
- package/dist/cli/dev-server/handles.js +0 -5
- package/dist/cli/dev-server/hmr.d.ts +0 -1
- package/dist/cli/dev-server/hmr.js +0 -13
- package/dist/cli/dev-server/index.d.ts +0 -4
- package/dist/cli/dev-server/index.js +0 -17
- package/dist/cli/dev-server/server.js +0 -59
- package/dist/cli/dev-server/syncFiles.d.ts +0 -3
- package/dist/cli/dev-server/syncFiles.js +0 -37
- package/dist/cli/index.d.ts +0 -23
- package/dist/cli/index.js +0 -1
- package/dist/cli/init.d.ts +0 -9
- package/dist/cli/init.js +0 -80
- package/dist/cli/load.d.ts +0 -3
- package/dist/cli/load.js +0 -94
- package/dist/cli/start.d.ts +0 -2
- package/dist/cli/start.js +0 -2
- package/dist/cli/tools/textureSet.d.ts +0 -13
- package/dist/cli/tools/textureSet.js +0 -103
- package/dist/cli/utils.d.ts +0 -13
- package/dist/cli/utils.js +0 -89
- package/dist/core/addon/biome.d.ts +0 -22
- package/dist/core/addon/biome.js +0 -27
- package/dist/core/addon/block/block.d.ts +0 -41
- package/dist/core/addon/block/block.js +0 -46
- package/dist/core/addon/controllers/animationController.d.ts +0 -43
- package/dist/core/addon/controllers/animationController.js +0 -73
- package/dist/core/addon/entity/clientEntity.d.ts +0 -107
- package/dist/core/addon/entity/clientEntity.js +0 -149
- package/dist/core/addon/entity/entity.d.ts +0 -42
- package/dist/core/addon/entity/entity.js +0 -50
- package/dist/core/addon/feature/oreFeature.d.ts +0 -19
- package/dist/core/addon/feature/oreFeature.js +0 -24
- package/dist/core/addon/featureRule.d.ts +0 -20
- package/dist/core/addon/featureRule.js +0 -25
- package/dist/core/addon/item/attachable.d.ts +0 -94
- package/dist/core/addon/item/attachable.js +0 -134
- package/dist/core/addon/item/item.d.ts +0 -19
- package/dist/core/addon/item/item.js +0 -26
- package/dist/core/addon/manifest.d.ts +0 -49
- package/dist/core/addon/manifest.js +0 -65
- package/dist/core/addon/menuCategory.d.ts +0 -6
- package/dist/core/addon/menuCategory.js +0 -7
- package/dist/core/addon/recipe/baseRecipe.d.ts +0 -12
- package/dist/core/addon/recipe/baseRecipe.js +0 -23
- package/dist/core/addon/recipe/data.d.ts +0 -66
- package/dist/core/addon/recipe/data.js +0 -74
- package/dist/core/addon/recipe/furnace.d.ts +0 -17
- package/dist/core/addon/recipe/furnace.js +0 -43
- package/dist/core/addon/recipe/shaped.d.ts +0 -26
- package/dist/core/addon/recipe/shaped.js +0 -53
- package/dist/core/addon/recipe/shapeless.d.ts +0 -18
- package/dist/core/addon/recipe/shapeless.js +0 -36
- package/dist/core/biome/biome.d.ts +0 -14
- package/dist/core/biome/biome.js +0 -23
- package/dist/core/biome/biomeComponent.d.ts +0 -46
- package/dist/core/biome/biomeComponent.js +0 -77
- package/dist/core/block/basicBlock.d.ts +0 -48
- package/dist/core/block/basicBlock.js +0 -105
- package/dist/core/block/block.d.ts +0 -32
- package/dist/core/block/block.js +0 -92
- package/dist/core/block/blockComponent.d.ts +0 -187
- package/dist/core/block/blockComponent.js +0 -500
- package/dist/core/block/cropBlock.d.ts +0 -4
- package/dist/core/block/cropBlock.js +0 -27
- package/dist/core/block/geometryBlock.d.ts +0 -12
- package/dist/core/block/geometryBlock.js +0 -16
- package/dist/core/block/oreBlock.d.ts +0 -9
- package/dist/core/block/oreBlock.js +0 -25
- package/dist/core/block/rotatableBlock.d.ts +0 -27
- package/dist/core/block/rotatableBlock.js +0 -107
- package/dist/core/block/tileBlock.d.ts +0 -17
- package/dist/core/block/tileBlock.js +0 -125
- package/dist/core/entity/basicEntity.d.ts +0 -111
- package/dist/core/entity/basicEntity.js +0 -170
- package/dist/core/entity/behavior/followMob.d.ts +0 -12
- package/dist/core/entity/behavior/followMob.js +0 -35
- package/dist/core/entity/behavior/followParent.d.ts +0 -7
- package/dist/core/entity/behavior/followParent.js +0 -15
- package/dist/core/entity/behavior/randomStroll.d.ts +0 -31
- package/dist/core/entity/behavior/randomStroll.js +0 -63
- package/dist/core/entity/behavior/tempt.d.ts +0 -73
- package/dist/core/entity/behavior/tempt.js +0 -134
- package/dist/core/entity/bundles/basicBundle.d.ts +0 -13
- package/dist/core/entity/bundles/basicBundle.js +0 -45
- package/dist/core/entity/clientEntity.d.ts +0 -20
- package/dist/core/entity/clientEntity.js +0 -37
- package/dist/core/entity/componets/entityComponet.d.ts +0 -202
- package/dist/core/entity/componets/entityComponet.js +0 -347
- package/dist/core/entity/data/nativeEntityData.d.ts +0 -9
- package/dist/core/entity/data/nativeEntityData.js +0 -38
- package/dist/core/entity/entity.d.ts +0 -15
- package/dist/core/entity/entity.js +0 -18
- package/dist/core/entity/nativeEntity.d.ts +0 -8
- package/dist/core/entity/nativeEntity.js +0 -28
- package/dist/core/entity/navigation/walk.d.ts +0 -23
- package/dist/core/entity/navigation/walk.js +0 -56
- package/dist/core/entity/projectile.d.ts +0 -3
- package/dist/core/entity/projectile.js +0 -7
- package/dist/core/factory/biomeFactory.d.ts +0 -4
- package/dist/core/factory/biomeFactory.js +0 -13
- package/dist/core/factory/blockFactory.d.ts +0 -34
- package/dist/core/factory/blockFactory.js +0 -143
- package/dist/core/factory/entityFactory.d.ts +0 -17
- package/dist/core/factory/entityFactory.js +0 -75
- package/dist/core/factory/featureFactory.d.ts +0 -6
- package/dist/core/factory/featureFactory.js +0 -23
- package/dist/core/factory/itemExtra.d.ts +0 -8
- package/dist/core/factory/itemExtra.js +0 -9
- package/dist/core/factory/itemFactory.d.ts +0 -27
- package/dist/core/factory/itemFactory.js +0 -112
- package/dist/core/factory/recipeFactory.d.ts +0 -18
- package/dist/core/factory/recipeFactory.js +0 -39
- package/dist/core/factory/uiFactory.d.ts +0 -12
- package/dist/core/factory/uiFactory.js +0 -32
- package/dist/core/feature/oreFeature.d.ts +0 -10
- package/dist/core/feature/oreFeature.js +0 -11
- package/dist/core/feature-rule/condition/biomeFilter.d.ts +0 -26
- package/dist/core/feature-rule/condition/biomeFilter.js +0 -36
- package/dist/core/feature-rule/condition/featureConditions.d.ts +0 -27
- package/dist/core/feature-rule/condition/featureConditions.js +0 -37
- package/dist/core/feature-rule/distribution/coordinateDistribution.d.ts +0 -17
- package/dist/core/feature-rule/distribution/coordinateDistribution.js +0 -23
- package/dist/core/feature-rule/distribution/featureDistribution.d.ts +0 -31
- package/dist/core/feature-rule/distribution/featureDistribution.js +0 -41
- package/dist/core/feature-rule/featureRule.d.ts +0 -17
- package/dist/core/feature-rule/featureRule.js +0 -26
- package/dist/core/index.js +0 -1
- package/dist/core/item/armor.d.ts +0 -21
- package/dist/core/item/armor.js +0 -90
- package/dist/core/item/attachable.d.ts +0 -6
- package/dist/core/item/attachable.js +0 -26
- package/dist/core/item/food.d.ts +0 -24
- package/dist/core/item/food.js +0 -38
- package/dist/core/item/item.d.ts +0 -36
- package/dist/core/item/item.js +0 -69
- package/dist/core/item/itemComponents.d.ts +0 -113
- package/dist/core/item/itemComponents.js +0 -225
- package/dist/core/registry.d.ts +0 -12
- package/dist/core/registry.js +0 -16
- package/dist/core/texture.d.ts +0 -18
- package/dist/core/texture.js +0 -38
- package/dist/core/ui/buttonMapping.d.ts +0 -97
- package/dist/core/ui/buttonMapping.js +0 -132
- package/dist/core/ui/dataBindingObject.d.ts +0 -97
- package/dist/core/ui/dataBindingObject.js +0 -134
- package/dist/core/ui/elements/button.d.ts +0 -21
- package/dist/core/ui/elements/button.js +0 -101
- package/dist/core/ui/elements/collectionPanel.d.ts +0 -12
- package/dist/core/ui/elements/collectionPanel.js +0 -53
- package/dist/core/ui/elements/grid.d.ts +0 -8
- package/dist/core/ui/elements/grid.js +0 -33
- package/dist/core/ui/elements/image.d.ts +0 -13
- package/dist/core/ui/elements/image.js +0 -55
- package/dist/core/ui/elements/label.d.ts +0 -14
- package/dist/core/ui/elements/label.js +0 -61
- package/dist/core/ui/elements/panel.d.ts +0 -11
- package/dist/core/ui/elements/panel.js +0 -49
- package/dist/core/ui/elements/scrollingPanel.d.ts +0 -14
- package/dist/core/ui/elements/scrollingPanel.js +0 -59
- package/dist/core/ui/elements/stackPanel.d.ts +0 -14
- package/dist/core/ui/elements/stackPanel.js +0 -37
- package/dist/core/ui/elements/uiElement.d.ts +0 -53
- package/dist/core/ui/elements/uiElement.js +0 -129
- package/dist/core/ui/properties/control.d.ts +0 -214
- package/dist/core/ui/properties/control.js +0 -286
- package/dist/core/ui/properties/dataBinding.d.ts +0 -6
- package/dist/core/ui/properties/dataBinding.js +0 -16
- package/dist/core/ui/properties/factory.d.ts +0 -37
- package/dist/core/ui/properties/factory.js +0 -62
- package/dist/core/ui/properties/gridProp.d.ts +0 -65
- package/dist/core/ui/properties/gridProp.js +0 -90
- package/dist/core/ui/properties/input.d.ts +0 -97
- package/dist/core/ui/properties/input.js +0 -134
- package/dist/core/ui/properties/layout.d.ts +0 -105
- package/dist/core/ui/properties/layout.js +0 -145
- package/dist/core/ui/properties/scrollView.d.ts +0 -105
- package/dist/core/ui/properties/scrollView.js +0 -145
- package/dist/core/ui/properties/sound.d.ts +0 -47
- package/dist/core/ui/properties/sound.js +0 -66
- package/dist/core/ui/properties/sprite.d.ts +0 -161
- package/dist/core/ui/properties/sprite.js +0 -222
- package/dist/core/ui/properties/text.d.ts +0 -135
- package/dist/core/ui/properties/text.js +0 -187
- package/dist/core/ui/registry/uiSystemRegistry.d.ts +0 -8
- package/dist/core/ui/registry/uiSystemRegistry.js +0 -26
- package/dist/core/ui/systems/chest.d.ts +0 -5
- package/dist/core/ui/systems/chest.js +0 -21
- package/dist/core/ui/systems/containerUISystem.d.ts +0 -67
- package/dist/core/ui/systems/containerUISystem.js +0 -214
- package/dist/core/ui/systems/guidebook.d.ts +0 -9
- package/dist/core/ui/systems/guidebook.js +0 -206
- package/dist/core/ui/systems/serverForm.d.ts +0 -13
- package/dist/core/ui/systems/serverForm.js +0 -116
- package/dist/core/ui/systems/system.d.ts +0 -16
- package/dist/core/ui/systems/system.js +0 -37
- package/dist/oc/index.js +0 -1
- package/doc/cli.md +0 -24
- /package/doc/hello_sapdon/{sapdon/344/275/277/347/224/250/346/225/231/347/250/213.md" → hello_sapdon.md} +0 -0
|
@@ -7,1919 +7,2719 @@ declare enum ItemCategory {
|
|
|
7
7
|
None = "none"
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
declare
|
|
10
|
+
declare function getMetadata(target: any): any;
|
|
11
|
+
declare function getOrCreateMetadata(target: any): any;
|
|
12
|
+
|
|
13
|
+
interface ISerializer {
|
|
14
|
+
(instance: any): object;
|
|
15
|
+
}
|
|
16
|
+
declare function jsonEncoderReplacer(_: string, v: any): any;
|
|
17
|
+
declare const defaultSerializer: ISerializer;
|
|
18
|
+
declare function Serializable(serializer?: ISerializer): (_: any, ctx: DecoratorContext) => void;
|
|
19
|
+
/**
|
|
20
|
+
* 只能应用一个 Serializer
|
|
21
|
+
*
|
|
22
|
+
* 重复的 Serializer 会被覆盖
|
|
23
|
+
* @param target
|
|
24
|
+
* @param ctx
|
|
25
|
+
*/
|
|
26
|
+
declare const Serializer: MethodDecorator;
|
|
27
|
+
declare function serialize<R, T extends object>(inst: T): R;
|
|
28
|
+
declare const jsonEncodeDecoder: EncodeDecoder<any, string>;
|
|
29
|
+
declare function encode<Base, Trans>(value: Base, encodeDecoder?: EncodeDecoder<Base, Trans>): Trans;
|
|
30
|
+
declare function decode<Trans, Base>(value: Trans, encodeDecoder?: EncodeDecoder<Base, Trans>): Base;
|
|
31
|
+
interface EncodeDecoder<Base, Trans> {
|
|
32
|
+
encode: (data: Base) => Trans;
|
|
33
|
+
decode: (chunk: Trans) => Base;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type ConstructorOf<T, Arg extends unknown[] = []> = new (...args: Arg) => T;
|
|
37
|
+
|
|
38
|
+
type FloatLiteral = `${number}.${number}`;
|
|
39
|
+
interface RawType<T> extends RawJSON {
|
|
40
|
+
valueOf(): T;
|
|
41
|
+
}
|
|
42
|
+
declare const IS_RAW_SYMBOL: unique symbol;
|
|
43
|
+
declare const f64: (literal: FloatLiteral) => {
|
|
44
|
+
[IS_RAW_SYMBOL]: boolean;
|
|
45
|
+
rawJSON: string;
|
|
46
|
+
valueOf(): number;
|
|
47
|
+
};
|
|
48
|
+
declare function isRawJSON(v: any): boolean;
|
|
49
|
+
|
|
50
|
+
declare class ArrayEx extends Array {
|
|
51
|
+
constructor(init?: number[]);
|
|
52
|
+
set(arr: Iterable<number>): void;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface Vector3 {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
z: number;
|
|
59
|
+
}
|
|
60
|
+
declare class Vec3 extends ArrayEx implements Vector3 {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
z: number;
|
|
64
|
+
constructor(init: number[]);
|
|
65
|
+
static fromXYZ(x: number, y: number, z: number): Vec3;
|
|
66
|
+
static fromVec3(vec3: Vector3): Vec3;
|
|
67
|
+
static m(vec3: Vector3): number;
|
|
68
|
+
m(): number;
|
|
69
|
+
static isZero(vec: Vector3): boolean;
|
|
70
|
+
isZero(): boolean;
|
|
71
|
+
static normalize(vec: Vector3): false | undefined;
|
|
72
|
+
n(): false | undefined;
|
|
73
|
+
static add(vec1: Vector3, vec2: Vector3): Vec3;
|
|
74
|
+
add(vec: Vector3): Vec3;
|
|
75
|
+
static sub(vec1: Vector3, vec2: Vector3): Vec3;
|
|
76
|
+
sub(vec: Vector3): Vec3;
|
|
77
|
+
static mul(vec: Vector3, scalar: number): Vec3;
|
|
78
|
+
mul(scalar: number): Vec3;
|
|
79
|
+
static div(vec: Vector3, scalar: number): Vec3;
|
|
80
|
+
div(scalar: number): Vec3;
|
|
81
|
+
static dot(vec1: Vector3, vec2: Vector3): number;
|
|
82
|
+
dot(vec: Vector3): number;
|
|
83
|
+
static cross(vec1: Vector3, vec2: Vector3): Vec3;
|
|
84
|
+
cross(vec: Vector3): Vec3;
|
|
85
|
+
valueOf(): ArrayEx;
|
|
86
|
+
toString(): string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface Vector4 extends Vector3 {
|
|
90
|
+
w: number;
|
|
91
|
+
}
|
|
92
|
+
declare class Vec4 extends ArrayEx implements Vector4 {
|
|
93
|
+
x: number;
|
|
94
|
+
y: number;
|
|
95
|
+
z: number;
|
|
96
|
+
w: number;
|
|
97
|
+
constructor(init: number[]);
|
|
98
|
+
static fromXYZW(x: number, y: number, z: number, w: number): Vec4;
|
|
99
|
+
static fromVec3(vec3: Vector4): Vec4;
|
|
100
|
+
static fromVec4(vec4: Vector4): Vec4;
|
|
101
|
+
static m(vec: Vector4): number;
|
|
102
|
+
m(): number;
|
|
103
|
+
static isZero(vec: Vector4): boolean;
|
|
104
|
+
isZero(): boolean;
|
|
105
|
+
static normalize(vec: Vector4): false | undefined;
|
|
106
|
+
n(): false | undefined;
|
|
107
|
+
static add(vec1: Vector4, vec2: Vector4): Vec4;
|
|
108
|
+
add(vec: Vector4): Vec4;
|
|
109
|
+
static sub(vec1: Vector4, vec2: Vector4): Vec4;
|
|
110
|
+
sub(vec: Vector4): Vec4;
|
|
111
|
+
static mul(vec: Vector4, scalar: number): Vec4;
|
|
112
|
+
mul(scalar: number): Vec4;
|
|
113
|
+
static div(vec: Vector4, scalar: number): Vec4;
|
|
114
|
+
div(scalar: number): Vec4;
|
|
115
|
+
static dot(vec1: Vector4, vec2: Vector4): number;
|
|
116
|
+
dot(vec: Vector4): number;
|
|
117
|
+
static multiply(vec: Vector4, mat: Matrix): number[] | Vec4;
|
|
118
|
+
multiply(mat: Matrix): number[] | Vec4;
|
|
119
|
+
valueOf(): ArrayEx;
|
|
120
|
+
toString(): string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare class Matrix extends ArrayEx {
|
|
124
|
+
constructor();
|
|
125
|
+
get m11(): any;
|
|
126
|
+
get m12(): any;
|
|
127
|
+
get m13(): any;
|
|
128
|
+
get m14(): any;
|
|
129
|
+
get m21(): any;
|
|
130
|
+
get m22(): any;
|
|
131
|
+
get m23(): any;
|
|
132
|
+
get m24(): any;
|
|
133
|
+
get m31(): any;
|
|
134
|
+
get m32(): any;
|
|
135
|
+
get m33(): any;
|
|
136
|
+
get m34(): any;
|
|
137
|
+
get m41(): any;
|
|
138
|
+
get m42(): any;
|
|
139
|
+
get m43(): any;
|
|
140
|
+
get m44(): any;
|
|
141
|
+
set m11(v: any);
|
|
142
|
+
set m12(v: any);
|
|
143
|
+
set m13(v: any);
|
|
144
|
+
set m14(v: any);
|
|
145
|
+
set m21(v: any);
|
|
146
|
+
set m22(v: any);
|
|
147
|
+
set m23(v: any);
|
|
148
|
+
set m24(v: any);
|
|
149
|
+
set m31(v: any);
|
|
150
|
+
set m32(v: any);
|
|
151
|
+
set m33(v: any);
|
|
152
|
+
set m34(v: any);
|
|
153
|
+
set m41(v: any);
|
|
154
|
+
set m42(v: any);
|
|
155
|
+
set m43(v: any);
|
|
156
|
+
set m44(v: any);
|
|
157
|
+
get a(): any;
|
|
158
|
+
get b(): any;
|
|
159
|
+
get c(): any;
|
|
160
|
+
get d(): any;
|
|
161
|
+
get e(): any;
|
|
162
|
+
get f(): any;
|
|
163
|
+
set a(v: any);
|
|
164
|
+
set b(v: any);
|
|
165
|
+
set c(v: any);
|
|
166
|
+
set d(v: any);
|
|
167
|
+
set e(v: any);
|
|
168
|
+
set f(v: any);
|
|
169
|
+
static init(init: Iterable<number>, mapfn: (v: number, k: number) => number, thisArg?: any): Matrix;
|
|
170
|
+
clone(): Matrix;
|
|
171
|
+
setIdentity(): this;
|
|
172
|
+
static identity(): Matrix;
|
|
173
|
+
static add(m1: Matrix, m2: Matrix): Matrix;
|
|
174
|
+
add(m: Matrix): Matrix;
|
|
175
|
+
static sub(m1: Matrix, m2: Matrix): Matrix;
|
|
176
|
+
sub(m: Matrix): Matrix;
|
|
177
|
+
setTranslation(x: number, y: number, z: number): this;
|
|
178
|
+
setRotation(angle: number, axis: Vec3): this;
|
|
179
|
+
setScale(x: number, y: number, z: number): this;
|
|
180
|
+
setRotationX(angle: number): this;
|
|
181
|
+
setRotationY(angle: number): this;
|
|
182
|
+
setRotationZ(angle: number): this;
|
|
183
|
+
setRotationXYZ(yaw: number, pitch: number, roll: number): this;
|
|
184
|
+
static translate(mat: Matrix, vec: Vector3): Matrix;
|
|
185
|
+
translate(vec: Vector3): Matrix;
|
|
186
|
+
static transpose(mat: Matrix): any[];
|
|
187
|
+
transpose(): any[];
|
|
188
|
+
static multiply(mat1: Matrix, t: Matrix | Vector4): number[] | Vec4;
|
|
189
|
+
multiply(t: Matrix | Vector4): number[] | Vec4;
|
|
190
|
+
valueOf(): ArrayEx;
|
|
191
|
+
toString(): string;
|
|
192
|
+
static perspective(fov: number, aspect: number, near: number, far: number): number[];
|
|
193
|
+
static orthographic(right: number, top: number, near: number, far: number): number[];
|
|
194
|
+
static lookAt(eye: Vector3, target: Vector3, up: Vector3): number[];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Control Class
|
|
199
|
+
*
|
|
200
|
+
* This class represents a UI control element with various properties and methods to manipulate its state.
|
|
201
|
+
*
|
|
202
|
+
* Properties:
|
|
203
|
+
* - visible: boolean - If the UI element should be visible (default: true)
|
|
204
|
+
* - 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)
|
|
205
|
+
* - layer: int - Z-Index/Layer (like zindex in CSS) relative to parent element. Higher layers will render above (default: 0)
|
|
206
|
+
* - alpha: float - Alpha/transparency of the element. It will only affect the UI element. Its children will be unaffected. (default: 1.0)
|
|
207
|
+
* - propagate_alpha: boolean - If alpha should not only apply to the parent if possible but also all its children (default: false)
|
|
208
|
+
* - clips_children: boolean - Cuts off visually and interactively everything beyond the boundaries of the UI element (default: false)
|
|
209
|
+
* - allow_clipping: boolean - If clips_children works in the UI element. Otherwise, it won't have any effect (default: true)
|
|
210
|
+
* - clip_offset: Vector [x, y] - Offset from the start of the clipping (default: [0, 0])
|
|
211
|
+
* - clip_state_change_event: string - Event triggered when the clip state changes
|
|
212
|
+
* - enable_scissor_test: boolean - Enables scissor test for clipping (default: false)
|
|
213
|
+
* - 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
|
|
214
|
+
* - selected: boolean - If the text box is selected by default
|
|
215
|
+
* - use_child_anchors: boolean - Use the anchor_from and anchor_to of the child of the UI element (default: false)
|
|
216
|
+
* - controls: array - For adding children to the element
|
|
217
|
+
* - anims: string[] - Array of the animation names
|
|
218
|
+
* - disable_anim_fast_forward: boolean - Disables fast-forwarding animations
|
|
219
|
+
* - animation_reset_name: string - Name of the animation to reset to
|
|
220
|
+
* - ignored: boolean - If the UI element should be ignored (default: false)
|
|
221
|
+
* - variables: array or object - A bunch of conditions that change the variables values
|
|
222
|
+
* - modifications: array - Allows to modify the UI files of resource packs below (vanilla being the most bottom one)
|
|
223
|
+
* - 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
|
|
224
|
+
* - collection_index: int - Index that the control takes in the collection
|
|
225
|
+
*/
|
|
226
|
+
/**
|
|
227
|
+
* Control 类
|
|
228
|
+
*
|
|
229
|
+
* 该类表示一个具有各种属性和方法的 UI 控件元素,用于操作其状态。
|
|
230
|
+
*
|
|
231
|
+
* 属性:
|
|
232
|
+
* - visible: boolean - 控制 UI 元素是否可见(默认值:true)
|
|
233
|
+
* - enabled: boolean - 如果为 true,且 UI 元素或其任何子元素处于锁定状态,则它们将被锁定(默认值:true)
|
|
234
|
+
* - layer: int - 相对于父元素的 Z-Index/层级(类似于 CSS 中的 zindex)。较高的层级将渲染在上方(默认值:0)
|
|
235
|
+
* - alpha: float - 元素的透明度。仅影响 UI 元素本身,其子元素不受影响。如果希望透明度同时应用于父元素和子元素,请使用 propagate_alpha(默认值:1.0)
|
|
236
|
+
* - propagate_alpha: boolean - 透明度是否应同时应用于父元素及其所有子元素(默认值:false)
|
|
237
|
+
* - clips_children: boolean - 是否在视觉上和交互上裁剪超出 UI 元素边界的内容(默认值:false)
|
|
238
|
+
* - allow_clipping: boolean - 是否允许在 UI 元素中启用裁剪。否则,clips_children 将无效(默认值:true)
|
|
239
|
+
* - clip_offset: Vector [x, y] - 裁剪起始点的偏移量(默认值:[0, 0])
|
|
240
|
+
* - clip_state_change_event: string - 裁剪状态更改时触发的事件
|
|
241
|
+
* - enable_scissor_test: boolean - 是否启用裁剪测试(默认值:false)
|
|
242
|
+
* - property_bag: object - 属性包,包含与数据相关的属性/变量,而不是 UI 元素的实际结构和外观
|
|
243
|
+
* - selected: boolean - 文本框是否默认被选中
|
|
244
|
+
* - use_child_anchors: boolean - 是否使用 UI 元素子元素的 anchor_from 和 anchor_to(默认值:false)
|
|
245
|
+
* - controls: array - 用于向元素添加子元素
|
|
246
|
+
* - anims: string[] - 动画名称数组
|
|
247
|
+
* - disable_anim_fast_forward: boolean - 是否禁用动画快进
|
|
248
|
+
* - animation_reset_name: string - 重置动画的名称
|
|
249
|
+
* - ignored: boolean - 是否忽略该 UI 元素(默认值:false)
|
|
250
|
+
* - variables: array 或 object - 一组条件,用于更改变量的值
|
|
251
|
+
* - modifications: array - 允许修改资源包中的 UI 文件(最底层为原版资源包)
|
|
252
|
+
* - grid_position: Vector [row, column] - 控件在网格中的位置。此属性还允许修改硬编码网格中的特定网格项
|
|
253
|
+
* - collection_index: int - 控件在集合中的索引
|
|
254
|
+
*/
|
|
255
|
+
declare class Control {
|
|
11
256
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @param {
|
|
14
|
-
* @
|
|
15
|
-
* @param {string} texture 物品纹理
|
|
16
|
-
* @param {Object} options 可选参数
|
|
17
|
-
* @param {string} options.group 分组
|
|
18
|
-
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
257
|
+
* 设置控件的可见性。
|
|
258
|
+
* @param {boolean} visible - 控件是否可见(默认值:true)
|
|
259
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
19
260
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
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>;
|
|
261
|
+
setVisible(visible?: boolean): Control;
|
|
262
|
+
visible: boolean | undefined;
|
|
30
263
|
/**
|
|
31
|
-
*
|
|
32
|
-
* @param {
|
|
264
|
+
* 设置控件的启用状态。
|
|
265
|
+
* @param {boolean} enabled - 控件是否启用(默认值:true)
|
|
266
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
33
267
|
*/
|
|
34
|
-
|
|
268
|
+
setEnabled(enabled?: boolean): Control;
|
|
269
|
+
enabled: boolean | undefined;
|
|
35
270
|
/**
|
|
36
|
-
*
|
|
37
|
-
* @param {
|
|
271
|
+
* 设置控件的层级(z-index)。
|
|
272
|
+
* @param {number} layer - 要设置的层级(默认值:0)
|
|
273
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
38
274
|
*/
|
|
39
|
-
|
|
275
|
+
setLayer(layer?: number): Control;
|
|
276
|
+
layer: number | undefined;
|
|
40
277
|
/**
|
|
41
|
-
*
|
|
42
|
-
* @
|
|
278
|
+
* 设置控件的透明度。
|
|
279
|
+
* @param {number} alpha - 要设置的透明度值(默认值:1.0)
|
|
280
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
43
281
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
declare class Food extends Item {
|
|
282
|
+
setAlpha(alpha?: number): Control;
|
|
283
|
+
alpha: number | undefined;
|
|
48
284
|
/**
|
|
49
|
-
*
|
|
50
|
-
* @param {
|
|
51
|
-
* @
|
|
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
|
|
285
|
+
* 设置透明度是否应传播到子元素。
|
|
286
|
+
* @param {boolean} propagate - 透明度是否应传播(默认值:false)
|
|
287
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
60
288
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
hide_in_command: boolean;
|
|
64
|
-
animation: string;
|
|
65
|
-
canAlwaysEat: boolean;
|
|
66
|
-
nutrition: number;
|
|
67
|
-
saturationModifier: number;
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
declare class AddonAttachableDescription {
|
|
289
|
+
setPropagateAlpha(propagate?: boolean): Control;
|
|
290
|
+
propagate_alpha: boolean | undefined;
|
|
72
291
|
/**
|
|
73
|
-
*
|
|
74
|
-
* @param {
|
|
292
|
+
* 设置控件是否应裁剪其子元素。
|
|
293
|
+
* @param {boolean} clips - 控件是否应裁剪其子元素(默认值:false)
|
|
294
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
75
295
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
296
|
+
setClipsChildren(clips?: boolean): Control;
|
|
297
|
+
clips_children: boolean | undefined;
|
|
78
298
|
/**
|
|
79
|
-
*
|
|
80
|
-
* @param {
|
|
81
|
-
* @
|
|
82
|
-
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
299
|
+
* 设置控件是否允许裁剪。
|
|
300
|
+
* @param {boolean} allow - 是否允许裁剪(默认值:true)
|
|
301
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
83
302
|
*/
|
|
84
|
-
|
|
85
|
-
|
|
303
|
+
setAllowClipping(allow?: boolean): Control;
|
|
304
|
+
allow_clipping: boolean | undefined;
|
|
86
305
|
/**
|
|
87
|
-
*
|
|
88
|
-
* @param {
|
|
89
|
-
* @
|
|
90
|
-
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
306
|
+
* 设置控件的裁剪偏移量。
|
|
307
|
+
* @param {number[]} offset - 裁剪偏移量,格式为 [x, y](默认值:[0, 0])
|
|
308
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
91
309
|
*/
|
|
92
|
-
|
|
93
|
-
|
|
310
|
+
setClipOffset(offset?: number[]): Control;
|
|
311
|
+
clip_offset: number[] | undefined;
|
|
94
312
|
/**
|
|
95
|
-
*
|
|
96
|
-
* @param {string}
|
|
97
|
-
* @
|
|
98
|
-
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
313
|
+
* 设置裁剪状态更改事件。
|
|
314
|
+
* @param {string} event - 裁剪状态更改时触发的事件名称
|
|
315
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
99
316
|
*/
|
|
100
|
-
|
|
101
|
-
|
|
317
|
+
setClipStateChangeEvent(event: string): Control;
|
|
318
|
+
clip_state_change_event: string | undefined;
|
|
102
319
|
/**
|
|
103
|
-
*
|
|
104
|
-
* @param {
|
|
105
|
-
* @
|
|
106
|
-
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
320
|
+
* 设置是否启用裁剪测试。
|
|
321
|
+
* @param {boolean} enable - 是否启用裁剪测试(默认值:false)
|
|
322
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
107
323
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
324
|
+
setEnableScissorTest(enable?: boolean): Control;
|
|
325
|
+
enable_scissor_test: boolean | undefined;
|
|
110
326
|
/**
|
|
111
|
-
*
|
|
112
|
-
* @param {
|
|
113
|
-
* @
|
|
114
|
-
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
327
|
+
* 设置控件的属性包。
|
|
328
|
+
* @param {object} bag - 要设置的属性包
|
|
329
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
115
330
|
*/
|
|
116
|
-
|
|
117
|
-
|
|
331
|
+
setPropertyBag(bag: object): Control;
|
|
332
|
+
property_bag: object | undefined;
|
|
118
333
|
/**
|
|
119
|
-
*
|
|
120
|
-
* @param {
|
|
121
|
-
* @returns {
|
|
334
|
+
* 设置控件是否被选中。
|
|
335
|
+
* @param {boolean} selected - 控件是否被选中(默认值:false)
|
|
336
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
122
337
|
*/
|
|
123
|
-
|
|
124
|
-
|
|
338
|
+
setSelected(selected?: boolean): Control;
|
|
339
|
+
selected: boolean | undefined;
|
|
125
340
|
/**
|
|
126
|
-
*
|
|
127
|
-
* @param {
|
|
128
|
-
* @
|
|
129
|
-
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
341
|
+
* 设置控件是否使用子元素的锚点。
|
|
342
|
+
* @param {boolean} use - 是否使用子元素的锚点(默认值:false)
|
|
343
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
130
344
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
345
|
+
setUseChildAnchors(use?: boolean): Control;
|
|
346
|
+
use_child_anchors: boolean | undefined;
|
|
133
347
|
/**
|
|
134
|
-
*
|
|
135
|
-
* @param {
|
|
136
|
-
* @
|
|
137
|
-
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
348
|
+
* 向控件添加子控件。
|
|
349
|
+
* @param {Control} control - 要添加的子控件
|
|
350
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
138
351
|
*/
|
|
139
|
-
|
|
140
|
-
|
|
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 {
|
|
352
|
+
addControl(control: Control): Control;
|
|
353
|
+
controls: any[] | undefined;
|
|
191
354
|
/**
|
|
192
|
-
*
|
|
193
|
-
* @param {string}
|
|
194
|
-
* @
|
|
195
|
-
* @param {Array} textures_arr 纹理数组 [上,下,东,西,南,北]
|
|
196
|
-
* @param {Object} options 可选参数
|
|
197
|
-
* @param {string} options.group 分组,默认为 "construction"
|
|
198
|
-
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
355
|
+
* 设置控件的动画。
|
|
356
|
+
* @param {string[]} anims - 动画名称数组
|
|
357
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
199
358
|
*/
|
|
200
|
-
|
|
201
|
-
|
|
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;
|
|
359
|
+
setAnimations(anims: string[]): Control;
|
|
360
|
+
anims: string[] | undefined;
|
|
216
361
|
/**
|
|
217
|
-
*
|
|
218
|
-
* @param {
|
|
362
|
+
* 设置是否禁用动画快进。
|
|
363
|
+
* @param {boolean} disable - 是否禁用动画快进(默认值:false)
|
|
364
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
219
365
|
*/
|
|
220
|
-
|
|
366
|
+
setDisableAnimFastForward(disable?: boolean): Control;
|
|
367
|
+
disable_anim_fast_forward: boolean | undefined;
|
|
221
368
|
/**
|
|
222
|
-
*
|
|
223
|
-
* @param {string}
|
|
369
|
+
* 设置动画重置名称。
|
|
370
|
+
* @param {string} name - 要重置的动画名称
|
|
371
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
224
372
|
*/
|
|
225
|
-
|
|
373
|
+
setAnimationResetName(name: string): Control;
|
|
374
|
+
animation_reset_name: string | undefined;
|
|
226
375
|
/**
|
|
227
|
-
*
|
|
228
|
-
* @param {
|
|
229
|
-
* @
|
|
376
|
+
* 设置是否忽略该控件。
|
|
377
|
+
* @param {boolean} ignored - 是否忽略该控件(默认值:false)
|
|
378
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
230
379
|
*/
|
|
231
|
-
|
|
380
|
+
setIgnored(ignored?: boolean): Control;
|
|
381
|
+
ignored: boolean | undefined;
|
|
232
382
|
/**
|
|
233
|
-
*
|
|
234
|
-
* @
|
|
383
|
+
* 设置控件的变量。
|
|
384
|
+
* @param {object} variables - 要设置的变量
|
|
385
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
235
386
|
*/
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
declare class Block extends BasicBlock {
|
|
387
|
+
setVariables(variables: object): Control;
|
|
388
|
+
variables: object | undefined;
|
|
240
389
|
/**
|
|
241
|
-
*
|
|
242
|
-
* @param {
|
|
243
|
-
* @
|
|
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"
|
|
390
|
+
* 设置控件的修改项。
|
|
391
|
+
* @param {array} modifications - 要设置的修改项
|
|
392
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
251
393
|
*/
|
|
252
|
-
|
|
253
|
-
|
|
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 {
|
|
394
|
+
setModifications(modifications: array): Control;
|
|
395
|
+
modifications: any;
|
|
272
396
|
/**
|
|
273
|
-
*
|
|
274
|
-
* @param {
|
|
275
|
-
* @
|
|
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
|
|
397
|
+
* 设置控件在网格中的位置。
|
|
398
|
+
* @param {number[]} position - 网格位置,格式为 [行, 列]
|
|
399
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
282
400
|
*/
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
hide_in_command: boolean;
|
|
286
|
-
rotationType: string;
|
|
287
|
-
yRotationOffset: number;
|
|
288
|
-
});
|
|
289
|
-
#private;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
declare class GeometryBlock extends BasicBlock {
|
|
401
|
+
setGridPosition(position: number[]): Control;
|
|
402
|
+
grid_position: number[] | undefined;
|
|
293
403
|
/**
|
|
294
|
-
*
|
|
295
|
-
* @param {
|
|
296
|
-
* @
|
|
297
|
-
* @param {string} geometry 模型标识符
|
|
298
|
-
* @param {Object} material_instances 材质实例对象
|
|
299
|
-
* @param {Object} options 可选参数
|
|
404
|
+
* 设置控件在集合中的索引。
|
|
405
|
+
* @param {number} index - 要设置的索引
|
|
406
|
+
* @returns {Control} 返回当前实例以支持链式调用
|
|
300
407
|
*/
|
|
301
|
-
|
|
408
|
+
setCollectionIndex(index: number): Control;
|
|
409
|
+
collection_index: number | undefined;
|
|
302
410
|
}
|
|
303
411
|
|
|
304
|
-
declare class
|
|
305
|
-
constructor(
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
412
|
+
declare class UIElement {
|
|
413
|
+
constructor(name: any, type: any, template: any);
|
|
414
|
+
type: any;
|
|
415
|
+
id: any;
|
|
416
|
+
name: any;
|
|
417
|
+
control: Control;
|
|
418
|
+
properties: Map<any, any>;
|
|
419
|
+
variables: Map<any, any>;
|
|
420
|
+
modifications: any[];
|
|
421
|
+
enableDebug(): this;
|
|
422
|
+
setControl(control: any): this;
|
|
423
|
+
addControl(control: any): this;
|
|
424
|
+
addControls(controls: any): this;
|
|
425
|
+
addVariable(name: any, value: any): this;
|
|
426
|
+
addProp(name: any, value: any): this;
|
|
427
|
+
addModification(modification: any): this;
|
|
428
|
+
serialize(): {
|
|
429
|
+
[x: number]: any;
|
|
312
430
|
};
|
|
313
431
|
}
|
|
432
|
+
/**
|
|
433
|
+
* Modifications
|
|
434
|
+
To modify JSON UI in a non-intrusive way, you can use the modifications property to modify previously existing JSON UI elements from other packs (usually vanilla JSON UI files). Doing this makes sure only necessary parts are modified unless otherwise intended, to improve compatibility with other packs that modify the JSON UI.
|
|
435
|
+
|
|
436
|
+
Modification Description
|
|
437
|
+
insert_back insert at end of array
|
|
438
|
+
insert_front insert at start of array
|
|
439
|
+
insert_after insert after target in array
|
|
440
|
+
insert_before insert before target in array
|
|
441
|
+
move_back move target to end of array
|
|
442
|
+
move_front move target to start of array
|
|
443
|
+
move_after move target after second target
|
|
444
|
+
move_before move target before second target
|
|
445
|
+
swap swap first target with second target
|
|
446
|
+
replace replace first target with second target
|
|
447
|
+
remove remove target
|
|
448
|
+
*/
|
|
449
|
+
declare class Modifications {
|
|
450
|
+
static OPERATION: Readonly<{
|
|
451
|
+
INSERT_BACK: "insert_back";
|
|
452
|
+
INSERT_FRONT: "insert_front";
|
|
453
|
+
INSERT_AFTER: "insert_after";
|
|
454
|
+
INSERT_BEFORE: "insert_before";
|
|
455
|
+
MOVE_BACK: "move_back";
|
|
456
|
+
MOVE_FRONT: "move_front";
|
|
457
|
+
MOVE_AFTER: "move_after";
|
|
458
|
+
MOVE_BEFORE: "move_before";
|
|
459
|
+
SWAP: "swap";
|
|
460
|
+
REPLACE: "replace";
|
|
461
|
+
REMOVE: "remove";
|
|
462
|
+
}>;
|
|
463
|
+
}
|
|
314
464
|
|
|
315
465
|
/**
|
|
316
|
-
*
|
|
466
|
+
* Input 类
|
|
467
|
+
*
|
|
468
|
+
* 该类表示输入配置,用于管理 UI 元素的输入行为。
|
|
469
|
+
*
|
|
470
|
+
* 属性:
|
|
471
|
+
* - button_mappings: Array of mapping objects - 按钮映射配置
|
|
472
|
+
* - modal: boolean - 是否为模态输入
|
|
473
|
+
* - inline_modal: boolean - 是否为内联模态输入
|
|
474
|
+
* - always_listen_to_input: boolean - 是否始终监听输入
|
|
475
|
+
* - always_handle_pointer: boolean - 是否始终处理指针事件
|
|
476
|
+
* - always_handle_controller_direction: boolean - 是否始终处理控制器方向事件
|
|
477
|
+
* - hover_enabled: boolean - 是否启用悬停事件
|
|
478
|
+
* - prevent_touch_input: boolean - 是否阻止触摸输入
|
|
479
|
+
* - consume_event: boolean - 是否消耗事件
|
|
480
|
+
* - consume_hover_events: boolean - 是否消耗悬停事件
|
|
481
|
+
* - gesture_tracking_button: string - 手势跟踪按钮
|
|
317
482
|
*/
|
|
318
|
-
declare class
|
|
319
|
-
filters: any[];
|
|
483
|
+
declare class Input {
|
|
320
484
|
/**
|
|
321
|
-
*
|
|
322
|
-
* @param {
|
|
323
|
-
* @
|
|
324
|
-
* @returns {BiomeFilter} 返回自身以支持链式调用
|
|
485
|
+
* 设置按钮映射配置。
|
|
486
|
+
* @param {ButtonMapping[]} mappings - 按钮映射配置数组
|
|
487
|
+
* @returns {Input} 返回当前实例以支持链式调用
|
|
325
488
|
*/
|
|
326
|
-
|
|
489
|
+
setButtonMappings(mappings: ButtonMapping[]): Input;
|
|
490
|
+
button_mappings: ButtonMapping[] | undefined;
|
|
327
491
|
/**
|
|
328
|
-
*
|
|
329
|
-
* @param {
|
|
330
|
-
* @
|
|
331
|
-
* @param {string} value - 目标值(如 "overworld")
|
|
332
|
-
* @returns {BiomeFilter} 返回自身以支持链式调用
|
|
492
|
+
* 设置是否为模态输入。
|
|
493
|
+
* @param {boolean} modal - 是否为模态输入
|
|
494
|
+
* @returns {Input} 返回当前实例以支持链式调用
|
|
333
495
|
*/
|
|
334
|
-
|
|
496
|
+
setModal(modal?: boolean): Input;
|
|
497
|
+
modal: boolean | undefined;
|
|
335
498
|
/**
|
|
336
|
-
*
|
|
337
|
-
* @
|
|
499
|
+
* 设置是否为内联模态输入。
|
|
500
|
+
* @param {boolean} inlineModal - 是否为内联模态输入
|
|
501
|
+
* @returns {Input} 返回当前实例以支持链式调用
|
|
338
502
|
*/
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* 表示功能规则生成条件的类
|
|
344
|
-
*/
|
|
345
|
-
declare class FeatureConditions {
|
|
346
|
-
conditions: {
|
|
347
|
-
placement_pass: string;
|
|
348
|
-
"minecraft:biome_filter": never[];
|
|
349
|
-
};
|
|
503
|
+
setInlineModal(inlineModal?: boolean): Input;
|
|
504
|
+
inline_modal: boolean | undefined;
|
|
350
505
|
/**
|
|
351
|
-
*
|
|
352
|
-
* @param {
|
|
353
|
-
* @returns {
|
|
506
|
+
* 设置是否始终监听输入。
|
|
507
|
+
* @param {boolean} alwaysListen - 是否始终监听输入
|
|
508
|
+
* @returns {Input} 返回当前实例以支持链式调用
|
|
354
509
|
*/
|
|
355
|
-
|
|
510
|
+
setAlwaysListenToInput(alwaysListen?: boolean): Input;
|
|
511
|
+
always_listen_to_input: boolean | undefined;
|
|
356
512
|
/**
|
|
357
|
-
*
|
|
358
|
-
* @param {
|
|
359
|
-
* @returns {
|
|
513
|
+
* 设置是否始终处理指针事件。
|
|
514
|
+
* @param {boolean} alwaysHandle - 是否始终处理指针事件
|
|
515
|
+
* @returns {Input} 返回当前实例以支持链式调用
|
|
360
516
|
*/
|
|
361
|
-
|
|
517
|
+
setAlwaysHandlePointer(alwaysHandle?: boolean): Input;
|
|
518
|
+
always_handle_pointer: boolean | undefined;
|
|
362
519
|
/**
|
|
363
|
-
*
|
|
364
|
-
* @
|
|
520
|
+
* 设置是否始终处理控制器方向事件。
|
|
521
|
+
* @param {boolean} alwaysHandle - 是否始终处理控制器方向事件
|
|
522
|
+
* @returns {Input} 返回当前实例以支持链式调用
|
|
365
523
|
*/
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* 表示单个坐标轴(x/y/z)分布规则的类
|
|
371
|
-
*/
|
|
372
|
-
declare class CoordinateDistribution {
|
|
524
|
+
setAlwaysHandleControllerDirection(alwaysHandle?: boolean): Input;
|
|
525
|
+
always_handle_controller_direction: boolean | undefined;
|
|
373
526
|
/**
|
|
374
|
-
*
|
|
375
|
-
* @param {
|
|
527
|
+
* 设置是否启用悬停事件。
|
|
528
|
+
* @param {boolean} enabled - 是否启用悬停事件
|
|
529
|
+
* @returns {Input} 返回当前实例以支持链式调用
|
|
376
530
|
*/
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
extent: number[];
|
|
531
|
+
setHoverEnabled(enabled?: boolean): Input;
|
|
532
|
+
hover_enabled: boolean | undefined;
|
|
380
533
|
/**
|
|
381
|
-
*
|
|
382
|
-
* @
|
|
534
|
+
* 设置是否阻止触摸输入。
|
|
535
|
+
* @param {boolean} prevent - 是否阻止触摸输入
|
|
536
|
+
* @returns {Input} 返回当前实例以支持链式调用
|
|
383
537
|
*/
|
|
384
|
-
|
|
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
|
-
};
|
|
538
|
+
setPreventTouchInput(prevent?: boolean): Input;
|
|
539
|
+
prevent_touch_input: boolean | undefined;
|
|
398
540
|
/**
|
|
399
|
-
*
|
|
400
|
-
* @param {
|
|
401
|
-
* @returns {
|
|
541
|
+
* 设置是否消耗事件。
|
|
542
|
+
* @param {boolean} consume - 是否消耗事件
|
|
543
|
+
* @returns {Input} 返回当前实例以支持链式调用
|
|
402
544
|
*/
|
|
403
|
-
|
|
545
|
+
setConsumeEvent(consume?: boolean): Input;
|
|
546
|
+
consume_event: boolean | undefined;
|
|
404
547
|
/**
|
|
405
|
-
*
|
|
406
|
-
* @param {
|
|
407
|
-
* @
|
|
408
|
-
* @returns {FeatureDistribution} 返回自身以支持链式调用
|
|
548
|
+
* 设置是否消耗悬停事件。
|
|
549
|
+
* @param {boolean} consume - 是否消耗悬停事件
|
|
550
|
+
* @returns {Input} 返回当前实例以支持链式调用
|
|
409
551
|
*/
|
|
410
|
-
|
|
552
|
+
setConsumeHoverEvents(consume?: boolean): Input;
|
|
553
|
+
consume_hover_events: boolean | undefined;
|
|
411
554
|
/**
|
|
412
|
-
*
|
|
413
|
-
* @
|
|
555
|
+
* 设置手势跟踪按钮。
|
|
556
|
+
* @param {string} button - 手势跟踪按钮
|
|
557
|
+
* @returns {Input} 返回当前实例以支持链式调用
|
|
414
558
|
*/
|
|
415
|
-
|
|
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;
|
|
559
|
+
setGestureTrackingButton(button: string): Input;
|
|
560
|
+
gesture_tracking_button: string | undefined;
|
|
477
561
|
}
|
|
478
562
|
|
|
479
|
-
|
|
563
|
+
/**
|
|
564
|
+
* Sound 类
|
|
565
|
+
*
|
|
566
|
+
* 该类表示一个声音控件,用于管理声音播放及其相关属性。
|
|
567
|
+
*
|
|
568
|
+
* 属性:
|
|
569
|
+
* - sound_name: string - 声音名称(定义在 RP/sounds/sound_definitions.json 文件中)
|
|
570
|
+
* - sound_volume: float - 声音音量(默认值:1.0)
|
|
571
|
+
* - sound_pitch: float - 声音音调(默认值:1.0)
|
|
572
|
+
* - sounds: Array of sound objects - 触发事件时播放的声音数组
|
|
573
|
+
*/
|
|
574
|
+
declare class Sound {
|
|
480
575
|
/**
|
|
481
|
-
*
|
|
482
|
-
* @param {string}
|
|
483
|
-
* @
|
|
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={}] - 继承的事件
|
|
576
|
+
* 设置声音名称。
|
|
577
|
+
* @param {string} name - 声音名称(定义在 RP/sounds/sound_definitions.json 文件中)
|
|
578
|
+
* @returns {Sound} 返回当前实例以支持链式调用
|
|
491
579
|
*/
|
|
492
|
-
|
|
493
|
-
|
|
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>;
|
|
580
|
+
setSoundName(name: string): Sound;
|
|
581
|
+
sound_name: string | undefined;
|
|
509
582
|
/**
|
|
510
|
-
*
|
|
511
|
-
* @param {
|
|
512
|
-
* @
|
|
513
|
-
* @returns
|
|
583
|
+
* 设置声音音量。
|
|
584
|
+
* @param {number} volume - 音量(范围:0.0 到 1.0,默认值:1.0)
|
|
585
|
+
* @returns {Sound} 返回当前实例以支持链式调用
|
|
514
586
|
*/
|
|
515
|
-
|
|
587
|
+
setSoundVolume(volume?: number): Sound;
|
|
588
|
+
sound_volume: number | undefined;
|
|
516
589
|
/**
|
|
517
|
-
*
|
|
518
|
-
* @param {
|
|
519
|
-
* @returns
|
|
590
|
+
* 设置声音音调。
|
|
591
|
+
* @param {number} pitch - 音调(默认值:1.0)
|
|
592
|
+
* @returns {Sound} 返回当前实例以支持链式调用
|
|
520
593
|
*/
|
|
521
|
-
|
|
594
|
+
setSoundPitch(pitch?: number): Sound;
|
|
595
|
+
sound_pitch: number | undefined;
|
|
522
596
|
/**
|
|
523
|
-
*
|
|
524
|
-
* @
|
|
597
|
+
* 设置触发事件时播放的声音数组。
|
|
598
|
+
* @param {object[]} sounds - 声音对象数组
|
|
599
|
+
* @returns {Sound} 返回当前实例以支持链式调用
|
|
525
600
|
*/
|
|
526
|
-
|
|
601
|
+
setSounds(sounds: object[]): Sound;
|
|
602
|
+
sounds: object[] | undefined;
|
|
527
603
|
/**
|
|
528
|
-
*
|
|
529
|
-
* @param {
|
|
530
|
-
* @
|
|
531
|
-
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
604
|
+
* 添加一个声音对象到声音数组。
|
|
605
|
+
* @param {object} sound - 声音对象
|
|
606
|
+
* @returns {Sound} 返回当前实例以支持链式调用
|
|
532
607
|
*/
|
|
533
|
-
|
|
608
|
+
addSound(sound: object): Sound;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Layout 类
|
|
613
|
+
*
|
|
614
|
+
* 该类表示一个具有各种属性和方法的 UI 布局元素,用于操作其布局和大小。
|
|
615
|
+
*
|
|
616
|
+
* 属性:
|
|
617
|
+
* - size: Vector [width, height] - UI 元素的大小(默认值:["default", "default"])
|
|
618
|
+
* - max_size: Vector [width, height] - UI 元素的最大大小(默认值:["default", "default"])
|
|
619
|
+
* - min_size: Vector [width, height] - UI 元素的最小大小(默认值:["default", "default"])
|
|
620
|
+
* - offset: Vector [x, y] - UI 元素相对于父元素的位置(默认值:[0, 0])
|
|
621
|
+
* - anchor_from: enum - 父元素中的锚点(默认值:center)
|
|
622
|
+
* - anchor_to: enum - 元素自身的锚点(默认值:center)
|
|
623
|
+
* - inherit_max_sibling_width: boolean - 是否使用兄弟元素的最大宽度(默认值:false)
|
|
624
|
+
* - inherit_max_sibling_height: boolean - 是否使用兄弟元素的最大高度(默认值:false)
|
|
625
|
+
* - use_anchored_offset: boolean - 是否使用基于锚点的偏移(默认值:false)
|
|
626
|
+
* - contained: boolean - 是否限制元素在父元素边界内(默认值:false)
|
|
627
|
+
* - draggable: enum - 是否使元素可拖动(可能值:vertical, horizontal, both)
|
|
628
|
+
* - follows_cursor: boolean - 是否使元素跟随光标(默认值:false)
|
|
629
|
+
*/
|
|
630
|
+
declare class Layout {
|
|
534
631
|
/**
|
|
535
|
-
*
|
|
536
|
-
* @param {
|
|
537
|
-
* @returns {
|
|
632
|
+
* 设置 UI 元素的大小。
|
|
633
|
+
* @param {any[]} size - 大小,格式为 [width, height](默认值:["default", "default"])
|
|
634
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
538
635
|
*/
|
|
539
|
-
|
|
636
|
+
setSize(size?: any[]): Layout;
|
|
637
|
+
size: any[] | undefined;
|
|
540
638
|
/**
|
|
541
|
-
*
|
|
542
|
-
* @
|
|
639
|
+
* 设置 UI 元素的最大大小。
|
|
640
|
+
* @param {string[]} maxSize - 最大大小,格式为 [width, height](默认值:["default", "default"])
|
|
641
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
543
642
|
*/
|
|
544
|
-
|
|
643
|
+
setMaxSize(maxSize?: string[]): Layout;
|
|
644
|
+
max_size: string[] | undefined;
|
|
545
645
|
/**
|
|
546
|
-
*
|
|
547
|
-
* @param {string}
|
|
548
|
-
* @
|
|
549
|
-
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
646
|
+
* 设置 UI 元素的最小大小。
|
|
647
|
+
* @param {string[]} minSize - 最小大小,格式为 [width, height](默认值:["default", "default"])
|
|
648
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
550
649
|
*/
|
|
551
|
-
|
|
650
|
+
setMinSize(minSize?: string[]): Layout;
|
|
651
|
+
min_size: string[] | undefined;
|
|
552
652
|
/**
|
|
553
|
-
*
|
|
554
|
-
* @param {
|
|
555
|
-
* @returns {
|
|
653
|
+
* 设置 UI 元素相对于父元素的位置。
|
|
654
|
+
* @param {number[]} offset - 偏移量,格式为 [x, y](默认值:[0, 0])
|
|
655
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
556
656
|
*/
|
|
557
|
-
|
|
657
|
+
setOffset(offset?: number[]): Layout;
|
|
658
|
+
offset: number[] | undefined;
|
|
558
659
|
/**
|
|
559
|
-
*
|
|
560
|
-
* @
|
|
660
|
+
* 设置父元素中的锚点。
|
|
661
|
+
* @param {string} anchorFrom - 锚点(可能值:top_left, top_middle, top_right, left_middle, center, right_middle, bottom_left, bottom_middle, bottom_right)(默认值:center)
|
|
662
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
561
663
|
*/
|
|
562
|
-
|
|
664
|
+
setAnchorFrom(anchorFrom?: string): Layout;
|
|
665
|
+
anchor_from: string | undefined;
|
|
563
666
|
/**
|
|
564
|
-
*
|
|
565
|
-
* @param {
|
|
566
|
-
* @returns {
|
|
667
|
+
* 设置元素自身的锚点。
|
|
668
|
+
* @param {string} anchorTo - 锚点(可能值:top_left, top_middle, top_right, left_middle, center, right_middle, bottom_left, bottom_middle, bottom_right)(默认值:center)
|
|
669
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
567
670
|
*/
|
|
568
|
-
|
|
671
|
+
setAnchorTo(anchorTo?: string): Layout;
|
|
672
|
+
anchor_to: string | undefined;
|
|
569
673
|
/**
|
|
570
|
-
*
|
|
571
|
-
* @param {
|
|
572
|
-
* @returns {
|
|
674
|
+
* 设置是否使用兄弟元素的最大宽度。
|
|
675
|
+
* @param {boolean} inherit - 是否使用兄弟元素的最大宽度(默认值:false)
|
|
676
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
573
677
|
*/
|
|
574
|
-
|
|
678
|
+
setInheritMaxSiblingWidth(inherit?: boolean): Layout;
|
|
679
|
+
inherit_max_sibling_width: boolean | undefined;
|
|
575
680
|
/**
|
|
576
|
-
*
|
|
577
|
-
* @
|
|
681
|
+
* 设置是否使用兄弟元素的最大高度。
|
|
682
|
+
* @param {boolean} inherit - 是否使用兄弟元素的最大高度(默认值:false)
|
|
683
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
578
684
|
*/
|
|
579
|
-
|
|
685
|
+
setInheritMaxSiblingHeight(inherit?: boolean): Layout;
|
|
686
|
+
inherit_max_sibling_height: boolean | undefined;
|
|
580
687
|
/**
|
|
581
|
-
*
|
|
688
|
+
* 设置是否使用基于锚点的偏移。
|
|
689
|
+
* @param {boolean} use - 是否使用基于锚点的偏移(默认值:false)
|
|
690
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
582
691
|
*/
|
|
583
|
-
|
|
692
|
+
setUseAnchoredOffset(use?: boolean): Layout;
|
|
693
|
+
use_anchored_offset: boolean | undefined;
|
|
584
694
|
/**
|
|
585
|
-
*
|
|
586
|
-
* @
|
|
695
|
+
* 设置是否限制元素在父元素边界内。
|
|
696
|
+
* @param {boolean} contained - 是否限制元素在父元素边界内(默认值:false)
|
|
697
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
587
698
|
*/
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
declare class AddonClientEntityDescription {
|
|
699
|
+
setContained(contained?: boolean): Layout;
|
|
700
|
+
contained: boolean | undefined;
|
|
592
701
|
/**
|
|
593
|
-
*
|
|
594
|
-
* @param {string}
|
|
595
|
-
* @
|
|
702
|
+
* 设置是否使元素可拖动。
|
|
703
|
+
* @param {string} draggable - 是否使元素可拖动(可能值:vertical, horizontal, both)
|
|
704
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
596
705
|
*/
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
min_engine_version: string;
|
|
706
|
+
setDraggable(draggable: string): Layout;
|
|
707
|
+
draggable: string | undefined;
|
|
600
708
|
/**
|
|
601
|
-
*
|
|
602
|
-
* @param {
|
|
603
|
-
* @
|
|
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} 返回当前实例以支持链式调用
|
|
709
|
+
* 设置是否使元素跟随光标。
|
|
710
|
+
* @param {boolean} follows - 是否使元素跟随光标(默认值:false)
|
|
711
|
+
* @returns {Layout} 返回当前实例以支持链式调用
|
|
613
712
|
*/
|
|
614
|
-
|
|
615
|
-
|
|
713
|
+
setFollowsCursor(follows?: boolean): Layout;
|
|
714
|
+
follows_cursor: boolean | undefined;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
declare class DataBinding {
|
|
718
|
+
setBinding(binding: any): this;
|
|
719
|
+
bindings: any[] | undefined;
|
|
720
|
+
binding: any;
|
|
721
|
+
addDataBinding(dataBindingObject: any): this;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Factory 类
|
|
726
|
+
*
|
|
727
|
+
* 该类表示一个工厂控件,用于管理子控件的名称和 ID。
|
|
728
|
+
*
|
|
729
|
+
* 属性:
|
|
730
|
+
* - control_name: string - 工厂的子控件名
|
|
731
|
+
* - control_ids: object - 工厂的子控件 ID 对象组
|
|
732
|
+
*/
|
|
733
|
+
declare class Factory {
|
|
616
734
|
/**
|
|
617
|
-
*
|
|
618
|
-
* @param {string} name
|
|
619
|
-
* @
|
|
620
|
-
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
735
|
+
* 设置工厂的名。
|
|
736
|
+
* @param {string} name - 名(格式:name)
|
|
737
|
+
* @returns {Factory} 返回当前实例以支持链式调用
|
|
621
738
|
*/
|
|
622
|
-
|
|
623
|
-
|
|
739
|
+
setName(name: string): Factory;
|
|
740
|
+
factory: {} | undefined;
|
|
624
741
|
/**
|
|
625
|
-
*
|
|
626
|
-
* @param {string} name
|
|
627
|
-
* @
|
|
628
|
-
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
742
|
+
* 设置工厂的子控件名。
|
|
743
|
+
* @param {string} name - 子控件名(格式:namespace.controls_name)
|
|
744
|
+
* @returns {Factory} 返回当前实例以支持链式调用
|
|
629
745
|
*/
|
|
630
|
-
|
|
631
|
-
animations: {} | undefined;
|
|
746
|
+
setControlName(name: string): Factory;
|
|
632
747
|
/**
|
|
633
|
-
*
|
|
634
|
-
* @param {
|
|
635
|
-
* @
|
|
636
|
-
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
748
|
+
* 设置工厂的子控件 ID 对象组。
|
|
749
|
+
* @param {object} ids - 子控件 ID 对象组
|
|
750
|
+
* @returns {Factory} 返回当前实例以支持链式调用
|
|
637
751
|
*/
|
|
638
|
-
|
|
639
|
-
animation_controllers: any[] | undefined;
|
|
752
|
+
setControlIds(ids: object): Factory;
|
|
640
753
|
/**
|
|
641
|
-
*
|
|
642
|
-
* @param {string}
|
|
643
|
-
* @
|
|
754
|
+
* 添加一个子控件 ID。
|
|
755
|
+
* @param {string} key - 子控件的键名
|
|
756
|
+
* @param {string} value - 子控件的 ID 值
|
|
757
|
+
* @returns {Factory} 返回当前实例以支持链式调用
|
|
644
758
|
*/
|
|
645
|
-
|
|
646
|
-
|
|
759
|
+
addControlId(key: string, value: string): Factory;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
declare class Button extends UIElement {
|
|
763
|
+
constructor(id: any, template: any);
|
|
764
|
+
input: Input;
|
|
765
|
+
sound: Sound;
|
|
766
|
+
layout: Layout;
|
|
767
|
+
dataBinding: DataBinding;
|
|
768
|
+
factory: Factory;
|
|
769
|
+
setDefaultControl(default_control: any): this;
|
|
770
|
+
setHoverControl(hover_control: any): this;
|
|
771
|
+
setPressedControl(pressed_control: any): this;
|
|
772
|
+
setLockedControl(locked_control: any): this;
|
|
773
|
+
setInput(input: any): this;
|
|
774
|
+
setSound(sound: any): this;
|
|
775
|
+
setLayout(layout: any): this;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
declare class CollectionPanel extends UIElement {
|
|
779
|
+
constructor(id: any, template: any);
|
|
780
|
+
layout: Layout;
|
|
781
|
+
dataBinding: DataBinding;
|
|
782
|
+
factory: Factory;
|
|
783
|
+
setCollectionName(collection_name: any): this;
|
|
784
|
+
setLayout(layout: any): this;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Grid 类
|
|
789
|
+
*
|
|
790
|
+
* 该类表示一个网格控件属性,用于管理网格布局及其相关属性。
|
|
791
|
+
*
|
|
792
|
+
* 属性:
|
|
793
|
+
* - grid_dimensions: Vector [columns, rows] - 网格的列数和行数
|
|
794
|
+
* - maximum_grid_items: int - 网格生成的最大项目数
|
|
795
|
+
* - grid_dimension_binding: string - 网格尺寸的绑定名称
|
|
796
|
+
* - grid_rescaling_type: enum - 网格重新缩放方向(可能值:vertical, horizontal, none,默认值:none)
|
|
797
|
+
* - grid_fill_direction: enum - 网格填充方向(可能值:vertical, horizontal, none,默认值:none)
|
|
798
|
+
* - grid_item_template: string - 处理集合的子元素名称(例如:"common.container_item")
|
|
799
|
+
* - precached_grid_item_count: int - 预缓存的网格项目数量
|
|
800
|
+
*/
|
|
801
|
+
declare class GridProp {
|
|
647
802
|
/**
|
|
648
|
-
*
|
|
649
|
-
* @param {
|
|
650
|
-
* @
|
|
651
|
-
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
803
|
+
* 设置网格的列数和行数。
|
|
804
|
+
* @param {number[]} dimensions - 格式为 [columns, rows]
|
|
805
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
652
806
|
*/
|
|
653
|
-
|
|
654
|
-
|
|
807
|
+
setGridDimensions(dimensions: number[]): GridProp;
|
|
808
|
+
grid_dimensions: number[] | undefined;
|
|
655
809
|
/**
|
|
656
|
-
*
|
|
657
|
-
* @param {
|
|
658
|
-
* @
|
|
659
|
-
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
810
|
+
* 设置网格生成的最大项目数。
|
|
811
|
+
* @param {number} maxItems - 最大项目数
|
|
812
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
660
813
|
*/
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
texture: string;
|
|
664
|
-
texture_index: number;
|
|
665
|
-
} | undefined;
|
|
814
|
+
setMaximumGridItems(maxItems: number): GridProp;
|
|
815
|
+
maximum_grid_items: number | undefined;
|
|
666
816
|
/**
|
|
667
|
-
*
|
|
668
|
-
* @param {string}
|
|
669
|
-
* @
|
|
670
|
-
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
817
|
+
* 设置网格尺寸的绑定名称。
|
|
818
|
+
* @param {string} binding - 绑定名称
|
|
819
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
671
820
|
*/
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
/**
|
|
677
|
-
* ClientEntity 类,用于表示客户端实体。
|
|
678
|
-
* 继承自 AddonClientEntityDescription,并扩展了实体的数据加载和 JSON 序列化功能。
|
|
679
|
-
*/
|
|
680
|
-
declare class ClientEntity extends AddonClientEntityDescription {
|
|
821
|
+
setGridDimensionBinding(binding: string): GridProp;
|
|
822
|
+
grid_dimension_binding: string | undefined;
|
|
681
823
|
/**
|
|
682
|
-
*
|
|
683
|
-
*
|
|
684
|
-
* @
|
|
685
|
-
* @param {Object} data - 实体的初始数据,默认为空对象。
|
|
824
|
+
* 设置网格重新缩放方向。
|
|
825
|
+
* @param {string} type - 可能值:vertical, horizontal, none(默认值:none)
|
|
826
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
686
827
|
*/
|
|
687
|
-
|
|
828
|
+
setGridRescalingType(type?: string): GridProp;
|
|
829
|
+
grid_rescaling_type: string | undefined;
|
|
688
830
|
/**
|
|
689
|
-
*
|
|
690
|
-
*
|
|
691
|
-
* @returns {
|
|
831
|
+
* 设置网格填充方向。
|
|
832
|
+
* @param {string} direction - 可能值:vertical, horizontal, none(默认值:none)
|
|
833
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
692
834
|
*/
|
|
693
|
-
|
|
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 {
|
|
835
|
+
setGridFillDirection(direction?: string): GridProp;
|
|
836
|
+
grid_fill_direction: string | undefined;
|
|
725
837
|
/**
|
|
726
|
-
*
|
|
727
|
-
* @param {
|
|
838
|
+
* 设置处理集合的子元素名称。
|
|
839
|
+
* @param {string} template - 元素名称(例如:"common.container_item")
|
|
840
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
728
841
|
*/
|
|
729
|
-
|
|
730
|
-
|
|
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 {
|
|
842
|
+
setGridItemTemplate(template: string): GridProp;
|
|
843
|
+
grid_item_template: string | undefined;
|
|
739
844
|
/**
|
|
740
|
-
*
|
|
741
|
-
* @param {
|
|
845
|
+
* 设置预缓存的网格项目数量。
|
|
846
|
+
* @param {number} count - 预缓存数量
|
|
847
|
+
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
742
848
|
*/
|
|
743
|
-
|
|
744
|
-
|
|
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);
|
|
849
|
+
setPrecachedGridItemCount(count: number): GridProp;
|
|
850
|
+
precached_grid_item_count: number | undefined;
|
|
753
851
|
}
|
|
754
852
|
|
|
755
|
-
declare class
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
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);
|
|
853
|
+
declare class Grid extends CollectionPanel {
|
|
854
|
+
gridNum: number;
|
|
855
|
+
grid: GridProp;
|
|
856
|
+
setGridProp(grid_prop: any): this;
|
|
857
|
+
addGridItem(grid_position: any, content: any): this;
|
|
768
858
|
}
|
|
769
859
|
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
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>;
|
|
860
|
+
/**
|
|
861
|
+
* Sprite 类
|
|
862
|
+
*
|
|
863
|
+
* 该类表示一个 Sprite 控件,用于管理图像纹理及其相关属性。
|
|
864
|
+
*
|
|
865
|
+
* 属性:
|
|
866
|
+
* - texture: string - 图像路径(从包根目录开始,例如:"textures/ui/White")
|
|
867
|
+
* - allow_debug_missing_texture: boolean - 是否在纹理未找到时显示缺失纹理(默认值:true)
|
|
868
|
+
* - uv: Vector [u, v] - 纹理映射的起始位置
|
|
869
|
+
* - uv_size: Vector [width, height] - 纹理映射的大小
|
|
870
|
+
* - texture_file_system: string - 纹理来源(默认值:InUserPackage)
|
|
871
|
+
* - nineslice_size: int or Vector [x0, y0, x1, y1] - 9-slice 分割大小
|
|
872
|
+
* - tiled: boolean or enum - 是否平铺纹理(可能值:true/false, x, y)
|
|
873
|
+
* - tiled_scale: Vector [sX, sY] - 平铺纹理的缩放比例(默认值:false)
|
|
874
|
+
* - clip_direction: enum - 裁剪方向的起始点(可能值:left, right, up, down, center)
|
|
875
|
+
* - clip_ratio: float - 裁剪比例(范围:0.0 到 1.0)
|
|
876
|
+
* - clip_pixelperfect: boolean - 是否尽可能保持像素精确裁剪
|
|
877
|
+
* - keep_ratio: boolean - 是否在调整大小时保持比例(默认值:true)
|
|
878
|
+
* - bilinear: boolean - 是否在调整大小时使用双线性函数(默认值:false)
|
|
879
|
+
* - fill: boolean - 是否拉伸图像以适应大小(默认值:false)
|
|
880
|
+
* - $fit_to_width: boolean - 是否适应宽度
|
|
881
|
+
* - zip_folder: string - 压缩文件夹路径
|
|
882
|
+
* - grayscale: boolean - 是否以黑白渲染图像(默认值:false)
|
|
883
|
+
* - force_texture_reload: boolean - 是否在纹理路径更改时强制重新加载图像
|
|
884
|
+
* - base_size: Vector [width, height] - 基础大小
|
|
885
|
+
*/
|
|
886
|
+
declare class Sprite {
|
|
823
887
|
/**
|
|
824
|
-
*
|
|
825
|
-
* @param {
|
|
826
|
-
* @
|
|
827
|
-
* @returns {Map} - 新的组件集合。
|
|
888
|
+
* 设置图像纹理路径。
|
|
889
|
+
* @param {string} texture - 图像路径(例如:"textures/ui/White")
|
|
890
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
828
891
|
*/
|
|
829
|
-
|
|
892
|
+
setTexture(texture: string): Sprite;
|
|
893
|
+
texture: string | undefined;
|
|
830
894
|
/**
|
|
831
|
-
*
|
|
832
|
-
* @param {
|
|
833
|
-
* @returns {
|
|
895
|
+
* 设置是否在纹理未找到时显示缺失纹理。
|
|
896
|
+
* @param {boolean} allow - 是否显示缺失纹理(默认值:true)
|
|
897
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
834
898
|
*/
|
|
835
|
-
|
|
899
|
+
setAllowDebugMissingTexture(allow?: boolean): Sprite;
|
|
900
|
+
allow_debug_missing_texture: boolean | undefined;
|
|
836
901
|
/**
|
|
837
|
-
*
|
|
838
|
-
* @param {
|
|
839
|
-
* @returns {
|
|
902
|
+
* 设置纹理映射的起始位置。
|
|
903
|
+
* @param {number[]} uv - 起始位置,格式为 [u, v]
|
|
904
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
840
905
|
*/
|
|
841
|
-
|
|
906
|
+
setUV(uv: number[]): Sprite;
|
|
907
|
+
uv: number[] | undefined;
|
|
842
908
|
/**
|
|
843
|
-
*
|
|
844
|
-
* @param {
|
|
845
|
-
* @returns {
|
|
909
|
+
* 设置纹理映射的大小。
|
|
910
|
+
* @param {number[]} uvSize - 大小,格式为 [width, height]
|
|
911
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
846
912
|
*/
|
|
847
|
-
|
|
913
|
+
setUVSize(uvSize: number[]): Sprite;
|
|
914
|
+
uv_size: number[] | undefined;
|
|
848
915
|
/**
|
|
849
|
-
*
|
|
850
|
-
* @param {
|
|
851
|
-
* @
|
|
852
|
-
* @returns {Map} - 新的组件集合。
|
|
916
|
+
* 设置纹理来源。
|
|
917
|
+
* @param {string} source - 纹理来源(可能值:InUserPackage, InAppPackage, RawPath, RawPersistent, InSettingsDir, InExternalDir, InServerPackage, InDataDir, InUserDir, InWorldDir, StoreCache, Usage is Unknown)
|
|
918
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
853
919
|
*/
|
|
854
|
-
|
|
920
|
+
setTextureFileSystem(source?: string): Sprite;
|
|
921
|
+
texture_file_system: string | undefined;
|
|
855
922
|
/**
|
|
856
|
-
*
|
|
857
|
-
* @param {
|
|
858
|
-
* @returns {
|
|
923
|
+
* 设置 9-slice 分割大小。
|
|
924
|
+
* @param {number|number[]} size - 9-slice 分割大小(可以是单个数字或 [x0, y0, x1, y1] 数组)
|
|
925
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
859
926
|
*/
|
|
860
|
-
|
|
927
|
+
setNineSliceSize(size: number | number[]): Sprite;
|
|
928
|
+
nineslice_size: number | number[] | undefined;
|
|
861
929
|
/**
|
|
862
|
-
*
|
|
863
|
-
* @param {
|
|
864
|
-
* @returns {
|
|
930
|
+
* 设置是否平铺纹理。
|
|
931
|
+
* @param {boolean|string} tiled - 是否平铺纹理(可能值:true/false, x, y)
|
|
932
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
865
933
|
*/
|
|
866
|
-
|
|
934
|
+
setTiled(tiled: boolean | string): Sprite;
|
|
935
|
+
tiled: string | boolean | undefined;
|
|
867
936
|
/**
|
|
868
|
-
*
|
|
869
|
-
* @param {
|
|
870
|
-
* @
|
|
871
|
-
* @returns {Map} - 新的组件集合。
|
|
937
|
+
* 设置平铺纹理的缩放比例。
|
|
938
|
+
* @param {number[]} scale - 缩放比例,格式为 [sX, sY](默认值:[1, 1])
|
|
939
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
872
940
|
*/
|
|
873
|
-
|
|
941
|
+
setTiledScale(scale?: number[]): Sprite;
|
|
942
|
+
tiled_scale: number[] | undefined;
|
|
874
943
|
/**
|
|
875
|
-
*
|
|
876
|
-
* @param {
|
|
877
|
-
* @returns {
|
|
944
|
+
* 设置裁剪方向的起始点。
|
|
945
|
+
* @param {string} direction - 裁剪方向(可能值:left, right, up, down, center)
|
|
946
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
878
947
|
*/
|
|
879
|
-
|
|
948
|
+
setClipDirection(direction: string): Sprite;
|
|
949
|
+
clip_direction: string | undefined;
|
|
880
950
|
/**
|
|
881
|
-
*
|
|
882
|
-
* @param {
|
|
883
|
-
* @
|
|
884
|
-
* @returns {Map} - 新的组件集合。
|
|
951
|
+
* 设置裁剪比例。
|
|
952
|
+
* @param {number} ratio - 裁剪比例(范围:0.0 到 1.0)
|
|
953
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
885
954
|
*/
|
|
886
|
-
|
|
955
|
+
setClipRatio(ratio: number): Sprite;
|
|
956
|
+
clip_ratio: number | undefined;
|
|
887
957
|
/**
|
|
888
|
-
*
|
|
889
|
-
* @param {
|
|
890
|
-
* @
|
|
891
|
-
* @returns {Map} - 新的组件集合。
|
|
958
|
+
* 设置是否尽可能保持像素精确裁剪。
|
|
959
|
+
* @param {boolean} pixelPerfect - 是否保持像素精确裁剪
|
|
960
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
892
961
|
*/
|
|
893
|
-
|
|
962
|
+
setClipPixelPerfect(pixelPerfect?: boolean): Sprite;
|
|
963
|
+
clip_pixelperfect: boolean | undefined;
|
|
894
964
|
/**
|
|
895
|
-
*
|
|
896
|
-
* @param {
|
|
897
|
-
* @returns {
|
|
965
|
+
* 设置是否在调整大小时保持比例。
|
|
966
|
+
* @param {boolean} keep - 是否保持比例(默认值:true)
|
|
967
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
898
968
|
*/
|
|
899
|
-
|
|
969
|
+
setKeepRatio(keep?: boolean): Sprite;
|
|
970
|
+
keep_ratio: boolean | undefined;
|
|
900
971
|
/**
|
|
901
|
-
*
|
|
902
|
-
* @param {
|
|
903
|
-
* @returns {
|
|
972
|
+
* 设置是否在调整大小时使用双线性函数。
|
|
973
|
+
* @param {boolean} bilinear - 是否使用双线性函数(默认值:false)
|
|
974
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
904
975
|
*/
|
|
905
|
-
|
|
976
|
+
setBilinear(bilinear?: boolean): Sprite;
|
|
977
|
+
bilinear: boolean | undefined;
|
|
906
978
|
/**
|
|
907
|
-
*
|
|
908
|
-
* @param {
|
|
909
|
-
* @
|
|
910
|
-
* @param {String} onLiquidTouches - 对液体的反应方式。
|
|
911
|
-
* @param {Array} stopsLiquidFlowingFromDirection - 阻止液体流动的方向。
|
|
912
|
-
* @returns {Map} - 新的组件集合。
|
|
979
|
+
* 设置是否拉伸图像以适应大小。
|
|
980
|
+
* @param {boolean} fill - 是否拉伸图像(默认值:false)
|
|
981
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
913
982
|
*/
|
|
914
|
-
|
|
983
|
+
setFill(fill?: boolean): Sprite;
|
|
984
|
+
fill: boolean | undefined;
|
|
915
985
|
/**
|
|
916
|
-
*
|
|
917
|
-
* @param {
|
|
918
|
-
* @returns {
|
|
986
|
+
* 设置是否适应宽度。
|
|
987
|
+
* @param {boolean} fit - 是否适应宽度
|
|
988
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
919
989
|
*/
|
|
920
|
-
|
|
990
|
+
setFitToWidth(fit?: boolean): Sprite;
|
|
991
|
+
$fit_to_width: boolean | undefined;
|
|
921
992
|
/**
|
|
922
|
-
*
|
|
923
|
-
* @param {
|
|
924
|
-
* @returns {
|
|
993
|
+
* 设置压缩文件夹路径。
|
|
994
|
+
* @param {string} folder - 压缩文件夹路径
|
|
995
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
925
996
|
*/
|
|
926
|
-
|
|
997
|
+
setZipFolder(folder: string): Sprite;
|
|
998
|
+
zip_folder: string | undefined;
|
|
927
999
|
/**
|
|
928
|
-
*
|
|
929
|
-
* @param {
|
|
930
|
-
* @returns {
|
|
1000
|
+
* 设置是否以黑白渲染图像。
|
|
1001
|
+
* @param {boolean} grayscale - 是否以黑白渲染图像(默认值:false)
|
|
1002
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
931
1003
|
*/
|
|
932
|
-
|
|
1004
|
+
setGrayscale(grayscale?: boolean): Sprite;
|
|
1005
|
+
grayscale: boolean | undefined;
|
|
933
1006
|
/**
|
|
934
|
-
*
|
|
935
|
-
* @param {
|
|
936
|
-
* @returns {
|
|
1007
|
+
* 设置是否在纹理路径更改时强制重新加载图像。
|
|
1008
|
+
* @param {boolean} force - 是否强制重新加载图像
|
|
1009
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
937
1010
|
*/
|
|
938
|
-
|
|
1011
|
+
setForceTextureReload(force?: boolean): Sprite;
|
|
1012
|
+
force_texture_reload: boolean | undefined;
|
|
939
1013
|
/**
|
|
940
|
-
*
|
|
941
|
-
* @param {
|
|
942
|
-
* @
|
|
943
|
-
* @returns {Map} - 新的组件集合。
|
|
1014
|
+
* 设置基础大小。
|
|
1015
|
+
* @param {number[]} size - 基础大小,格式为 [width, height]
|
|
1016
|
+
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
944
1017
|
*/
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
1018
|
+
setBaseSize(size: number[]): Sprite;
|
|
1019
|
+
base_size: number[] | undefined;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
declare class Image extends UIElement {
|
|
1023
|
+
constructor(id: any, template: any);
|
|
1024
|
+
sprite: Sprite;
|
|
1025
|
+
layout: Layout;
|
|
1026
|
+
dataBinding: DataBinding;
|
|
1027
|
+
factory: Factory;
|
|
1028
|
+
setSprite(sprite: any): this;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* Text 类
|
|
1033
|
+
*
|
|
1034
|
+
* 该类表示一个文本控件,用于管理文本内容及其样式属性。
|
|
1035
|
+
*
|
|
1036
|
+
* 属性:
|
|
1037
|
+
* - text: string - 文本内容(默认值:空字符串)
|
|
1038
|
+
* - color: Vector [r, g, b] - 文本颜色(RGB 值,范围 0.0 到 1.0,默认值:[1.0, 1.0, 1.0])
|
|
1039
|
+
* - locked_color: Vector [r, g, b] - 父级禁用时的文本颜色
|
|
1040
|
+
* - shadow: boolean - 是否显示文本阴影(默认值:false)
|
|
1041
|
+
* - hide_hyphen: boolean - 是否隐藏断词连字符(默认值:false)
|
|
1042
|
+
* - notify_on_ellipses: string[] - 文本出现省略号时需通知的控件名称数组
|
|
1043
|
+
* - enable_profanity_filter: boolean - 是否启用脏话过滤(默认值:false)
|
|
1044
|
+
* - locked_alpha: float - 父级禁用时的透明度
|
|
1045
|
+
* - font_size: enum - 字体大小(可能值:small, normal, large, extra_large,默认值:normal)
|
|
1046
|
+
* - font_scale_factor: float - 字体缩放比例(默认值:1.0)
|
|
1047
|
+
* - localize: boolean - 是否启用本地化翻译(默认值:false)
|
|
1048
|
+
* - line_padding: number - 行间距
|
|
1049
|
+
* - font_type: enum - 字体类型(可能值:default, rune, unicode, smooth, MinecraftTen 或自定义字体,默认值:default)
|
|
1050
|
+
* - backup_font_type: enum - 备用字体类型(默认值:default)
|
|
1051
|
+
* - text_alignment: enum - 文本对齐方式(未定义时根据 anchor_from 和 anchor_to 自动调整)
|
|
1052
|
+
*/
|
|
1053
|
+
declare class Text {
|
|
952
1054
|
/**
|
|
953
|
-
*
|
|
954
|
-
* @param {
|
|
955
|
-
* @
|
|
956
|
-
* @returns {Map} - 新的组件集合。
|
|
1055
|
+
* 设置文本内容。
|
|
1056
|
+
* @param {string} text - 文本内容
|
|
1057
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
957
1058
|
*/
|
|
958
|
-
|
|
1059
|
+
setText(text?: string): Text;
|
|
1060
|
+
text: string | undefined;
|
|
959
1061
|
/**
|
|
960
|
-
*
|
|
961
|
-
* @param {
|
|
962
|
-
* @returns {
|
|
1062
|
+
* 设置文本颜色。
|
|
1063
|
+
* @param {number[]} color - RGB 颜色值(格式:[r, g, b],默认值:[1.0, 1.0, 1.0])
|
|
1064
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
963
1065
|
*/
|
|
964
|
-
|
|
1066
|
+
setColor(color?: number[]): Text;
|
|
1067
|
+
color: number[] | undefined;
|
|
965
1068
|
/**
|
|
966
|
-
*
|
|
967
|
-
* @param {
|
|
968
|
-
* @returns {
|
|
1069
|
+
* 设置父级禁用时的文本颜色。
|
|
1070
|
+
* @param {number[]} lockedColor - RGB 颜色值(格式:[r, g, b])
|
|
1071
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
969
1072
|
*/
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
declare class ItemComponent {
|
|
1073
|
+
setLockedColor(lockedColor: number[]): Text;
|
|
1074
|
+
locked_color: number[] | undefined;
|
|
974
1075
|
/**
|
|
975
|
-
*
|
|
976
|
-
* @param {
|
|
977
|
-
* @
|
|
978
|
-
* @param {number} damage_chance_max 损坏最大几率
|
|
979
|
-
* @returns {ItemComponent}
|
|
1076
|
+
* 设置是否显示文本阴影。
|
|
1077
|
+
* @param {boolean} shadow - 是否显示阴影(默认值:false)
|
|
1078
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
980
1079
|
*/
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
/**
|
|
984
|
-
*
|
|
985
|
-
* @param {Array} custom_components
|
|
986
|
-
* @returns
|
|
987
|
-
*/
|
|
988
|
-
static setCustomComponents(custom_components: any[]): Map<any, any>;
|
|
1080
|
+
setShadow(shadow?: boolean): Text;
|
|
1081
|
+
shadow: boolean | undefined;
|
|
989
1082
|
/**
|
|
990
|
-
*
|
|
991
|
-
* @param {
|
|
992
|
-
* @
|
|
993
|
-
* @param {Number} maxDrawDuration - 最大蓄力时间。
|
|
994
|
-
* @param {Number} maxLaunchPower - 最大投掷力量。
|
|
995
|
-
* @param {Number} minDrawDuration - 最小蓄力时间。
|
|
996
|
-
* @param {Boolean} scalePowerByDrawDuration - 投掷力量是否随蓄力时间增加。
|
|
997
|
-
* @returns {Map} - 新的组件集合。
|
|
1083
|
+
* 设置是否隐藏断词连字符。
|
|
1084
|
+
* @param {boolean} hide - 是否隐藏连字符(默认值:false)
|
|
1085
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
998
1086
|
*/
|
|
999
|
-
|
|
1087
|
+
setHideHyphen(hide?: boolean): Text;
|
|
1088
|
+
hide_hyphen: boolean | undefined;
|
|
1000
1089
|
/**
|
|
1001
|
-
*
|
|
1002
|
-
* @param {
|
|
1003
|
-
* @returns {
|
|
1090
|
+
* 设置文本出现省略号时需通知的控件名称数组。
|
|
1091
|
+
* @param {string[]} controls - 控件名称数组
|
|
1092
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1004
1093
|
*/
|
|
1005
|
-
|
|
1094
|
+
setNotifyOnEllipses(controls: string[]): Text;
|
|
1095
|
+
notify_on_ellipses: string[] | undefined;
|
|
1006
1096
|
/**
|
|
1007
|
-
*
|
|
1008
|
-
* @param {
|
|
1009
|
-
* @
|
|
1010
|
-
* @param {Number} saturationModifier - 饱和度修正值。
|
|
1011
|
-
* @param {String} [usingConvertsTo] - 食用后转换的目标物品。
|
|
1012
|
-
* @returns {Map} - 新的组件集合。
|
|
1097
|
+
* 添加一个需通知省略号事件的控件名称。
|
|
1098
|
+
* @param {string} controlName - 控件名称
|
|
1099
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1013
1100
|
*/
|
|
1014
|
-
|
|
1101
|
+
addNotifyOnEllipses(controlName: string): Text;
|
|
1015
1102
|
/**
|
|
1016
|
-
*
|
|
1017
|
-
* @param {
|
|
1018
|
-
* @returns {
|
|
1103
|
+
* 设置是否启用脏话过滤。
|
|
1104
|
+
* @param {boolean} enable - 是否启用过滤(默认值:false)
|
|
1105
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1019
1106
|
*/
|
|
1020
|
-
|
|
1107
|
+
setEnableProfanityFilter(enable?: boolean): Text;
|
|
1108
|
+
enable_profanity_filter: boolean | undefined;
|
|
1021
1109
|
/**
|
|
1022
|
-
*
|
|
1023
|
-
* @param {
|
|
1024
|
-
* @returns {
|
|
1110
|
+
* 设置父级禁用时的透明度。
|
|
1111
|
+
* @param {number} alpha - 透明度(范围:0.0 到 1.0)
|
|
1112
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1025
1113
|
*/
|
|
1026
|
-
|
|
1114
|
+
setLockedAlpha(alpha: number): Text;
|
|
1115
|
+
locked_alpha: number | undefined;
|
|
1027
1116
|
/**
|
|
1028
|
-
*
|
|
1029
|
-
* @param {
|
|
1030
|
-
* @returns {
|
|
1117
|
+
* 设置字体大小。
|
|
1118
|
+
* @param {string} size - 字体大小(可能值:small, normal, large, extra_large,默认值:normal)
|
|
1119
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1031
1120
|
*/
|
|
1032
|
-
|
|
1121
|
+
setFontSize(size?: string): Text;
|
|
1122
|
+
font_size: string | undefined;
|
|
1033
1123
|
/**
|
|
1034
|
-
*
|
|
1035
|
-
* @param {
|
|
1036
|
-
* @returns {
|
|
1124
|
+
* 设置字体缩放比例。
|
|
1125
|
+
* @param {number} factor - 缩放比例(默认值:1.0)
|
|
1126
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1037
1127
|
*/
|
|
1038
|
-
|
|
1128
|
+
setFontScaleFactor(factor?: number): Text;
|
|
1129
|
+
font_scale_factor: number | undefined;
|
|
1039
1130
|
/**
|
|
1040
|
-
*
|
|
1041
|
-
* @param {
|
|
1042
|
-
* @returns {
|
|
1131
|
+
* 设置是否启用本地化翻译。
|
|
1132
|
+
* @param {boolean} localize - 是否启用本地化(默认值:false)
|
|
1133
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1043
1134
|
*/
|
|
1044
|
-
|
|
1135
|
+
setLocalize(localize?: boolean): Text;
|
|
1136
|
+
localize: boolean | undefined;
|
|
1045
1137
|
/**
|
|
1046
|
-
*
|
|
1047
|
-
* @param {
|
|
1048
|
-
* @
|
|
1049
|
-
* @returns {Map} - 新的组件集合。
|
|
1138
|
+
* 设置行间距。
|
|
1139
|
+
* @param {number} padding - 行间距
|
|
1140
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1050
1141
|
*/
|
|
1051
|
-
|
|
1142
|
+
setLinePadding(padding: number): Text;
|
|
1143
|
+
line_padding: number | undefined;
|
|
1052
1144
|
/**
|
|
1053
|
-
*
|
|
1054
|
-
* @param {
|
|
1055
|
-
* @
|
|
1056
|
-
* @returns {Map} - 新的组件集合。
|
|
1145
|
+
* 设置字体类型。
|
|
1146
|
+
* @param {string} font - 字体类型(可能值:default, rune, unicode 等,默认值:default)
|
|
1147
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1057
1148
|
*/
|
|
1058
|
-
|
|
1149
|
+
setFontType(font?: string): Text;
|
|
1150
|
+
font_type: string | undefined;
|
|
1059
1151
|
/**
|
|
1060
|
-
*
|
|
1061
|
-
* @param {
|
|
1062
|
-
* @
|
|
1063
|
-
* @returns {Map} - 新的组件集合。
|
|
1152
|
+
* 设置备用字体类型。
|
|
1153
|
+
* @param {string} backupFont - 备用字体类型(默认值:default)
|
|
1154
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1064
1155
|
*/
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
* 设置物品的使用动画组件。
|
|
1068
|
-
* @param {String} animation - 物品使用时的动画类型(如 "eat"、"drink" 等)。
|
|
1069
|
-
* @returns {Map} - 新的组件集合。
|
|
1070
|
-
* @throws {Error} - 如果 animation 不是字符串类型。
|
|
1071
|
-
*/
|
|
1072
|
-
static setUseAnimation(animation: string): Map<any, any>;
|
|
1156
|
+
setBackupFontType(backupFont?: string): Text;
|
|
1157
|
+
backup_font_type: string | undefined;
|
|
1073
1158
|
/**
|
|
1074
|
-
*
|
|
1075
|
-
* @param {
|
|
1076
|
-
* @returns {
|
|
1159
|
+
* 设置文本对齐方式。
|
|
1160
|
+
* @param {string} alignment - 对齐方式(例如:left, right, center)
|
|
1161
|
+
* @returns {Text} 返回当前实例以支持链式调用
|
|
1077
1162
|
*/
|
|
1078
|
-
|
|
1163
|
+
setTextAlignment(alignment: string): Text;
|
|
1164
|
+
text_alignment: string | undefined;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
declare class Label extends UIElement {
|
|
1168
|
+
constructor(id: any, template: any);
|
|
1169
|
+
text: Text;
|
|
1170
|
+
layout: Layout;
|
|
1171
|
+
dataBinding: DataBinding;
|
|
1172
|
+
factory: Factory;
|
|
1173
|
+
setLayout(layout: any): this;
|
|
1174
|
+
setText(text: any): this;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
declare class Panel extends UIElement {
|
|
1079
1178
|
/**
|
|
1080
|
-
*
|
|
1081
|
-
* @param {
|
|
1082
|
-
* @
|
|
1179
|
+
*
|
|
1180
|
+
* @param {*} id
|
|
1181
|
+
* @param {*} [template]
|
|
1083
1182
|
*/
|
|
1084
|
-
|
|
1183
|
+
constructor(id: any, template?: any);
|
|
1184
|
+
layout: Layout;
|
|
1185
|
+
dataBinding: DataBinding;
|
|
1186
|
+
factory: Factory;
|
|
1187
|
+
setLayout(layout: any): this;
|
|
1085
1188
|
}
|
|
1086
1189
|
|
|
1087
1190
|
/**
|
|
1088
|
-
*
|
|
1191
|
+
* ScrollView 类
|
|
1089
1192
|
*
|
|
1090
|
-
*
|
|
1193
|
+
* 该类表示一个滚动视图控件,用于管理滚动行为及其相关属性。
|
|
1091
1194
|
*
|
|
1092
|
-
*
|
|
1093
|
-
* -
|
|
1094
|
-
* -
|
|
1095
|
-
* -
|
|
1096
|
-
* -
|
|
1097
|
-
* -
|
|
1098
|
-
* -
|
|
1099
|
-
* -
|
|
1100
|
-
* -
|
|
1101
|
-
* -
|
|
1102
|
-
* -
|
|
1103
|
-
* -
|
|
1104
|
-
* -
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1195
|
+
* 属性:
|
|
1196
|
+
* - scrollbar_track_button: string - 滚动条轨道按钮的 ID
|
|
1197
|
+
* - scrollbar_touch_button: string - 滚动条触摸按钮的 ID
|
|
1198
|
+
* - scroll_speed: number - 滚动速度
|
|
1199
|
+
* - gesture_control_enabled: boolean - 是否启用手势控制
|
|
1200
|
+
* - always_handle_scrolling: boolean - 是否始终处理滚动
|
|
1201
|
+
* - touch_mode: boolean - 是否启用触摸模式
|
|
1202
|
+
* - scrollbar_box: string - 滚动条滑块子元素的名称
|
|
1203
|
+
* - scrollbar_track: string - 滚动条轨道子元素的名称
|
|
1204
|
+
* - scroll_view_port: string - 视口子元素的名称
|
|
1205
|
+
* - scroll_content: string - 内容根父元素的名称
|
|
1206
|
+
* - scroll_box_and_track_panel: string - 包含滚动条滑块和轨道的子元素名称
|
|
1207
|
+
* - jump_to_bottom_on_update: boolean - 是否在更新时跳转到底部
|
|
1208
|
+
*/
|
|
1209
|
+
declare class ScrollView {
|
|
1210
|
+
/**
|
|
1211
|
+
* 设置滚动条轨道按钮的 ID。
|
|
1212
|
+
* @param {string} buttonId - 滚动条轨道按钮的 ID
|
|
1213
|
+
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
1214
|
+
*/
|
|
1215
|
+
setScrollbarTrackButton(buttonId: string): ScrollView;
|
|
1216
|
+
scrollbar_track_button: string | undefined;
|
|
1217
|
+
/**
|
|
1218
|
+
* 设置滚动条触摸按钮的 ID。
|
|
1219
|
+
* @param {string} buttonId - 滚动条触摸按钮的 ID
|
|
1220
|
+
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
1221
|
+
*/
|
|
1222
|
+
setScrollbarTouchButton(buttonId: string): ScrollView;
|
|
1223
|
+
scrollbar_touch_button: string | undefined;
|
|
1224
|
+
/**
|
|
1225
|
+
* 设置滚动速度。
|
|
1226
|
+
* @param {number} speed - 滚动速度
|
|
1227
|
+
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
1228
|
+
*/
|
|
1229
|
+
setScrollSpeed(speed: number): ScrollView;
|
|
1230
|
+
scroll_speed: number | undefined;
|
|
1231
|
+
/**
|
|
1232
|
+
* 设置是否启用手势控制。
|
|
1233
|
+
* @param {boolean} enabled - 是否启用手势控制(默认值:false)
|
|
1234
|
+
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
1235
|
+
*/
|
|
1236
|
+
setGestureControlEnabled(enabled?: boolean): ScrollView;
|
|
1237
|
+
gesture_control_enabled: boolean | undefined;
|
|
1238
|
+
/**
|
|
1239
|
+
* 设置是否始终处理滚动。
|
|
1240
|
+
* @param {boolean} alwaysHandle - 是否始终处理滚动(默认值:false)
|
|
1241
|
+
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
1242
|
+
*/
|
|
1243
|
+
setAlwaysHandleScrolling(alwaysHandle?: boolean): ScrollView;
|
|
1244
|
+
always_handle_scrolling: boolean | undefined;
|
|
1245
|
+
/**
|
|
1246
|
+
* 设置是否启用触摸模式。
|
|
1247
|
+
* @param {boolean} touchMode - 是否启用触摸模式(默认值:false)
|
|
1248
|
+
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
1249
|
+
*/
|
|
1250
|
+
setTouchMode(touchMode?: boolean): ScrollView;
|
|
1251
|
+
touch_mode: boolean | undefined;
|
|
1252
|
+
/**
|
|
1253
|
+
* 设置滚动条滑块子元素的名称。
|
|
1254
|
+
* @param {string} boxName - 滚动条滑块子元素的名称
|
|
1255
|
+
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
1256
|
+
*/
|
|
1257
|
+
setScrollbarBox(boxName: string): ScrollView;
|
|
1258
|
+
scrollbar_box: string | undefined;
|
|
1259
|
+
/**
|
|
1260
|
+
* 设置滚动条轨道子元素的名称。
|
|
1261
|
+
* @param {string} trackName - 滚动条轨道子元素的名称
|
|
1262
|
+
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
1263
|
+
*/
|
|
1264
|
+
setScrollbarTrack(trackName: string): ScrollView;
|
|
1265
|
+
scrollbar_track: string | undefined;
|
|
1266
|
+
/**
|
|
1267
|
+
* 设置视口子元素的名称。
|
|
1268
|
+
* @param {string} viewPortName - 视口子元素的名称
|
|
1269
|
+
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
1270
|
+
*/
|
|
1271
|
+
setScrollViewPort(viewPortName: string): ScrollView;
|
|
1272
|
+
scroll_view_port: string | undefined;
|
|
1273
|
+
/**
|
|
1274
|
+
* 设置内容根父元素的名称。
|
|
1275
|
+
* @param {string} contentName - 内容根父元素的名称
|
|
1276
|
+
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
1277
|
+
*/
|
|
1278
|
+
setScrollContent(contentName: string): ScrollView;
|
|
1279
|
+
scroll_content: string | undefined;
|
|
1280
|
+
/**
|
|
1281
|
+
* 设置包含滚动条滑块和轨道的子元素名称。
|
|
1282
|
+
* @param {string} panelName - 包含滚动条滑块和轨道的子元素名称
|
|
1283
|
+
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
1284
|
+
*/
|
|
1285
|
+
setScrollBoxAndTrackPanel(panelName: string): ScrollView;
|
|
1286
|
+
scroll_box_and_track_panel: string | undefined;
|
|
1287
|
+
/**
|
|
1288
|
+
* 设置是否在更新时跳转到底部。
|
|
1289
|
+
* @param {boolean} jump - 是否在更新时跳转到底部(默认值:false)
|
|
1290
|
+
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
1291
|
+
*/
|
|
1292
|
+
setJumpToBottomOnUpdate(jump?: boolean): ScrollView;
|
|
1293
|
+
jump_to_bottom_on_update: boolean | undefined;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
declare class ScrollingPanel extends UIElement {
|
|
1297
|
+
constructor(id: any, template: any);
|
|
1298
|
+
input: Input;
|
|
1299
|
+
scrollView: ScrollView;
|
|
1300
|
+
layout: Layout;
|
|
1301
|
+
dataBinding: DataBinding;
|
|
1302
|
+
factory: Factory;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
declare class StackPanel extends Panel {
|
|
1306
|
+
constructor(id: any, template: any);
|
|
1307
|
+
type: string;
|
|
1308
|
+
orientation: string;
|
|
1309
|
+
stackNum: number;
|
|
1310
|
+
addStack(size: any, content: any, debug?: boolean): this;
|
|
1311
|
+
/**
|
|
1312
|
+
* Possible values:
|
|
1313
|
+
vertical
|
|
1314
|
+
horizontal
|
|
1315
|
+
* @param {*} orientation
|
|
1316
|
+
*/
|
|
1317
|
+
setOrientation(orientation: any): this;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
declare class UISystem {
|
|
1321
|
+
constructor(identifier: any, path: any);
|
|
1322
|
+
identifier: any;
|
|
1323
|
+
namespace: any;
|
|
1324
|
+
name: any;
|
|
1325
|
+
path: any;
|
|
1326
|
+
elements: Map<any, any>;
|
|
1327
|
+
animations: Map<any, any>;
|
|
1328
|
+
addElement(element: any): this;
|
|
1329
|
+
getElement(element_name: any): any;
|
|
1330
|
+
addAnimation(name: any, value: any): void;
|
|
1331
|
+
getAnimation(animation_name: any): any;
|
|
1332
|
+
toObject(): {
|
|
1333
|
+
namespace: any;
|
|
1334
|
+
};
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
declare class ChestUISystem {
|
|
1338
|
+
static chest_screen: UISystem;
|
|
1339
|
+
static registerContainerUI(new_container_title: any, ui_system_root_panel: any): void;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* 自定义容器 UI 系统类,用于创建和管理容器界面。
|
|
1344
|
+
* 支持动态添加网格项、设置标题、调整尺寸等功能。
|
|
1115
1345
|
*/
|
|
1346
|
+
declare class ContainerUISystem {
|
|
1347
|
+
/**
|
|
1348
|
+
* 构造函数,初始化容器 UI 系统。
|
|
1349
|
+
* @param {string} identifier - 容器的唯一标识符。
|
|
1350
|
+
* @param {string} path - 资源路径。
|
|
1351
|
+
*/
|
|
1352
|
+
constructor(identifier: string, path: string);
|
|
1353
|
+
system: UISystem;
|
|
1354
|
+
title: string;
|
|
1355
|
+
root_panel_size: number[];
|
|
1356
|
+
gridDimension: number[];
|
|
1357
|
+
output_grids: any[];
|
|
1358
|
+
main_panel: Panel;
|
|
1359
|
+
grids: Grid;
|
|
1360
|
+
setInputGrid(output_arr: any): void;
|
|
1361
|
+
/**
|
|
1362
|
+
* 向网格中添加一个网格项。
|
|
1363
|
+
* @param {number[]} grid_position - 网格项的位置 [行, 列] 用于定位实体的背包槽。
|
|
1364
|
+
* @param {number[]} offset - 网格项的偏移量 [x, y]。
|
|
1365
|
+
* @param {Object} [options] - 可选参数,用于配置网格项。
|
|
1366
|
+
* @param {boolean} [options.enable=true] - 是否启用该网格项,默认为 true。
|
|
1367
|
+
* @param {number[]} [options.size] - 网格项的大小 [宽度, 高度]。
|
|
1368
|
+
* @param {UIElement[]} [options.background_images] - 网格项的背景图片控件。
|
|
1369
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
1370
|
+
*/
|
|
1371
|
+
addGridItem(grid_position: number[], offset: number[], options?: {
|
|
1372
|
+
enable?: boolean | undefined;
|
|
1373
|
+
size?: number[] | undefined;
|
|
1374
|
+
background_images?: UIElement[] | undefined;
|
|
1375
|
+
}): ContainerUISystem;
|
|
1376
|
+
addInputGrid(grid_position: any, offset: any, options: any): void;
|
|
1377
|
+
addOutputGrid(grid_position: any, offset: any, options: any): void;
|
|
1378
|
+
/**
|
|
1379
|
+
* 向主面板中添加一个 UI 元素。
|
|
1380
|
+
* @param {Object} element - 要添加的 UI 元素。
|
|
1381
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
1382
|
+
*/
|
|
1383
|
+
addElementToMain(element: Object): ContainerUISystem;
|
|
1384
|
+
/**
|
|
1385
|
+
* 设置网格的维度(行和列)。
|
|
1386
|
+
* @param {number[]} dimension - 网格的维度 [行数, 列数]。
|
|
1387
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
1388
|
+
*/
|
|
1389
|
+
setGridDimension(dimension: number[]): ContainerUISystem;
|
|
1390
|
+
/**
|
|
1391
|
+
* 设置容器的标题。
|
|
1392
|
+
* @param {string} title - 容器的标题。
|
|
1393
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
1394
|
+
*/
|
|
1395
|
+
setTitle(title: string): ContainerUISystem;
|
|
1396
|
+
/**
|
|
1397
|
+
* 设置根面板的尺寸。
|
|
1398
|
+
* @param {number[]} size - 根面板的尺寸 [宽度, 高度]。
|
|
1399
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
1400
|
+
*/
|
|
1401
|
+
setSize(size: number[]): ContainerUISystem;
|
|
1402
|
+
setItemMatrix(n: any, matrix: any): void;
|
|
1403
|
+
#private;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
declare const ServerFormSystem: UISystem;
|
|
1407
|
+
declare const form_button_panel: Panel;
|
|
1408
|
+
declare class ServerUISystem {
|
|
1409
|
+
static "__#1053@#binding_map": Map<any, any>;
|
|
1410
|
+
static "__#1053@#binding_title_list": any[];
|
|
1411
|
+
static addBindingTitle(title_name: any): void;
|
|
1412
|
+
static getBindingTitleList(): any[];
|
|
1413
|
+
static getBindingContentList(): any[];
|
|
1414
|
+
static bindingTitlewithContent(title_name: any, content: any): void;
|
|
1415
|
+
static "__#1053@#updateServerFormSystem"(): void;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
declare class Guidebook {
|
|
1419
|
+
constructor(identifier: any, path: any);
|
|
1420
|
+
system: UISystem;
|
|
1421
|
+
addPageBinding(page_name: any, left_control_name: any, right_control_name: any): this;
|
|
1422
|
+
addPage(page_name: any, left_control: any, right_control: any): this;
|
|
1423
|
+
addElement(element: any): this;
|
|
1424
|
+
#private;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1116
1427
|
/**
|
|
1117
|
-
*
|
|
1428
|
+
* ButtonMapping 类
|
|
1118
1429
|
*
|
|
1119
|
-
*
|
|
1430
|
+
* 该类表示按钮映射配置,用于定义输入事件的映射关系。
|
|
1120
1431
|
*
|
|
1121
1432
|
* 属性:
|
|
1122
|
-
* -
|
|
1123
|
-
* -
|
|
1124
|
-
* -
|
|
1125
|
-
* -
|
|
1126
|
-
* -
|
|
1127
|
-
* -
|
|
1128
|
-
* -
|
|
1129
|
-
* -
|
|
1130
|
-
* -
|
|
1131
|
-
* -
|
|
1132
|
-
* -
|
|
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 - 控件在集合中的索引
|
|
1433
|
+
* - ignored: boolean - 是否忽略映射(默认值:false)
|
|
1434
|
+
* - from_button_id: string - 触发事件的按钮 ID
|
|
1435
|
+
* - to_button_id: string - 事件触发时执行的按钮 ID
|
|
1436
|
+
* - mapping_type: enum - 映射类型(可能值:global, pressed, double_pressed, focused)
|
|
1437
|
+
* - scope: enum - 映射范围(可能值:view, controller)
|
|
1438
|
+
* - input_mode_condition: enum - 输入模式条件(可能值:not_gaze, not_gamepad, gamepad_and_not_gaze)
|
|
1439
|
+
* - ignore_input_scope: boolean - 是否忽略输入范围
|
|
1440
|
+
* - consume_event: boolean - 是否消耗事件
|
|
1441
|
+
* - handle_select: boolean - 是否处理选择事件
|
|
1442
|
+
* - handle_deselect: boolean - 是否处理取消选择事件
|
|
1443
|
+
* - button_up_right_of_first_refusal: boolean - 是否在首次拒绝后处理按钮释放事件
|
|
1144
1444
|
*/
|
|
1145
|
-
declare class
|
|
1445
|
+
declare class ButtonMapping$1 {
|
|
1446
|
+
ignored: boolean;
|
|
1447
|
+
from_button_id: string;
|
|
1448
|
+
to_button_id: string;
|
|
1449
|
+
mapping_type: string | null;
|
|
1450
|
+
scope: string | null;
|
|
1451
|
+
input_mode_condition: string | null;
|
|
1452
|
+
ignore_input_scope: boolean;
|
|
1453
|
+
consume_event: boolean;
|
|
1454
|
+
handle_select: boolean;
|
|
1455
|
+
handle_deselect: boolean;
|
|
1456
|
+
button_up_right_of_first_refusal: boolean;
|
|
1146
1457
|
/**
|
|
1147
|
-
*
|
|
1148
|
-
* @param {boolean}
|
|
1149
|
-
* @returns {
|
|
1458
|
+
* 设置是否忽略映射。
|
|
1459
|
+
* @param {boolean} ignored - 是否忽略映射(默认值:false)
|
|
1460
|
+
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
1150
1461
|
*/
|
|
1151
|
-
|
|
1152
|
-
visible: boolean | undefined;
|
|
1462
|
+
setIgnored(ignored?: boolean): ButtonMapping$1;
|
|
1153
1463
|
/**
|
|
1154
|
-
*
|
|
1155
|
-
* @param {
|
|
1156
|
-
* @returns {
|
|
1464
|
+
* 设置触发事件的按钮 ID。
|
|
1465
|
+
* @param {string} fromButtonId - 触发事件的按钮 ID
|
|
1466
|
+
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
1157
1467
|
*/
|
|
1158
|
-
|
|
1159
|
-
enabled: boolean | undefined;
|
|
1468
|
+
setFromButtonId(fromButtonId: string): ButtonMapping$1;
|
|
1160
1469
|
/**
|
|
1161
|
-
*
|
|
1162
|
-
* @param {
|
|
1163
|
-
* @returns {
|
|
1470
|
+
* 设置事件触发时执行的按钮 ID。
|
|
1471
|
+
* @param {string} toButtonId - 事件触发时执行的按钮 ID
|
|
1472
|
+
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
1164
1473
|
*/
|
|
1165
|
-
|
|
1166
|
-
layer: number | undefined;
|
|
1474
|
+
setToButtonId(toButtonId: string): ButtonMapping$1;
|
|
1167
1475
|
/**
|
|
1168
|
-
*
|
|
1169
|
-
* @param {
|
|
1170
|
-
* @returns {
|
|
1476
|
+
* 设置映射类型。
|
|
1477
|
+
* @param {string} mappingType - 映射类型(可能值:global, pressed, double_pressed, focused)
|
|
1478
|
+
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
1171
1479
|
*/
|
|
1172
|
-
|
|
1173
|
-
alpha: number | undefined;
|
|
1480
|
+
setMappingType(mappingType: string): ButtonMapping$1;
|
|
1174
1481
|
/**
|
|
1175
|
-
*
|
|
1176
|
-
* @param {
|
|
1177
|
-
* @returns {
|
|
1482
|
+
* 设置映射范围。
|
|
1483
|
+
* @param {string} scope - 映射范围(可能值:view, controller)
|
|
1484
|
+
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
1485
|
+
*/
|
|
1486
|
+
setScope(scope: string): ButtonMapping$1;
|
|
1487
|
+
/**
|
|
1488
|
+
* 设置输入模式条件。
|
|
1489
|
+
* @param {string} condition - 输入模式条件(可能值:not_gaze, not_gamepad, gamepad_and_not_gaze)
|
|
1490
|
+
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
1491
|
+
*/
|
|
1492
|
+
setInputModeCondition(condition: string): ButtonMapping$1;
|
|
1493
|
+
/**
|
|
1494
|
+
* 设置是否忽略输入范围。
|
|
1495
|
+
* @param {boolean} ignore - 是否忽略输入范围
|
|
1496
|
+
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
1497
|
+
*/
|
|
1498
|
+
setIgnoreInputScope(ignore?: boolean): ButtonMapping$1;
|
|
1499
|
+
/**
|
|
1500
|
+
* 设置是否消耗事件。
|
|
1501
|
+
* @param {boolean} consume - 是否消耗事件
|
|
1502
|
+
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
1503
|
+
*/
|
|
1504
|
+
setConsumeEvent(consume?: boolean): ButtonMapping$1;
|
|
1505
|
+
/**
|
|
1506
|
+
* 设置是否处理选择事件。
|
|
1507
|
+
* @param {boolean} handle - 是否处理选择事件
|
|
1508
|
+
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
1509
|
+
*/
|
|
1510
|
+
setHandleSelect(handle?: boolean): ButtonMapping$1;
|
|
1511
|
+
/**
|
|
1512
|
+
* 设置是否处理取消选择事件。
|
|
1513
|
+
* @param {boolean} handle - 是否处理取消选择事件
|
|
1514
|
+
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
1515
|
+
*/
|
|
1516
|
+
setHandleDeselect(handle?: boolean): ButtonMapping$1;
|
|
1517
|
+
/**
|
|
1518
|
+
* 设置是否在首次拒绝后处理按钮释放事件。
|
|
1519
|
+
* @param {boolean} handle - 是否处理按钮释放事件
|
|
1520
|
+
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
1521
|
+
*/
|
|
1522
|
+
setButtonUpRightOfFirstRefusal(handle?: boolean): ButtonMapping$1;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* DataBinding 类
|
|
1527
|
+
*
|
|
1528
|
+
* 该类表示数据绑定配置,用于将硬编码值或变量绑定到元素属性。
|
|
1529
|
+
*
|
|
1530
|
+
* 属性:
|
|
1531
|
+
* - ignored: boolean - 是否忽略绑定(默认值:false)
|
|
1532
|
+
* - binding_type: enum - 绑定类型(可能值:global, view, collection, collection_details, none)
|
|
1533
|
+
* - binding_name: string - 数据绑定名称或条件的值
|
|
1534
|
+
* - binding_name_override: string - 应用 binding_name 值的 UI 元素属性名称
|
|
1535
|
+
* - binding_collection_name: string - 要使用的集合名称
|
|
1536
|
+
* - binding_collection_prefix: string - 集合前缀
|
|
1537
|
+
* - binding_condition: enum - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
1538
|
+
* - source_control_name: string - 要观察其属性值的 UI 元素名称
|
|
1539
|
+
* - source_property_name: string - 存储 source_control_name 引用的 UI 元素的属性值
|
|
1540
|
+
* - target_property_name: string - 应用 source_property_name 值的 UI 元素属性
|
|
1541
|
+
* - resolve_sibling_scope: boolean - 是否允许选择同级元素而非子元素(默认值:false)
|
|
1542
|
+
*/
|
|
1543
|
+
declare class DataBindingObject {
|
|
1544
|
+
/**
|
|
1545
|
+
* 设置是否忽略绑定。
|
|
1546
|
+
* @param {boolean} ignored - 是否忽略绑定(默认值:false)
|
|
1547
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1548
|
+
*/
|
|
1549
|
+
setIgnored(ignored?: boolean): DataBindingObject;
|
|
1550
|
+
ignored: boolean | undefined;
|
|
1551
|
+
/**
|
|
1552
|
+
* 设置绑定类型。
|
|
1553
|
+
* @param {string} type - 绑定类型(可能值:global, view, collection, collection_details, none)
|
|
1554
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1555
|
+
*/
|
|
1556
|
+
setBindingType(type: string): DataBindingObject;
|
|
1557
|
+
binding_type: string | undefined;
|
|
1558
|
+
/**
|
|
1559
|
+
* 设置数据绑定名称或条件的值。
|
|
1560
|
+
* @param {string} name - 数据绑定名称或条件的值
|
|
1561
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1562
|
+
*/
|
|
1563
|
+
setBindingName(name: string): DataBindingObject;
|
|
1564
|
+
binding_name: string | undefined;
|
|
1565
|
+
/**
|
|
1566
|
+
* 设置应用 binding_name 值的 UI 元素属性名称。
|
|
1567
|
+
* @param {string} nameOverride - 应用 binding_name 值的 UI 元素属性名称
|
|
1568
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1569
|
+
*/
|
|
1570
|
+
setBindingNameOverride(nameOverride: string): DataBindingObject;
|
|
1571
|
+
binding_name_override: string | undefined;
|
|
1572
|
+
/**
|
|
1573
|
+
* 设置要使用的集合名称。
|
|
1574
|
+
* @param {string} collectionName - 集合名称
|
|
1575
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1576
|
+
*/
|
|
1577
|
+
setBindingCollectionName(collectionName: string): DataBindingObject;
|
|
1578
|
+
binding_collection_name: string | undefined;
|
|
1579
|
+
/**
|
|
1580
|
+
* 设置集合前缀。
|
|
1581
|
+
* @param {string} prefix - 集合前缀
|
|
1582
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1583
|
+
*/
|
|
1584
|
+
setBindingCollectionPrefix(prefix: string): DataBindingObject;
|
|
1585
|
+
binding_collection_prefix: string | undefined;
|
|
1586
|
+
/**
|
|
1587
|
+
* 设置数据绑定的条件。
|
|
1588
|
+
* @param {string} condition - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
1589
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1590
|
+
*/
|
|
1591
|
+
setBindingCondition(condition: string): DataBindingObject;
|
|
1592
|
+
binding_condition: string | undefined;
|
|
1593
|
+
/**
|
|
1594
|
+
* 设置要观察其属性值的 UI 元素名称。
|
|
1595
|
+
* @param {string} controlName - UI 元素名称
|
|
1596
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1597
|
+
*/
|
|
1598
|
+
setSourceControlName(controlName: string): DataBindingObject;
|
|
1599
|
+
source_control_name: string | undefined;
|
|
1600
|
+
/**
|
|
1601
|
+
* 设置存储 source_control_name 引用的 UI 元素的属性值。
|
|
1602
|
+
* @param {string} propertyName - 属性名称
|
|
1603
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1604
|
+
*/
|
|
1605
|
+
setSourcePropertyName(propertyName: string): DataBindingObject;
|
|
1606
|
+
source_property_name: string | undefined;
|
|
1607
|
+
/**
|
|
1608
|
+
* 设置应用 source_property_name 值的 UI 元素属性。
|
|
1609
|
+
* @param {string} propertyName - 属性名称
|
|
1610
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1611
|
+
*/
|
|
1612
|
+
setTargetPropertyName(propertyName: string): DataBindingObject;
|
|
1613
|
+
target_property_name: string | undefined;
|
|
1614
|
+
/**
|
|
1615
|
+
* 设置是否允许选择同级元素而非子元素。
|
|
1616
|
+
* @param {boolean} resolve - 是否允许选择同级元素(默认值:false)
|
|
1617
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
1618
|
+
*/
|
|
1619
|
+
setResolveSiblingScope(resolve?: boolean): DataBindingObject;
|
|
1620
|
+
resolve_sibling_scope: boolean | undefined;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
declare class UISystemRegistry {
|
|
1624
|
+
static "__#1050@#ui_system_map": {};
|
|
1625
|
+
static "__#1050@#ui_def_list": any[];
|
|
1626
|
+
static registerUISystem(ui_system: any): void;
|
|
1627
|
+
static addOuterUIdefs(ui_defs: any): void;
|
|
1628
|
+
static submit(): void;
|
|
1629
|
+
}
|
|
1630
|
+
declare class UISystemRegistryServer {
|
|
1631
|
+
static "__#1051@#ui_system_map": {};
|
|
1632
|
+
static "__#1051@#ui_def_list": any[];
|
|
1633
|
+
static getUISystemList(): any[];
|
|
1634
|
+
static getUIdefList(): any[];
|
|
1635
|
+
static startServer(): void;
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
declare namespace registry {
|
|
1639
|
+
function submit(): void;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
declare class Item {
|
|
1643
|
+
/**
|
|
1644
|
+
* 物品类
|
|
1645
|
+
* @param {string} identifier 物品唯一标识符
|
|
1646
|
+
* @param {string} category 菜单栏分类 可选:"construction", "nature", "equipment", "items", and "none"
|
|
1647
|
+
* @param {string} texture 物品纹理
|
|
1648
|
+
* @param {Object} options 可选参数
|
|
1649
|
+
* @param {string} options.group 分组
|
|
1650
|
+
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
1651
|
+
*/
|
|
1652
|
+
constructor(identifier: string, category: string, texture: string, options?: {
|
|
1653
|
+
group: string;
|
|
1654
|
+
hide_in_command: boolean;
|
|
1655
|
+
});
|
|
1656
|
+
identifier: string;
|
|
1657
|
+
category: string;
|
|
1658
|
+
texture: string;
|
|
1659
|
+
group: string;
|
|
1660
|
+
hide_in_command: boolean;
|
|
1661
|
+
components: Map<any, any>;
|
|
1662
|
+
/**
|
|
1663
|
+
* 添加组件
|
|
1664
|
+
* @param {Map} componentMap 组件 Map
|
|
1665
|
+
*/
|
|
1666
|
+
addComponent(componentMap: Map<any, any>): this;
|
|
1667
|
+
/**
|
|
1668
|
+
* 移除组件
|
|
1669
|
+
* @param {string} key 组件名称
|
|
1670
|
+
*/
|
|
1671
|
+
removeComponent(key: string): this;
|
|
1672
|
+
/**
|
|
1673
|
+
* 将物品转换为 JSON 格式
|
|
1674
|
+
* @returns {Object} JSON 格式的物品对象
|
|
1675
|
+
*/
|
|
1676
|
+
toObject(): Object;
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
declare class Food extends Item {
|
|
1680
|
+
/**
|
|
1681
|
+
* 物品类
|
|
1682
|
+
* @param {string} identifier 物品唯一标识符
|
|
1683
|
+
* @param {string} category 菜单栏分类 可选:"construction", "nature", "equipment", "items", and "none"
|
|
1684
|
+
* @param {string} texture 物品纹理
|
|
1685
|
+
* @param {Object} options 可选参数
|
|
1686
|
+
* @param {string} options.group 分组
|
|
1687
|
+
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
1688
|
+
* @param {string} options.animation 使用动画,默认为 "eat"
|
|
1689
|
+
* @param {boolean} options.canAlwaysEat 是否总是可以食用,默认为 false
|
|
1690
|
+
* @param {number} options.nutrition 营养价值,默认为 0
|
|
1691
|
+
* @param {number} options.saturationModifier 饱和度修正值,默认为 1
|
|
1692
|
+
*/
|
|
1693
|
+
constructor(identifier: string, category: string, texture: string, options?: {
|
|
1694
|
+
group: string;
|
|
1695
|
+
hide_in_command: boolean;
|
|
1696
|
+
animation: string;
|
|
1697
|
+
canAlwaysEat: boolean;
|
|
1698
|
+
nutrition: number;
|
|
1699
|
+
saturationModifier: number;
|
|
1700
|
+
});
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
declare class AddonAttachableDescription {
|
|
1704
|
+
/**
|
|
1705
|
+
* 可附着物描述类
|
|
1706
|
+
* @param {string} identifier 标识符
|
|
1707
|
+
*/
|
|
1708
|
+
constructor(identifier: string);
|
|
1709
|
+
identifier: string;
|
|
1710
|
+
/**
|
|
1711
|
+
* 添加材质
|
|
1712
|
+
* @param {string} name 材质名称
|
|
1713
|
+
* @param {string} material 材质路径
|
|
1714
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
1715
|
+
*/
|
|
1716
|
+
addMaterial(name: string, material: string): AddonAttachableDescription;
|
|
1717
|
+
materials: {} | undefined;
|
|
1718
|
+
/**
|
|
1719
|
+
* 添加纹理
|
|
1720
|
+
* @param {string} name 纹理名称
|
|
1721
|
+
* @param {string} texture 纹理路径
|
|
1722
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
1723
|
+
*/
|
|
1724
|
+
addTexture(name: string, texture: string): AddonAttachableDescription;
|
|
1725
|
+
textures: {} | undefined;
|
|
1726
|
+
/**
|
|
1727
|
+
* 添加几何体
|
|
1728
|
+
* @param {string} name 几何体名称
|
|
1729
|
+
* @param {string} geometry 几何体路径
|
|
1730
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
1731
|
+
*/
|
|
1732
|
+
addGeometry(name: string, geometry: string): AddonAttachableDescription;
|
|
1733
|
+
geometry: {} | undefined;
|
|
1734
|
+
/**
|
|
1735
|
+
* 添加动画
|
|
1736
|
+
* @param {string} name 动画名称
|
|
1737
|
+
* @param {string} animation 动画路径
|
|
1738
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
1739
|
+
*/
|
|
1740
|
+
addAnimation(name: string, animation: string): AddonAttachableDescription;
|
|
1741
|
+
animations: {} | undefined;
|
|
1742
|
+
/**
|
|
1743
|
+
* 添加动画控制器
|
|
1744
|
+
* @param {string} name 控制器名称
|
|
1745
|
+
* @param {string} controller 控制器路径
|
|
1746
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
1747
|
+
*/
|
|
1748
|
+
addAnimationController(name: string, controller: string): AddonAttachableDescription;
|
|
1749
|
+
animation_controllers: any[] | undefined;
|
|
1750
|
+
/**
|
|
1751
|
+
* 添加渲染控制器
|
|
1752
|
+
* @param {string} controller 渲染控制器路径
|
|
1753
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
1754
|
+
*/
|
|
1755
|
+
addRenderController(controller: string): AddonAttachableDescription;
|
|
1756
|
+
render_controllers: any[] | undefined;
|
|
1757
|
+
/**
|
|
1758
|
+
* 添加定位器
|
|
1759
|
+
* @param {string} name 定位器名称
|
|
1760
|
+
* @param {Object} locator 定位器数据
|
|
1761
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
1762
|
+
*/
|
|
1763
|
+
addLocator(name: string, locator: Object): AddonAttachableDescription;
|
|
1764
|
+
locators: {} | undefined;
|
|
1765
|
+
/**
|
|
1766
|
+
* 设置脚本
|
|
1767
|
+
* @param {string} key 脚本键
|
|
1768
|
+
* @param {string} value 脚本值
|
|
1769
|
+
* @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
|
|
1770
|
+
*/
|
|
1771
|
+
setScript(key: string, value: string): AddonAttachableDescription;
|
|
1772
|
+
scripts: {} | undefined;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
declare class Attachable extends AddonAttachableDescription {
|
|
1776
|
+
constructor(identifier: any);
|
|
1777
|
+
getId(): string;
|
|
1778
|
+
toObject(): any;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
declare class Armor {
|
|
1782
|
+
constructor(identifier: any, category: any, item_texture: any, texture_path: any, options?: {});
|
|
1783
|
+
identifier: any;
|
|
1784
|
+
item: Item;
|
|
1785
|
+
attachable: Attachable;
|
|
1786
|
+
setArrachableGeometry(key: any, geometry: any): this;
|
|
1787
|
+
}
|
|
1788
|
+
declare class Chestplate extends Armor {
|
|
1789
|
+
constructor(identifier: any, item_texture: any, texture_path: any, options?: {});
|
|
1790
|
+
}
|
|
1791
|
+
declare class Boot extends Armor {
|
|
1792
|
+
constructor(identifier: any, item_texture: any, texture_path: any, options?: {});
|
|
1793
|
+
}
|
|
1794
|
+
declare class Leggings extends Armor {
|
|
1795
|
+
constructor(identifier: any, item_texture: any, texture_path: any, options?: {});
|
|
1796
|
+
}
|
|
1797
|
+
declare class Helmet extends Armor {
|
|
1798
|
+
constructor(identifier: any, item_texture: any, texture_path: any, options?: {});
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
declare namespace ItemAPI {
|
|
1802
|
+
function createItem(identifier: string, category: string, texture: string, options?: {
|
|
1803
|
+
group: string;
|
|
1804
|
+
hight_resolution: boolean;
|
|
1805
|
+
hide_in_command: boolean;
|
|
1806
|
+
}): Item;
|
|
1807
|
+
function createFood(identifier: string, category: string, texture: string, options?: {
|
|
1808
|
+
group: string;
|
|
1809
|
+
hide_in_command: boolean;
|
|
1810
|
+
animation: string;
|
|
1811
|
+
canAlwaysEat: boolean;
|
|
1812
|
+
nutrition: number;
|
|
1813
|
+
saturationModifier: number;
|
|
1814
|
+
}): Food;
|
|
1815
|
+
function createAttachable(identifier: string, texture: string, material: string, options?: Object): Attachable;
|
|
1816
|
+
function createChestplateArmor(identifier: any, item_texture: any, texture_path: any, options?: {}): Chestplate;
|
|
1817
|
+
function createHelmetArmor(identifier: any, item_texture: any, texture_path: any, options?: {}): Helmet;
|
|
1818
|
+
function createBootArmor(identifier: any, item_texture: any, texture_path: any, options?: {}): Boot;
|
|
1819
|
+
function createLeggingsArmor(identifier: any, item_texture: any, texture_path: any, options?: {}): Leggings;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
declare class BasicBlock {
|
|
1823
|
+
/**
|
|
1824
|
+
* 基础方块类
|
|
1825
|
+
* @param {string} identifier 方块唯一标识符
|
|
1826
|
+
* @param {string} category 菜单栏分类 可选:"construction", "nature", "equipment", "items", and "none"
|
|
1827
|
+
* @param {Array} textures_arr 纹理数组 [上,下,东,西,南,北]
|
|
1828
|
+
* @param {Object} options 可选参数
|
|
1829
|
+
* @param {string} options.group 分组,默认为 "construction"
|
|
1830
|
+
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
1831
|
+
*/
|
|
1832
|
+
constructor(identifier: string, category: string, textures_arr: any[], options?: {
|
|
1833
|
+
group: string;
|
|
1834
|
+
hide_in_command: boolean;
|
|
1835
|
+
});
|
|
1836
|
+
identifier: string;
|
|
1837
|
+
category: string;
|
|
1838
|
+
textures: any[];
|
|
1839
|
+
group: string;
|
|
1840
|
+
hide_in_command: boolean;
|
|
1841
|
+
traits: Map<any, any>;
|
|
1842
|
+
states: Map<any, any>;
|
|
1843
|
+
components: Map<any, any>;
|
|
1844
|
+
permutations: any[];
|
|
1845
|
+
getId(): string;
|
|
1846
|
+
registerTrait(key: any, value: any): this;
|
|
1847
|
+
registerState(key: any, value: any): this;
|
|
1848
|
+
/**
|
|
1849
|
+
* 添加组件
|
|
1850
|
+
* @param {Map} componentMap 组件 Map
|
|
1851
|
+
*/
|
|
1852
|
+
addComponent(componentMap: Map<any, any>): this;
|
|
1853
|
+
/**
|
|
1854
|
+
* 移除组件
|
|
1855
|
+
* @param {string} key 组件名称
|
|
1856
|
+
*/
|
|
1857
|
+
removeComponent(key: string): this;
|
|
1858
|
+
/**
|
|
1859
|
+
* 添加方块变体
|
|
1860
|
+
* @param {string} condition 变体条件
|
|
1861
|
+
* @param {Map} componentMap 组件 Map
|
|
1862
|
+
*/
|
|
1863
|
+
addPermutation(condition: string, componentMap: Map<any, any>): this;
|
|
1864
|
+
/**
|
|
1865
|
+
* 将方块对象转换为 JSON 格式
|
|
1866
|
+
* @returns {Object} JSON 格式的方块对象
|
|
1867
|
+
*/
|
|
1868
|
+
toObject(): Object;
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
declare class Block extends BasicBlock {
|
|
1872
|
+
/**
|
|
1873
|
+
* 方块类
|
|
1874
|
+
* @param {string} identifier 方块的唯一标识符
|
|
1875
|
+
* @param {string} category 方块的分类 "construction", "nature", "equipment", "items", and "none"
|
|
1876
|
+
* @param {Array} variantDatas 方块的变体数据,包含每个变体的状态标签和纹理
|
|
1877
|
+
* @param {Object} options 可选参数
|
|
1878
|
+
* @param {string} options.group 分组,默认为 "construction"
|
|
1879
|
+
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
1880
|
+
* @param {boolean} options.ambient_occlusion 是否应用环境光遮蔽,默认为 false
|
|
1881
|
+
* @param {boolean} options.face_dimming 是否根据面的方向进行亮度调整,默认为 false
|
|
1882
|
+
* @param {string} options.render_method 渲染方法,默认为 "alpha_test"
|
|
1883
|
+
*/
|
|
1884
|
+
constructor(identifier: string, category: string, variantDatas: any[], options?: {
|
|
1885
|
+
group: string;
|
|
1886
|
+
hide_in_command: boolean;
|
|
1887
|
+
ambient_occlusion: boolean;
|
|
1888
|
+
face_dimming: boolean;
|
|
1889
|
+
render_method: string;
|
|
1890
|
+
});
|
|
1891
|
+
options: {
|
|
1892
|
+
group: string;
|
|
1893
|
+
hide_in_command: boolean;
|
|
1894
|
+
ambient_occlusion: boolean;
|
|
1895
|
+
face_dimming: boolean;
|
|
1896
|
+
render_method: string;
|
|
1897
|
+
};
|
|
1898
|
+
variantDatas: any[];
|
|
1899
|
+
addVariantComponent(variantIndex: any, componentMap: any): this;
|
|
1900
|
+
#private;
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
declare class RotatableBlock extends BasicBlock {
|
|
1904
|
+
/**
|
|
1905
|
+
* 可旋转方块类
|
|
1906
|
+
* @param {string} identifier 方块唯一标识符
|
|
1907
|
+
* @param {string} category 菜单栏分类
|
|
1908
|
+
* @param {Array} textures_arr 纹理数组 [上,下,东,西,南,北]
|
|
1909
|
+
* @param {Object} options 可选参数
|
|
1910
|
+
* @param {string} options.group 分组,默认为 "construction"
|
|
1911
|
+
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
1912
|
+
* @param {string} options.rotationType 旋转类型,默认为 "cardinal"
|
|
1913
|
+
* @param {number} options.yRotationOffset 初始旋转偏移量,默认为 180
|
|
1914
|
+
*/
|
|
1915
|
+
constructor(identifier: string, category: string, textures_arr: any[], options?: {
|
|
1916
|
+
group: string;
|
|
1917
|
+
hide_in_command: boolean;
|
|
1918
|
+
rotationType: string;
|
|
1919
|
+
yRotationOffset: number;
|
|
1920
|
+
});
|
|
1921
|
+
#private;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
declare class GeometryBlock extends BasicBlock {
|
|
1925
|
+
/**
|
|
1926
|
+
* 带模型方块类
|
|
1927
|
+
* @param {string} identifier 方块标识符 由命名空间和方块名组成 例如 "my_mod:stone"
|
|
1928
|
+
* @param {string} category 方块的分类 "construction", "nature", "equipment", "items", and "none"
|
|
1929
|
+
* @param {string} geometry 模型标识符
|
|
1930
|
+
* @param {Object} material_instances 材质实例对象
|
|
1931
|
+
* @param {Object} options 可选参数
|
|
1932
|
+
*/
|
|
1933
|
+
constructor(identifier: string, category: string, geometry: string, material_instances: Object, options?: Object);
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
declare class OreFeature {
|
|
1937
|
+
constructor(identifier: any, count: any, replace_rules: any);
|
|
1938
|
+
identifier: any;
|
|
1939
|
+
count: any;
|
|
1940
|
+
replace_rules: any;
|
|
1941
|
+
toObject(): any;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
/**
|
|
1945
|
+
* 表示生物群系过滤条件的类
|
|
1946
|
+
*/
|
|
1947
|
+
declare class BiomeFilter {
|
|
1948
|
+
filters: any[];
|
|
1949
|
+
/**
|
|
1950
|
+
* 添加一个逻辑条件组(如 any_of, all_of)
|
|
1951
|
+
* @param {"any_of" | "all_of"} logicType - 逻辑类型
|
|
1952
|
+
* @param {Array<Object>} conditions - 条件数组
|
|
1953
|
+
* @returns {BiomeFilter} 返回自身以支持链式调用
|
|
1178
1954
|
*/
|
|
1179
|
-
|
|
1180
|
-
propagate_alpha: boolean | undefined;
|
|
1955
|
+
addLogicGroup(logicType: "any_of" | "all_of", conditions: Array<Object>): BiomeFilter;
|
|
1181
1956
|
/**
|
|
1182
|
-
*
|
|
1183
|
-
* @param {
|
|
1184
|
-
* @
|
|
1957
|
+
* 添加一个简单条件(如 has_biome_tag)
|
|
1958
|
+
* @param {string} test - 测试类型(如 "has_biome_tag")
|
|
1959
|
+
* @param {"==" | "!="} operator - 操作符
|
|
1960
|
+
* @param {string} value - 目标值(如 "overworld")
|
|
1961
|
+
* @returns {BiomeFilter} 返回自身以支持链式调用
|
|
1185
1962
|
*/
|
|
1186
|
-
|
|
1187
|
-
clips_children: boolean | undefined;
|
|
1963
|
+
addSimpleCondition(test: string, operator: "==" | "!=", value: string): BiomeFilter;
|
|
1188
1964
|
/**
|
|
1189
|
-
*
|
|
1190
|
-
* @
|
|
1191
|
-
* @returns {Control} 返回当前实例以支持链式调用
|
|
1965
|
+
* 转换为 JSON 格式
|
|
1966
|
+
* @returns {Array<Object>} 返回生物群系过滤条件数组
|
|
1192
1967
|
*/
|
|
1193
|
-
|
|
1194
|
-
|
|
1968
|
+
toObject(): Array<Object>;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
/**
|
|
1972
|
+
* 表示功能规则生成条件的类
|
|
1973
|
+
*/
|
|
1974
|
+
declare class FeatureConditions {
|
|
1975
|
+
conditions: {
|
|
1976
|
+
placement_pass: string;
|
|
1977
|
+
"minecraft:biome_filter": never[];
|
|
1978
|
+
};
|
|
1195
1979
|
/**
|
|
1196
|
-
*
|
|
1197
|
-
* @param {
|
|
1198
|
-
* @returns {
|
|
1980
|
+
* 设置生成阶段(placement_pass)
|
|
1981
|
+
* @param {string} pass - 生成阶段标识符(如 "underground_pass")
|
|
1982
|
+
* @returns {FeatureConditions} 返回自身以支持链式调用
|
|
1199
1983
|
*/
|
|
1200
|
-
|
|
1201
|
-
clip_offset: number[] | undefined;
|
|
1984
|
+
setPlacementPass(pass: string): FeatureConditions;
|
|
1202
1985
|
/**
|
|
1203
|
-
*
|
|
1204
|
-
* @param {
|
|
1205
|
-
* @returns {
|
|
1986
|
+
* 设置生物群系过滤器
|
|
1987
|
+
* @param {BiomeFilter} biomeFilter - 生物群系过滤条件对象
|
|
1988
|
+
* @returns {FeatureConditions} 返回自身以支持链式调用
|
|
1206
1989
|
*/
|
|
1207
|
-
|
|
1208
|
-
clip_state_change_event: string | undefined;
|
|
1990
|
+
setBiomeFilter(biomeFilter: BiomeFilter): FeatureConditions;
|
|
1209
1991
|
/**
|
|
1210
|
-
*
|
|
1211
|
-
* @
|
|
1212
|
-
* @returns {Control} 返回当前实例以支持链式调用
|
|
1992
|
+
* 转换为 JSON 格式
|
|
1993
|
+
* @returns {Object} 返回生成条件对象
|
|
1213
1994
|
*/
|
|
1214
|
-
|
|
1215
|
-
|
|
1995
|
+
toObject(): Object;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
/**
|
|
1999
|
+
* 表示单个坐标轴(x/y/z)分布规则的类
|
|
2000
|
+
*/
|
|
2001
|
+
declare class CoordinateDistribution {
|
|
1216
2002
|
/**
|
|
1217
|
-
*
|
|
1218
|
-
* @param {
|
|
1219
|
-
* @returns {Control} 返回当前实例以支持链式调用
|
|
2003
|
+
* @param {"uniform" | "triangle"} distribution - 分布类型
|
|
2004
|
+
* @param {Array<number>} extent - 范围(如 [0, 16])
|
|
1220
2005
|
*/
|
|
1221
|
-
|
|
1222
|
-
|
|
2006
|
+
constructor(distribution?: "uniform" | "triangle", extent?: Array<number>);
|
|
2007
|
+
distribution: "uniform" | "triangle";
|
|
2008
|
+
extent: number[];
|
|
1223
2009
|
/**
|
|
1224
|
-
*
|
|
1225
|
-
* @
|
|
1226
|
-
* @returns {Control} 返回当前实例以支持链式调用
|
|
2010
|
+
* 转换为 JSON 格式
|
|
2011
|
+
* @returns {Object} 返回坐标分布配置
|
|
1227
2012
|
*/
|
|
1228
|
-
|
|
1229
|
-
|
|
2013
|
+
toObject(): Object;
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
/**
|
|
2017
|
+
* 表示功能规则分布配置的类
|
|
2018
|
+
*/
|
|
2019
|
+
declare class FeatureDistribution {
|
|
2020
|
+
distribution: {
|
|
2021
|
+
iterations: number;
|
|
2022
|
+
coordinate_eval_order: string;
|
|
2023
|
+
x: any;
|
|
2024
|
+
y: any;
|
|
2025
|
+
z: any;
|
|
2026
|
+
};
|
|
1230
2027
|
/**
|
|
1231
|
-
*
|
|
1232
|
-
* @param {
|
|
1233
|
-
* @returns {
|
|
2028
|
+
* 设置迭代次数
|
|
2029
|
+
* @param {number} iterations - 放置尝试次数
|
|
2030
|
+
* @returns {FeatureDistribution} 返回自身以支持链式调用
|
|
1234
2031
|
*/
|
|
1235
|
-
|
|
1236
|
-
use_child_anchors: boolean | undefined;
|
|
2032
|
+
setIterations(iterations: number): FeatureDistribution;
|
|
1237
2033
|
/**
|
|
1238
|
-
*
|
|
1239
|
-
* @param {
|
|
1240
|
-
* @
|
|
2034
|
+
* 设置坐标轴的分布规则
|
|
2035
|
+
* @param {"x" | "y" | "z"} axis - 坐标轴
|
|
2036
|
+
* @param {CoordinateDistribution} config - 分布配置
|
|
2037
|
+
* @returns {FeatureDistribution} 返回自身以支持链式调用
|
|
1241
2038
|
*/
|
|
1242
|
-
|
|
1243
|
-
controls: any[] | undefined;
|
|
2039
|
+
setAxisDistribution(axis: "x" | "y" | "z", config: CoordinateDistribution): FeatureDistribution;
|
|
1244
2040
|
/**
|
|
1245
|
-
*
|
|
1246
|
-
* @
|
|
1247
|
-
* @returns {Control} 返回当前实例以支持链式调用
|
|
2041
|
+
* 转换为 JSON 格式
|
|
2042
|
+
* @returns {Object} 返回分布规则对象
|
|
1248
2043
|
*/
|
|
1249
|
-
|
|
1250
|
-
|
|
2044
|
+
toObject(): Object;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
declare class FeatureRule {
|
|
2048
|
+
constructor(identifier: any, places_feature: any);
|
|
2049
|
+
identifier: any;
|
|
2050
|
+
places_feature: any;
|
|
2051
|
+
condition: FeatureConditions;
|
|
2052
|
+
distribution: FeatureDistribution;
|
|
2053
|
+
setPlacementPass(pass: any): void;
|
|
2054
|
+
setBiomeFilter(biomeFilter: any): void;
|
|
2055
|
+
setIterations(iterations: any): void;
|
|
2056
|
+
setAxisDistribution(axis: any, config: any): void;
|
|
2057
|
+
toObject(): any;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
declare class OreBlock {
|
|
2061
|
+
constructor(identifier: any, category: any, textures_arr: any, options?: {});
|
|
2062
|
+
block: BasicBlock;
|
|
2063
|
+
feature: OreFeature;
|
|
2064
|
+
feature_rules: FeatureRule;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
declare class CropBlock extends Block {
|
|
2068
|
+
stageNum: number;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
declare namespace BlockAPI {
|
|
2072
|
+
function createBasicBlock(identifier: string, category: string, textures_arr: any[], options?: {
|
|
2073
|
+
group: string;
|
|
2074
|
+
hide_in_command: boolean;
|
|
2075
|
+
}): BasicBlock;
|
|
2076
|
+
function createBlock(identifier: string, category: string, variantDatas: any[], options?: {
|
|
2077
|
+
group: string;
|
|
2078
|
+
hide_in_command: boolean;
|
|
2079
|
+
ambient_occlusion: boolean;
|
|
2080
|
+
face_dimming: boolean;
|
|
2081
|
+
render_method: string;
|
|
2082
|
+
}): Block;
|
|
2083
|
+
function createRotatableBlock(identifier: string, category: string, textures_arr: any[], options?: {
|
|
2084
|
+
group: string;
|
|
2085
|
+
hide_in_command: boolean;
|
|
2086
|
+
rotationType: string;
|
|
2087
|
+
yRotationOffset: number;
|
|
2088
|
+
}): RotatableBlock;
|
|
2089
|
+
function createGeometryBlock(identifier: any, category: any, geometry: any, material_instances: any, options?: {}): GeometryBlock;
|
|
2090
|
+
function createOreBlock(identifier: any, category: any, textures_arr: any, options?: {}): OreBlock;
|
|
2091
|
+
function createCropBlock(identifier: string, category: string, variantDatas: any[], options?: {
|
|
2092
|
+
group: string;
|
|
2093
|
+
hide_in_command: boolean;
|
|
2094
|
+
ambient_occlusion: boolean;
|
|
2095
|
+
face_dimming: boolean;
|
|
2096
|
+
render_method: string;
|
|
2097
|
+
}): CropBlock;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
declare namespace FeatureAPI {
|
|
2101
|
+
function createOreFeature(identifier: any, count: any, replace_rules: any): OreFeature;
|
|
2102
|
+
function createFeatureRules(identifier: any, places_feature: any): FeatureRule;
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
declare class BasicEntity {
|
|
1251
2106
|
/**
|
|
1252
|
-
*
|
|
1253
|
-
* @param {
|
|
1254
|
-
* @
|
|
2107
|
+
* 构造函数
|
|
2108
|
+
* @param {string} identifier - 实体的唯一标识符
|
|
2109
|
+
* @param {Object} options - 配置选项
|
|
2110
|
+
* @param {boolean} [options.is_spawnable=true] - 是否可生成
|
|
2111
|
+
* @param {boolean} [options.is_summonable=true] - 是否可召唤
|
|
2112
|
+
* @param {string} [options.runtime_identifier] - 复刻标识符
|
|
2113
|
+
* @param {Object} data - 继承的数据
|
|
2114
|
+
* @param {Object} [data.components={}] - 继承的组件
|
|
2115
|
+
* @param {Object} [data.component_groups={}] - 继承的组件组
|
|
2116
|
+
* @param {Object} [data.events={}] - 继承的事件
|
|
1255
2117
|
*/
|
|
1256
|
-
|
|
1257
|
-
|
|
2118
|
+
constructor(identifier: string, options?: {
|
|
2119
|
+
is_spawnable?: boolean | undefined;
|
|
2120
|
+
is_summonable?: boolean | undefined;
|
|
2121
|
+
runtime_identifier?: string | undefined;
|
|
2122
|
+
}, data?: {
|
|
2123
|
+
components?: Object | undefined;
|
|
2124
|
+
component_groups?: Object | undefined;
|
|
2125
|
+
events?: Object | undefined;
|
|
2126
|
+
});
|
|
2127
|
+
identifier: string;
|
|
2128
|
+
is_spawnable: boolean;
|
|
2129
|
+
is_summonable: boolean;
|
|
2130
|
+
runtime_identifier: string | undefined;
|
|
2131
|
+
properties: any;
|
|
2132
|
+
components: Map<string, any>;
|
|
2133
|
+
component_groups: Map<string, any>;
|
|
2134
|
+
events: Map<string, any>;
|
|
1258
2135
|
/**
|
|
1259
|
-
*
|
|
1260
|
-
* @param {string} name
|
|
1261
|
-
* @
|
|
2136
|
+
* 添加属性到实体
|
|
2137
|
+
* @param {string} name 属性名称
|
|
2138
|
+
* @param {Object} value 属性值
|
|
2139
|
+
* @returns
|
|
1262
2140
|
*/
|
|
1263
|
-
|
|
1264
|
-
animation_reset_name: string | undefined;
|
|
2141
|
+
addProperty(name: string, value: Object): this;
|
|
1265
2142
|
/**
|
|
1266
|
-
*
|
|
1267
|
-
* @param {
|
|
1268
|
-
* @returns
|
|
2143
|
+
* 移除属性
|
|
2144
|
+
* @param {string} name 属性名称
|
|
2145
|
+
* @returns
|
|
1269
2146
|
*/
|
|
1270
|
-
|
|
1271
|
-
ignored: boolean | undefined;
|
|
2147
|
+
removeProperty(name: string): this;
|
|
1272
2148
|
/**
|
|
1273
|
-
*
|
|
1274
|
-
* @
|
|
1275
|
-
* @returns {Control} 返回当前实例以支持链式调用
|
|
2149
|
+
* 移除所有属性
|
|
2150
|
+
* @returns
|
|
1276
2151
|
*/
|
|
1277
|
-
|
|
1278
|
-
variables: object | undefined;
|
|
2152
|
+
clearProperties(): this;
|
|
1279
2153
|
/**
|
|
1280
|
-
*
|
|
1281
|
-
* @param {
|
|
1282
|
-
* @
|
|
2154
|
+
* 添加事件到实体
|
|
2155
|
+
* @param {string} name - 事件名称
|
|
2156
|
+
* @param {Map} eventMap - 事件的键值对 Map
|
|
2157
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
1283
2158
|
*/
|
|
1284
|
-
|
|
1285
|
-
modifications: any;
|
|
2159
|
+
addEvent(name: string, eventMap: Map<any, any>): BasicEntity;
|
|
1286
2160
|
/**
|
|
1287
|
-
*
|
|
1288
|
-
* @param {
|
|
1289
|
-
* @returns {
|
|
2161
|
+
* 删除事件
|
|
2162
|
+
* @param {string} name - 事件名称
|
|
2163
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
1290
2164
|
*/
|
|
1291
|
-
|
|
1292
|
-
grid_position: number[] | undefined;
|
|
2165
|
+
removeEvent(name: string): BasicEntity;
|
|
1293
2166
|
/**
|
|
1294
|
-
*
|
|
1295
|
-
* @
|
|
1296
|
-
* @returns {Control} 返回当前实例以支持链式调用
|
|
2167
|
+
* 清除所有事件
|
|
2168
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
1297
2169
|
*/
|
|
1298
|
-
|
|
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 {
|
|
2170
|
+
clearEvents(): BasicEntity;
|
|
1350
2171
|
/**
|
|
1351
|
-
*
|
|
1352
|
-
* @param {string}
|
|
1353
|
-
* @
|
|
2172
|
+
* 添加组件组到实体
|
|
2173
|
+
* @param {string} name - 组件组名称
|
|
2174
|
+
* @param {Map} componentMap - 组件组的键值对 Map
|
|
2175
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
1354
2176
|
*/
|
|
1355
|
-
|
|
1356
|
-
texture: string | undefined;
|
|
2177
|
+
addComponentGroup(name: string, componentMap: Map<any, any>): BasicEntity;
|
|
1357
2178
|
/**
|
|
1358
|
-
*
|
|
1359
|
-
* @param {
|
|
1360
|
-
* @returns {
|
|
2179
|
+
* 删除组件组
|
|
2180
|
+
* @param {string} name - 组件组名称
|
|
2181
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
1361
2182
|
*/
|
|
1362
|
-
|
|
1363
|
-
allow_debug_missing_texture: boolean | undefined;
|
|
2183
|
+
removeComponentGroup(name: string): BasicEntity;
|
|
1364
2184
|
/**
|
|
1365
|
-
*
|
|
1366
|
-
* @
|
|
1367
|
-
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2185
|
+
* 清除所有组件组
|
|
2186
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
1368
2187
|
*/
|
|
1369
|
-
|
|
1370
|
-
uv: number[] | undefined;
|
|
2188
|
+
clearComponentGroups(): BasicEntity;
|
|
1371
2189
|
/**
|
|
1372
|
-
*
|
|
1373
|
-
* @param {
|
|
1374
|
-
* @returns {
|
|
2190
|
+
* 添加组件到实体
|
|
2191
|
+
* @param {Map} componentMap - 组件的键值对 Map
|
|
2192
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
1375
2193
|
*/
|
|
1376
|
-
|
|
1377
|
-
uv_size: number[] | undefined;
|
|
2194
|
+
addComponent(componentMap: Map<any, any>): BasicEntity;
|
|
1378
2195
|
/**
|
|
1379
|
-
*
|
|
1380
|
-
* @param {string}
|
|
1381
|
-
* @returns {
|
|
2196
|
+
* 删除组件
|
|
2197
|
+
* @param {string} key - 组件名称
|
|
2198
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
1382
2199
|
*/
|
|
1383
|
-
|
|
1384
|
-
texture_file_system: string | undefined;
|
|
2200
|
+
removeComponent(key: string): BasicEntity;
|
|
1385
2201
|
/**
|
|
1386
|
-
*
|
|
1387
|
-
* @
|
|
1388
|
-
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2202
|
+
* 清除所有组件
|
|
2203
|
+
* @returns {BasicEntity} - 返回当前实例以支持链式调用
|
|
1389
2204
|
*/
|
|
1390
|
-
|
|
1391
|
-
nineslice_size: number | number[] | undefined;
|
|
2205
|
+
clearComponents(): BasicEntity;
|
|
1392
2206
|
/**
|
|
1393
|
-
*
|
|
1394
|
-
* @param {boolean|string} tiled - 是否平铺纹理(可能值:true/false, x, y)
|
|
1395
|
-
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2207
|
+
* 清除所有数据
|
|
1396
2208
|
*/
|
|
1397
|
-
|
|
1398
|
-
tiled: string | boolean | undefined;
|
|
2209
|
+
clearAll(): this;
|
|
1399
2210
|
/**
|
|
1400
|
-
*
|
|
1401
|
-
* @
|
|
1402
|
-
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
2211
|
+
* 将实体转换为 JSON 格式
|
|
2212
|
+
* @returns {Object} - 返回 JSON 格式的实体数据
|
|
1403
2213
|
*/
|
|
1404
|
-
|
|
1405
|
-
|
|
2214
|
+
toObject(): Object;
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
declare class AddonClientEntityDescription {
|
|
1406
2218
|
/**
|
|
1407
|
-
*
|
|
1408
|
-
* @param {string}
|
|
1409
|
-
* @
|
|
2219
|
+
* 实体描述类
|
|
2220
|
+
* @param {string} identifier 实体标识符
|
|
2221
|
+
* @param {string} min_engine_version 最低引擎版本
|
|
1410
2222
|
*/
|
|
1411
|
-
|
|
1412
|
-
|
|
2223
|
+
constructor(identifier: string, min_engine_version: string);
|
|
2224
|
+
identifier: string;
|
|
2225
|
+
min_engine_version: string;
|
|
1413
2226
|
/**
|
|
1414
|
-
*
|
|
1415
|
-
* @param {
|
|
1416
|
-
* @
|
|
2227
|
+
* 注册粒子效果
|
|
2228
|
+
* @param {string} name 组件名称
|
|
2229
|
+
* @param {Object} component 组件数据
|
|
2230
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
2231
|
+
*/
|
|
2232
|
+
addParticleEffect(name: string, particle: any): AddonClientEntityDescription;
|
|
2233
|
+
particle_effects: {} | undefined;
|
|
2234
|
+
/**
|
|
2235
|
+
* 添加材质
|
|
2236
|
+
* @param {string} name 材质名称
|
|
2237
|
+
* @param {string} material 材质路径
|
|
2238
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
1417
2239
|
*/
|
|
1418
|
-
|
|
1419
|
-
|
|
2240
|
+
addMaterial(name: string, material: string): AddonClientEntityDescription;
|
|
2241
|
+
materials: {} | undefined;
|
|
1420
2242
|
/**
|
|
1421
|
-
*
|
|
1422
|
-
* @param {
|
|
1423
|
-
* @
|
|
2243
|
+
* 添加纹理
|
|
2244
|
+
* @param {string} name 纹理名称
|
|
2245
|
+
* @param {string} texture 纹理路径
|
|
2246
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
1424
2247
|
*/
|
|
1425
|
-
|
|
1426
|
-
|
|
2248
|
+
addTexture(name: string, texture: string): AddonClientEntityDescription;
|
|
2249
|
+
textures: {} | undefined;
|
|
1427
2250
|
/**
|
|
1428
|
-
*
|
|
1429
|
-
* @param {
|
|
1430
|
-
* @
|
|
2251
|
+
* 添加几何体
|
|
2252
|
+
* @param {string} name 几何体名称
|
|
2253
|
+
* @param {string} geometry 几何体路径
|
|
2254
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
1431
2255
|
*/
|
|
1432
|
-
|
|
1433
|
-
|
|
2256
|
+
addGeometry(name: string, geometry: string): AddonClientEntityDescription;
|
|
2257
|
+
geometry: {} | undefined;
|
|
1434
2258
|
/**
|
|
1435
|
-
*
|
|
1436
|
-
* @param {
|
|
1437
|
-
* @
|
|
2259
|
+
* 添加动画
|
|
2260
|
+
* @param {string} name 动画名称
|
|
2261
|
+
* @param {string} animation 动画路径
|
|
2262
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
1438
2263
|
*/
|
|
1439
|
-
|
|
1440
|
-
|
|
2264
|
+
addAnimation(name: string, animation: string): AddonClientEntityDescription;
|
|
2265
|
+
animations: {} | undefined;
|
|
1441
2266
|
/**
|
|
1442
|
-
*
|
|
1443
|
-
* @param {
|
|
1444
|
-
* @
|
|
2267
|
+
* 添加动画控制器
|
|
2268
|
+
* @param {string} name 控制器名称
|
|
2269
|
+
* @param {string} controller 控制器路径
|
|
2270
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
1445
2271
|
*/
|
|
1446
|
-
|
|
1447
|
-
|
|
2272
|
+
addAnimationController(name: string, controller: string): AddonClientEntityDescription;
|
|
2273
|
+
animation_controllers: any[] | undefined;
|
|
1448
2274
|
/**
|
|
1449
|
-
*
|
|
1450
|
-
* @param {
|
|
1451
|
-
* @returns {
|
|
2275
|
+
* 添加渲染控制器
|
|
2276
|
+
* @param {string} controller 渲染控制器路径
|
|
2277
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
1452
2278
|
*/
|
|
1453
|
-
|
|
1454
|
-
|
|
2279
|
+
addRenderController(controller: string): AddonClientEntityDescription;
|
|
2280
|
+
render_controllers: any[] | undefined;
|
|
1455
2281
|
/**
|
|
1456
|
-
*
|
|
1457
|
-
* @param {string}
|
|
1458
|
-
* @
|
|
2282
|
+
* 添加定位器
|
|
2283
|
+
* @param {string} name 定位器名称
|
|
2284
|
+
* @param {Object} locator 定位器数据
|
|
2285
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
1459
2286
|
*/
|
|
1460
|
-
|
|
1461
|
-
|
|
2287
|
+
addLocator(name: string, locator: Object): AddonClientEntityDescription;
|
|
2288
|
+
locators: {} | undefined;
|
|
1462
2289
|
/**
|
|
1463
|
-
*
|
|
1464
|
-
* @param {
|
|
1465
|
-
* @
|
|
2290
|
+
* 设置生成蛋
|
|
2291
|
+
* @param {string} texture 生成蛋纹理
|
|
2292
|
+
* @param {number} texture_index 生成蛋纹理索引
|
|
2293
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
1466
2294
|
*/
|
|
1467
|
-
|
|
1468
|
-
|
|
2295
|
+
setSpawnEgg(texture: string, texture_index: number): AddonClientEntityDescription;
|
|
2296
|
+
spawn_egg: {
|
|
2297
|
+
texture: string;
|
|
2298
|
+
texture_index: number;
|
|
2299
|
+
} | undefined;
|
|
1469
2300
|
/**
|
|
1470
|
-
*
|
|
1471
|
-
* @param {
|
|
1472
|
-
* @
|
|
2301
|
+
* 设置脚本
|
|
2302
|
+
* @param {string} key 脚本键
|
|
2303
|
+
* @param {string} value 脚本值
|
|
2304
|
+
* @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
|
|
1473
2305
|
*/
|
|
1474
|
-
|
|
1475
|
-
|
|
2306
|
+
setScript(key: string, value: string): AddonClientEntityDescription;
|
|
2307
|
+
scripts: {} | undefined;
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
/**
|
|
2311
|
+
* ClientEntity 类,用于表示客户端实体。
|
|
2312
|
+
* 继承自 AddonClientEntityDescription,并扩展了实体的数据加载和 JSON 序列化功能。
|
|
2313
|
+
*/
|
|
2314
|
+
declare class ClientEntity extends AddonClientEntityDescription {
|
|
2315
|
+
/**
|
|
2316
|
+
* 构造函数,用于创建一个客户端实体实例。
|
|
2317
|
+
*
|
|
2318
|
+
* @param {string} identifier - 实体的唯一标识符。
|
|
2319
|
+
* @param {Object} data - 实体的初始数据,默认为空对象。
|
|
2320
|
+
*/
|
|
2321
|
+
constructor(identifier: string, data?: Object);
|
|
1476
2322
|
/**
|
|
1477
|
-
*
|
|
1478
|
-
*
|
|
1479
|
-
* @returns {
|
|
2323
|
+
* 将当前实体实例转换为 JSON 格式。
|
|
2324
|
+
*
|
|
2325
|
+
* @returns {Object} - 表示实体的 JSON 对象。
|
|
1480
2326
|
*/
|
|
1481
|
-
|
|
1482
|
-
base_size: number[] | undefined;
|
|
2327
|
+
toObject(): Object;
|
|
1483
2328
|
}
|
|
1484
2329
|
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
declare class
|
|
2330
|
+
declare namespace EntityAPI {
|
|
2331
|
+
function createNativeEntity(identifier: string, proto_id: string, options?: Object): {
|
|
2332
|
+
behavior: BasicEntity;
|
|
2333
|
+
resource: ClientEntity;
|
|
2334
|
+
};
|
|
2335
|
+
function createEntity(identifier: string, texture: string, behData: Object, resData: Object, options?: Object): {
|
|
2336
|
+
behavior: BasicEntity;
|
|
2337
|
+
resource: ClientEntity;
|
|
2338
|
+
};
|
|
2339
|
+
function createProjectile(identifier: string, texture: string, options?: Object): {
|
|
2340
|
+
behavior: BasicEntity;
|
|
2341
|
+
resource: ClientEntity;
|
|
2342
|
+
};
|
|
2343
|
+
function createDummyEntity(identifier: string, texture: string, options: Object | undefined, behData: Object, resData: Object): {
|
|
2344
|
+
behavior: BasicEntity;
|
|
2345
|
+
resource: ClientEntity;
|
|
2346
|
+
};
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
declare class AddonRecipe {
|
|
2350
|
+
constructor(format_version: any, recipe_type: any, definitions?: {});
|
|
2351
|
+
format_version: any;
|
|
2352
|
+
recipe_type: any;
|
|
2353
|
+
definitions: {};
|
|
2354
|
+
getId(): any;
|
|
2355
|
+
identifier(identifier: any): this;
|
|
2356
|
+
tags(tags: any): this;
|
|
2357
|
+
toObject(): {
|
|
2358
|
+
format_version: any;
|
|
2359
|
+
};
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
declare class AddonRecipeFurnace extends AddonRecipe {
|
|
1505
2363
|
/**
|
|
1506
|
-
*
|
|
1507
|
-
* @param {any
|
|
1508
|
-
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2364
|
+
* @param {'1.12'|'1.17'} ver
|
|
2365
|
+
* @param {any} def
|
|
1509
2366
|
*/
|
|
1510
|
-
|
|
1511
|
-
|
|
2367
|
+
static create(ver: "1.12" | "1.17", def: any): AddonRecipeFurnace;
|
|
2368
|
+
constructor(format_version: any, definitions: any);
|
|
2369
|
+
input(item: any, data: any, count: any): this;
|
|
2370
|
+
output(item: any): this;
|
|
2371
|
+
}
|
|
2372
|
+
declare class AddonRecipeFurnace_1_17 extends AddonRecipeFurnace {
|
|
2373
|
+
constructor(definitions?: {});
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
declare class AddonRecipeShaped extends AddonRecipe {
|
|
1512
2377
|
/**
|
|
1513
|
-
*
|
|
1514
|
-
* @param {
|
|
1515
|
-
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2378
|
+
* @param {'1.12'|'1.17'|'1.19'|'1.20'} ver
|
|
2379
|
+
* @param {any} def
|
|
1516
2380
|
*/
|
|
1517
|
-
|
|
1518
|
-
|
|
2381
|
+
static create(ver: "1.12" | "1.17" | "1.19" | "1.20", def: any): AddonRecipeShaped;
|
|
2382
|
+
constructor(format_version: any, definitions: any);
|
|
2383
|
+
assumeSymmetry(): void;
|
|
2384
|
+
key(key: any): this;
|
|
2385
|
+
pattern(pattern: any): this;
|
|
2386
|
+
priority(priority: any): this;
|
|
2387
|
+
output(item: any): this;
|
|
2388
|
+
}
|
|
2389
|
+
declare class AddonRecipeShaped_1_20 extends AddonRecipeShaped {
|
|
2390
|
+
constructor(definitions: any);
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
declare class AddonRecipeShapeless extends AddonRecipe {
|
|
1519
2394
|
/**
|
|
1520
|
-
*
|
|
1521
|
-
* @param {
|
|
1522
|
-
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2395
|
+
* @param {'1.12'|'1.17'} ver
|
|
2396
|
+
* @param {any} def
|
|
1523
2397
|
*/
|
|
1524
|
-
|
|
1525
|
-
|
|
2398
|
+
static create(ver: "1.12" | "1.17", def: any): AddonRecipeShapeless;
|
|
2399
|
+
constructor(format_version: any, definitions: any);
|
|
2400
|
+
priority(priority: any): this;
|
|
2401
|
+
ingredients(ingredients: any): this;
|
|
2402
|
+
output(item: any): this;
|
|
2403
|
+
}
|
|
2404
|
+
declare class AddonRecipeShapeless_1_17 extends AddonRecipeShapeless {
|
|
2405
|
+
constructor(definitions: any);
|
|
2406
|
+
}
|
|
2407
|
+
|
|
2408
|
+
declare const RecipeAPI: RecipeRegistry;
|
|
2409
|
+
declare class RecipeRegistry {
|
|
1526
2410
|
/**
|
|
1527
|
-
*
|
|
1528
|
-
* @param {
|
|
1529
|
-
* @returns {Layout} 返回当前实例以支持链式调用
|
|
2411
|
+
*
|
|
2412
|
+
* @param {AddonRecipeFurnace_1_17} recipe
|
|
1530
2413
|
*/
|
|
1531
|
-
|
|
1532
|
-
|
|
2414
|
+
registerRecipe(recipe: AddonRecipeFurnace_1_17): void;
|
|
2415
|
+
registerSimpleFurnace(identifier: any, output: any, input: any): AddonRecipeFurnace_1_17;
|
|
2416
|
+
registerFurnace(identifier: any): AddonRecipeFurnace_1_17;
|
|
2417
|
+
registerSimpleShaped(identifier: any, output: any, pattern: any, key: any): AddonRecipeShaped_1_20;
|
|
2418
|
+
registerShaped(identifier: any): AddonRecipeShaped_1_20;
|
|
2419
|
+
registerSimpleShapeless(identifier: any, output: any, ingredients: any): AddonRecipeShapeless_1_17;
|
|
2420
|
+
registerShapeless(identifier: any): AddonRecipeShapeless_1_17;
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2423
|
+
declare class BlockComponent {
|
|
2424
|
+
static setTick(interval_range: any, looping: any): Map<any, any>;
|
|
1533
2425
|
/**
|
|
1534
|
-
*
|
|
1535
|
-
* @param {
|
|
1536
|
-
* @returns
|
|
2426
|
+
*
|
|
2427
|
+
* @param {Array} custom_components
|
|
2428
|
+
* @returns
|
|
1537
2429
|
*/
|
|
1538
|
-
|
|
1539
|
-
anchor_from: string | undefined;
|
|
2430
|
+
static setCustomComponents(custom_components: any[]): Map<any, any>;
|
|
1540
2431
|
/**
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
2432
|
+
* 创建一个用于 Minecraft 方块的变换对象,并返回一个 Map。
|
|
2433
|
+
* @param {number[]} [translation=[0, 0, 0]] - 平移向量 [x, y, z]。
|
|
2434
|
+
* @param {number[]} [scale=[1, 1, 1]] - 缩放向量 [x, y, z]。
|
|
2435
|
+
* @param {number[]} [scale_pivot=[0, 0, 0]] - 缩放的枢轴点 [x, y, z]。
|
|
2436
|
+
* @param {number[]} [rotation=[0, 0, 0]] - 旋转向量(角度)[x, y, z]。
|
|
2437
|
+
* @param {number[]} [rotation_pivot=[0, 0, 0]] - 旋转的枢轴点 [x, y, z]。
|
|
2438
|
+
* @returns {Map} - 一个包含变换数据的 Map 对象。
|
|
2439
|
+
* @throws {Error} - 如果任何参数无效,则抛出错误。
|
|
2440
|
+
*/
|
|
2441
|
+
static setTransformation(translation?: number[], scale?: number[], scale_pivot?: number[], rotation?: number[], rotation_pivot?: number[]): Map<any, any>;
|
|
1547
2442
|
/**
|
|
1548
|
-
*
|
|
1549
|
-
* @param {
|
|
1550
|
-
* @returns {
|
|
2443
|
+
* 设置方块的呼吸行为。
|
|
2444
|
+
* @param {String} value - 呼吸行为,可选值为 "solid" 或 "air"。
|
|
2445
|
+
* @returns {Map} - 新的组件集合。
|
|
1551
2446
|
*/
|
|
1552
|
-
|
|
1553
|
-
inherit_max_sibling_width: boolean | undefined;
|
|
2447
|
+
static setBreathability(value: string): Map<any, any>;
|
|
1554
2448
|
/**
|
|
1555
|
-
*
|
|
1556
|
-
* @param {
|
|
1557
|
-
* @returns {
|
|
2449
|
+
* 启用或禁用方块的碰撞箱。
|
|
2450
|
+
* @param {Boolean} enabled - 是否启用碰撞箱。
|
|
2451
|
+
* @returns {Map} - 新的组件集合。
|
|
1558
2452
|
*/
|
|
1559
|
-
|
|
1560
|
-
inherit_max_sibling_height: boolean | undefined;
|
|
2453
|
+
static setCollisionBoxEnabled(enabled: boolean): Map<any, any>;
|
|
1561
2454
|
/**
|
|
1562
|
-
*
|
|
1563
|
-
* @param {
|
|
1564
|
-
* @
|
|
2455
|
+
* 设置自定义的碰撞箱。
|
|
2456
|
+
* @param {Array} origin - 碰撞箱的起点坐标 [x, y, z]。
|
|
2457
|
+
* @param {Array} size - 碰撞箱的大小 [width, height, depth]。
|
|
2458
|
+
* @returns {Map} - 新的组件集合。
|
|
1565
2459
|
*/
|
|
1566
|
-
|
|
1567
|
-
use_anchored_offset: boolean | undefined;
|
|
2460
|
+
static setCollisionBoxCustom(origin: any[], size: any[]): Map<any, any>;
|
|
1568
2461
|
/**
|
|
1569
|
-
*
|
|
1570
|
-
* @param {
|
|
1571
|
-
* @
|
|
2462
|
+
* 设置方块的合成台属性。
|
|
2463
|
+
* @param {Array} craftingTags - 合成标签。
|
|
2464
|
+
* @param {String} tableName - 合成台名称。
|
|
2465
|
+
* @returns {Map} - 新的组件集合。
|
|
1572
2466
|
*/
|
|
1573
|
-
|
|
1574
|
-
contained: boolean | undefined;
|
|
2467
|
+
static setCraftingTable(craftingTags: any[], tableName: string): Map<any, any>;
|
|
1575
2468
|
/**
|
|
1576
|
-
*
|
|
1577
|
-
* @param {
|
|
1578
|
-
* @returns {
|
|
2469
|
+
* 启用或禁用方块的爆炸抗性。
|
|
2470
|
+
* @param {Boolean} enabled - 是否启用爆炸抗性。
|
|
2471
|
+
* @returns {Map} - 新的组件集合。
|
|
1579
2472
|
*/
|
|
1580
|
-
|
|
1581
|
-
draggable: string | undefined;
|
|
2473
|
+
static setDestructibleByExplosionEnabled(enabled: boolean): Map<any, any>;
|
|
1582
2474
|
/**
|
|
1583
|
-
*
|
|
1584
|
-
* @param {
|
|
1585
|
-
* @returns {
|
|
2475
|
+
* 设置自定义的爆炸抗性。
|
|
2476
|
+
* @param {Number} explosionResistance - 爆炸抗性值。
|
|
2477
|
+
* @returns {Map} - 新的组件集合。
|
|
1586
2478
|
*/
|
|
1587
|
-
|
|
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 {
|
|
2479
|
+
static setDestructibleByExplosionCustom(explosionResistance: number): Map<any, any>;
|
|
1608
2480
|
/**
|
|
1609
|
-
*
|
|
1610
|
-
* @param {
|
|
1611
|
-
* @returns {
|
|
2481
|
+
* 启用或禁用方块的挖掘抗性。
|
|
2482
|
+
* @param {Boolean} enabled - 是否启用挖掘抗性。
|
|
2483
|
+
* @returns {Map} - 新的组件集合。
|
|
1612
2484
|
*/
|
|
1613
|
-
|
|
1614
|
-
factory: {} | undefined;
|
|
2485
|
+
static setDestructibleByMiningEnabled(enabled: boolean): Map<any, any>;
|
|
1615
2486
|
/**
|
|
1616
|
-
*
|
|
1617
|
-
* @param {
|
|
1618
|
-
* @
|
|
2487
|
+
* 设置自定义的挖掘抗性。
|
|
2488
|
+
* @param {Number} secondsToDestroy - 破坏所需时间(秒)。
|
|
2489
|
+
* @param {Array} itemSpecificSpeeds - 特定工具的挖掘速度。
|
|
2490
|
+
* @returns {Map} - 新的组件集合。
|
|
1619
2491
|
*/
|
|
1620
|
-
|
|
2492
|
+
static setDestructibleByMiningCustom(secondsToDestroy: number, itemSpecificSpeeds: any[]): Map<any, any>;
|
|
1621
2493
|
/**
|
|
1622
|
-
*
|
|
1623
|
-
* @param {
|
|
1624
|
-
* @returns {
|
|
2494
|
+
* 设置方块的显示名称。
|
|
2495
|
+
* @param {String} displayName - 显示名称。
|
|
2496
|
+
* @returns {Map} - 新的组件集合。
|
|
1625
2497
|
*/
|
|
1626
|
-
|
|
2498
|
+
static setDisplayName(displayName: string): Map<any, any>;
|
|
1627
2499
|
/**
|
|
1628
|
-
*
|
|
1629
|
-
* @param {
|
|
1630
|
-
* @
|
|
1631
|
-
* @returns {Factory} 返回当前实例以支持链式调用
|
|
2500
|
+
* 启用或禁用方块的易燃性。
|
|
2501
|
+
* @param {Boolean} enabled - 是否启用易燃性。
|
|
2502
|
+
* @returns {Map} - 新的组件集合。
|
|
1632
2503
|
*/
|
|
1633
|
-
|
|
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 {
|
|
2504
|
+
static setFlammableEnabled(enabled: boolean): Map<any, any>;
|
|
1676
2505
|
/**
|
|
1677
|
-
*
|
|
1678
|
-
* @param {
|
|
1679
|
-
* @
|
|
2506
|
+
* 设置自定义的易燃性。
|
|
2507
|
+
* @param {Number} catchChanceModifier - 着火概率。
|
|
2508
|
+
* @param {Number} destroyChanceModifier - 被火焰摧毁的概率。
|
|
2509
|
+
* @returns {Map} - 新的组件集合。
|
|
1680
2510
|
*/
|
|
1681
|
-
|
|
1682
|
-
text: string | undefined;
|
|
2511
|
+
static setFlammableCustom(catchChanceModifier: number, destroyChanceModifier: number): Map<any, any>;
|
|
1683
2512
|
/**
|
|
1684
|
-
*
|
|
1685
|
-
* @param {
|
|
1686
|
-
* @returns {
|
|
2513
|
+
* 设置方块的摩擦力。
|
|
2514
|
+
* @param {Number} value - 摩擦力值,范围为 0.0 到 0.9。
|
|
2515
|
+
* @returns {Map} - 新的组件集合。
|
|
1687
2516
|
*/
|
|
1688
|
-
|
|
1689
|
-
color: number[] | undefined;
|
|
2517
|
+
static setFriction(value: number): Map<any, any>;
|
|
1690
2518
|
/**
|
|
1691
|
-
*
|
|
1692
|
-
* @param {
|
|
1693
|
-
* @
|
|
2519
|
+
* 设置方块的几何模型。
|
|
2520
|
+
* @param {String} identifier - 几何模型标识符。
|
|
2521
|
+
* @param {Object} bone_visibility - 骨骼可见性配置。
|
|
2522
|
+
* @returns {Map} - 新的组件集合。
|
|
1694
2523
|
*/
|
|
1695
|
-
|
|
1696
|
-
locked_color: number[] | undefined;
|
|
2524
|
+
static setGeometry(identifier: string, bone_visibility: Object): Map<any, any>;
|
|
1697
2525
|
/**
|
|
1698
|
-
*
|
|
1699
|
-
* @param {
|
|
1700
|
-
* @
|
|
2526
|
+
* 设置方块的物品视觉属性。
|
|
2527
|
+
* @param {String} geometry - 几何模型标识符。
|
|
2528
|
+
* @param {Object} materialInstances - 材质实例配置。
|
|
2529
|
+
* @returns {Map} - 新的组件集合。
|
|
1701
2530
|
*/
|
|
1702
|
-
|
|
1703
|
-
shadow: boolean | undefined;
|
|
2531
|
+
static setItemVisual(geometry: string, materialInstances: Object): Map<any, any>;
|
|
1704
2532
|
/**
|
|
1705
|
-
*
|
|
1706
|
-
* @param {
|
|
1707
|
-
* @returns {
|
|
2533
|
+
* 设置方块的光衰减值。
|
|
2534
|
+
* @param {Number} value - 光的衰减值,范围为 0 到 15。
|
|
2535
|
+
* @returns {Map} - 新的组件集合。
|
|
1708
2536
|
*/
|
|
1709
|
-
|
|
1710
|
-
hide_hyphen: boolean | undefined;
|
|
2537
|
+
static setLightDampening(value: number): Map<any, any>;
|
|
1711
2538
|
/**
|
|
1712
|
-
*
|
|
1713
|
-
* @param {
|
|
1714
|
-
* @returns {
|
|
2539
|
+
* 设置方块的光照强度。
|
|
2540
|
+
* @param {Number} value - 光照强度,范围为 0 到 15。
|
|
2541
|
+
* @returns {Map} - 新的组件集合。
|
|
1715
2542
|
*/
|
|
1716
|
-
|
|
1717
|
-
notify_on_ellipses: string[] | undefined;
|
|
2543
|
+
static setLightEmission(value: number): Map<any, any>;
|
|
1718
2544
|
/**
|
|
1719
|
-
*
|
|
1720
|
-
* @param {
|
|
1721
|
-
* @
|
|
2545
|
+
* 设置方块的液体检测属性。
|
|
2546
|
+
* @param {Boolean} canContainLiquid - 是否可以包含液体。
|
|
2547
|
+
* @param {String} liquidType - 液体类型。
|
|
2548
|
+
* @param {String} onLiquidTouches - 对液体的反应方式。
|
|
2549
|
+
* @param {Array} stopsLiquidFlowingFromDirection - 阻止液体流动的方向。
|
|
2550
|
+
* @returns {Map} - 新的组件集合。
|
|
1722
2551
|
*/
|
|
1723
|
-
|
|
2552
|
+
static setLiquidDetection(canContainLiquid: boolean, liquidType: string, onLiquidTouches: string, stopsLiquidFlowingFromDirection: any[]): Map<any, any>;
|
|
1724
2553
|
/**
|
|
1725
|
-
*
|
|
1726
|
-
* @param {
|
|
1727
|
-
* @returns {
|
|
2554
|
+
* 设置方块的战利品表路径。
|
|
2555
|
+
* @param {String} path - 战利品表路径。
|
|
2556
|
+
* @returns {Map} - 新的组件集合。
|
|
1728
2557
|
*/
|
|
1729
|
-
|
|
1730
|
-
enable_profanity_filter: boolean | undefined;
|
|
2558
|
+
static setLoot(path: string): Map<any, any>;
|
|
1731
2559
|
/**
|
|
1732
|
-
*
|
|
1733
|
-
* @param {
|
|
1734
|
-
* @returns {
|
|
2560
|
+
* 设置方块的地图颜色。
|
|
2561
|
+
* @param {String|Array} value - 地图颜色,可以是十六进制字符串或 RGB 数组。
|
|
2562
|
+
* @returns {Map} - 新的组件集合。
|
|
1735
2563
|
*/
|
|
1736
|
-
|
|
1737
|
-
locked_alpha: number | undefined;
|
|
2564
|
+
static setMapColor(value: string | any[]): Map<any, any>;
|
|
1738
2565
|
/**
|
|
1739
|
-
*
|
|
1740
|
-
* @param {
|
|
1741
|
-
* @returns {
|
|
2566
|
+
* 设置方块的材质实例。
|
|
2567
|
+
* @param {Object} instances - 材质实例配置。
|
|
2568
|
+
* @returns {Map} - 新的组件集合。
|
|
1742
2569
|
*/
|
|
1743
|
-
|
|
1744
|
-
font_size: string | undefined;
|
|
2570
|
+
static setMaterialInstances(instances: Object): Map<any, any>;
|
|
1745
2571
|
/**
|
|
1746
|
-
*
|
|
1747
|
-
* @param {
|
|
1748
|
-
* @returns {
|
|
2572
|
+
* 设置方块的放置过滤条件。
|
|
2573
|
+
* @param {Array} conditions - 放置条件列表。
|
|
2574
|
+
* @returns {Map} - 新的组件集合。
|
|
1749
2575
|
*/
|
|
1750
|
-
|
|
1751
|
-
font_scale_factor: number | undefined;
|
|
2576
|
+
static setPlacementFilter(conditions: any[]): Map<any, any>;
|
|
1752
2577
|
/**
|
|
1753
|
-
*
|
|
1754
|
-
* @param {
|
|
1755
|
-
* @
|
|
2578
|
+
* 设置方块的红石导电性。
|
|
2579
|
+
* @param {Boolean} allowsWireToStepDown - 是否允许红石线向下阶梯连接。
|
|
2580
|
+
* @param {Boolean} redstoneConductor - 方块是否可以被红石信号激活。
|
|
2581
|
+
* @returns {Map} - 新的组件集合。
|
|
1756
2582
|
*/
|
|
1757
|
-
|
|
1758
|
-
localize: boolean | undefined;
|
|
2583
|
+
static setRedstoneConductivity(allowsWireToStepDown: boolean, redstoneConductor: boolean): Map<any, any>;
|
|
1759
2584
|
/**
|
|
1760
|
-
*
|
|
1761
|
-
* @param {
|
|
1762
|
-
* @returns {
|
|
2585
|
+
* 启用或禁用方块的选择框。
|
|
2586
|
+
* @param {Boolean} enabled - 是否启用选择框。
|
|
2587
|
+
* @returns {Map} - 新的组件集合。
|
|
1763
2588
|
*/
|
|
1764
|
-
|
|
1765
|
-
line_padding: number | undefined;
|
|
2589
|
+
static setSelectionBoxEnabled(enabled: boolean): Map<any, any>;
|
|
1766
2590
|
/**
|
|
1767
|
-
*
|
|
1768
|
-
* @param {
|
|
1769
|
-
* @
|
|
2591
|
+
* 设置自定义的选择框。
|
|
2592
|
+
* @param {Array} origin - 选择框的起点坐标 [x, y, z]。
|
|
2593
|
+
* @param {Array} size - 选择框的大小 [width, height, depth]。
|
|
2594
|
+
* @returns {Map} - 新的组件集合。
|
|
1770
2595
|
*/
|
|
1771
|
-
|
|
1772
|
-
font_type: string | undefined;
|
|
2596
|
+
static setSelectionBoxCustom(origin: any[], size: any[]): Map<any, any>;
|
|
1773
2597
|
/**
|
|
1774
|
-
*
|
|
1775
|
-
* @param {
|
|
1776
|
-
* @returns {
|
|
2598
|
+
* 将多个组件集合合并为一个。
|
|
2599
|
+
* @param {...Map} componentMaps - 多个组件集合。
|
|
2600
|
+
* @returns {Map} - 合并后的组件集合。
|
|
1777
2601
|
*/
|
|
1778
|
-
|
|
1779
|
-
backup_font_type: string | undefined;
|
|
2602
|
+
static combineComponents(...componentMaps: Map<any, any>[]): Map<any, any>;
|
|
1780
2603
|
/**
|
|
1781
|
-
*
|
|
1782
|
-
* @param {
|
|
1783
|
-
* @returns {
|
|
2604
|
+
* 获取当前组件的 JSON 表示。
|
|
2605
|
+
* @param {Map} components - 组件集合。
|
|
2606
|
+
* @returns {Object} - 组件的 JSON 对象。
|
|
1784
2607
|
*/
|
|
1785
|
-
|
|
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
|
-
};
|
|
2608
|
+
static toJSON(components: Map<any, any>): Object;
|
|
1814
2609
|
}
|
|
1815
2610
|
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
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 {
|
|
2611
|
+
declare class ItemComponent {
|
|
2612
|
+
/**
|
|
2613
|
+
* 物品的耐久度组件
|
|
2614
|
+
* @param {number} max_durability 最大耐久
|
|
2615
|
+
* @param {number} damage_chance_min 损坏最小几率
|
|
2616
|
+
* @param {number} damage_chance_max 损坏最大几率
|
|
2617
|
+
* @returns {ItemComponent}
|
|
2618
|
+
*/
|
|
2619
|
+
static setDurability(max_durability: number, damage_chance_min?: number, damage_chance_max?: number): ItemComponent;
|
|
2620
|
+
static setBlockPlacer(block: any, replace_block_item: any, use_on: any): Map<any, any>;
|
|
1835
2621
|
/**
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
2622
|
+
*
|
|
2623
|
+
* @param {Array} custom_components
|
|
2624
|
+
* @returns
|
|
2625
|
+
*/
|
|
2626
|
+
static setCustomComponents(custom_components: any[]): Map<any, any>;
|
|
2627
|
+
/**
|
|
2628
|
+
* 设置物品的可投掷组件。
|
|
2629
|
+
* @param {Boolean} doSwingAnimation - 是否使用挥动动画。
|
|
2630
|
+
* @param {Number} launchPowerScale - 投掷力量的缩放比例。
|
|
2631
|
+
* @param {Number} maxDrawDuration - 最大蓄力时间。
|
|
2632
|
+
* @param {Number} maxLaunchPower - 最大投掷力量。
|
|
2633
|
+
* @param {Number} minDrawDuration - 最小蓄力时间。
|
|
2634
|
+
* @param {Boolean} scalePowerByDrawDuration - 投掷力量是否随蓄力时间增加。
|
|
2635
|
+
* @returns {Map} - 新的组件集合。
|
|
1839
2636
|
*/
|
|
1840
|
-
|
|
1841
|
-
ignored: boolean | undefined;
|
|
2637
|
+
static setThrowable(doSwingAnimation?: boolean, launchPowerScale?: number, maxDrawDuration?: number, maxLaunchPower?: number, minDrawDuration?: number, scalePowerByDrawDuration?: boolean): Map<any, any>;
|
|
1842
2638
|
/**
|
|
1843
|
-
*
|
|
1844
|
-
* @param {
|
|
1845
|
-
* @returns {
|
|
2639
|
+
* 设置物品的显示名称。
|
|
2640
|
+
* @param {String} displayName - 显示名称或本地化键。
|
|
2641
|
+
* @returns {Map} - 新的组件集合。
|
|
1846
2642
|
*/
|
|
1847
|
-
|
|
1848
|
-
binding_type: string | undefined;
|
|
2643
|
+
static setDisplayName(displayName: string): Map<any, any>;
|
|
1849
2644
|
/**
|
|
1850
|
-
*
|
|
1851
|
-
* @param {
|
|
1852
|
-
* @
|
|
2645
|
+
* 设置物品的食物组件。
|
|
2646
|
+
* @param {Boolean} canAlwaysEat - 是否随时可以食用。
|
|
2647
|
+
* @param {Number} nutrition - 营养值。
|
|
2648
|
+
* @param {Number} saturationModifier - 饱和度修正值。
|
|
2649
|
+
* @param {String} [usingConvertsTo] - 食用后转换的目标物品。
|
|
2650
|
+
* @returns {Map} - 新的组件集合。
|
|
1853
2651
|
*/
|
|
1854
|
-
|
|
1855
|
-
binding_name: string | undefined;
|
|
2652
|
+
static setFoodComponent(canAlwaysEat: boolean, nutrition: number, saturationModifier: number, usingConvertsTo?: string): Map<any, any>;
|
|
1856
2653
|
/**
|
|
1857
|
-
*
|
|
1858
|
-
* @param {
|
|
1859
|
-
* @returns {
|
|
2654
|
+
* 设置物品的燃料组件。
|
|
2655
|
+
* @param {Number} duration - 燃料燃烧的持续时间(秒),最小值为 0.05。
|
|
2656
|
+
* @returns {Map} - 新的组件集合。
|
|
1860
2657
|
*/
|
|
1861
|
-
|
|
1862
|
-
binding_name_override: string | undefined;
|
|
2658
|
+
static setFuel(duration: number): Map<any, any>;
|
|
1863
2659
|
/**
|
|
1864
|
-
*
|
|
1865
|
-
* @param {
|
|
1866
|
-
* @returns {
|
|
2660
|
+
* 设置物品的附魔光效组件。
|
|
2661
|
+
* @param {Boolean} hasGlint - 是否显示附魔光效。
|
|
2662
|
+
* @returns {Map} - 新的组件集合。
|
|
1867
2663
|
*/
|
|
1868
|
-
|
|
1869
|
-
binding_collection_name: string | undefined;
|
|
2664
|
+
static setGlint(hasGlint: boolean): Map<any, any>;
|
|
1870
2665
|
/**
|
|
1871
|
-
*
|
|
1872
|
-
* @param {
|
|
1873
|
-
* @returns {
|
|
2666
|
+
* 设置物品的手持渲染方式组件。
|
|
2667
|
+
* @param {Boolean} isHandEquipped - 是否像工具一样渲染。
|
|
2668
|
+
* @returns {Map} - 新的组件集合。
|
|
1874
2669
|
*/
|
|
1875
|
-
|
|
1876
|
-
binding_collection_prefix: string | undefined;
|
|
2670
|
+
static setHandEquipped(isHandEquipped: boolean): Map<any, any>;
|
|
1877
2671
|
/**
|
|
1878
|
-
*
|
|
1879
|
-
* @param {
|
|
1880
|
-
* @returns {
|
|
2672
|
+
* 设置物品的图标组件。
|
|
2673
|
+
* @param {String} texture - 图标纹理名称。
|
|
2674
|
+
* @returns {Map} - 新的组件集合。
|
|
1881
2675
|
*/
|
|
1882
|
-
|
|
1883
|
-
binding_condition: string | undefined;
|
|
2676
|
+
static setIcon(texture: string): Map<any, any>;
|
|
1884
2677
|
/**
|
|
1885
|
-
*
|
|
1886
|
-
* @param {
|
|
1887
|
-
* @returns {
|
|
2678
|
+
* 设置物品的最大堆叠数量组件。
|
|
2679
|
+
* @param {Number} maxStackSize - 最大堆叠数量,默认值为 64。
|
|
2680
|
+
* @returns {Map} - 新的组件集合。
|
|
1888
2681
|
*/
|
|
1889
|
-
|
|
1890
|
-
source_control_name: string | undefined;
|
|
2682
|
+
static setMaxStackSize(maxStackSize?: number): Map<any, any>;
|
|
1891
2683
|
/**
|
|
1892
|
-
*
|
|
1893
|
-
* @param {
|
|
1894
|
-
* @
|
|
2684
|
+
* 设置物品的投射物组件。
|
|
2685
|
+
* @param {Number} [minimumCriticalPower] - 投射物需要蓄力多久才能造成暴击。
|
|
2686
|
+
* @param {String} [projectileEntity] - 作为投射物发射的实体名称。
|
|
2687
|
+
* @returns {Map} - 新的组件集合。
|
|
1895
2688
|
*/
|
|
1896
|
-
|
|
1897
|
-
source_property_name: string | undefined;
|
|
2689
|
+
static setProjectile(minimumCriticalPower?: number, projectileEntity?: string): Map<any, any>;
|
|
1898
2690
|
/**
|
|
1899
|
-
*
|
|
1900
|
-
* @param {
|
|
1901
|
-
* @
|
|
2691
|
+
* 设置物品的使用修饰组件。
|
|
2692
|
+
* @param {Number} [movementModifier] - 使用物品时玩家移动速度的缩放值。
|
|
2693
|
+
* @param {Number} [useDuration] - 物品使用所需的时间(秒)。
|
|
2694
|
+
* @returns {Map} - 新的组件集合。
|
|
1902
2695
|
*/
|
|
1903
|
-
|
|
1904
|
-
target_property_name: string | undefined;
|
|
2696
|
+
static setUseModifiers(movementModifier?: number, useDuration?: number): Map<any, any>;
|
|
1905
2697
|
/**
|
|
1906
|
-
*
|
|
1907
|
-
* @param {
|
|
1908
|
-
* @
|
|
2698
|
+
* 设置物品的可穿戴组件。
|
|
2699
|
+
* @param {Number} [protection=0] - 物品提供的保护值。
|
|
2700
|
+
* @param {String} [slot] - 物品可以穿戴的槽位(如 "head"、"chest" 等)。
|
|
2701
|
+
* @returns {Map} - 新的组件集合。
|
|
1909
2702
|
*/
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
static
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
2703
|
+
static setWearable(protection?: number, slot?: string): Map<any, any>;
|
|
2704
|
+
/**
|
|
2705
|
+
* 设置物品的使用动画组件。
|
|
2706
|
+
* @param {String} animation - 物品使用时的动画类型(如 "eat"、"drink" 等)。
|
|
2707
|
+
* @returns {Map} - 新的组件集合。
|
|
2708
|
+
* @throws {Error} - 如果 animation 不是字符串类型。
|
|
2709
|
+
*/
|
|
2710
|
+
static setUseAnimation(animation: string): Map<any, any>;
|
|
2711
|
+
/**
|
|
2712
|
+
* 将多个组件集合合并为一个。
|
|
2713
|
+
* @param {...Map} componentMaps - 多个组件集合。
|
|
2714
|
+
* @returns {Map} - 合并后的组件集合。
|
|
2715
|
+
*/
|
|
2716
|
+
static combineComponents(...componentMaps: Map<any, any>[]): Map<any, any>;
|
|
2717
|
+
/**
|
|
2718
|
+
* 获取当前组件的 JSON 表示。
|
|
2719
|
+
* @param {Map} components - 组件集合。
|
|
2720
|
+
* @returns {Object} - 组件的 JSON 对象。
|
|
2721
|
+
*/
|
|
2722
|
+
static toJSON(components: Map<any, any>): Object;
|
|
1923
2723
|
}
|
|
1924
2724
|
|
|
1925
2725
|
declare class ItemTextureManager {
|
|
@@ -1941,122 +2741,4 @@ declare namespace FlipbookTextures {
|
|
|
1941
2741
|
function registerFlipbookTexture(atlas_tile: any, texture: any, ticks_per_frame: any, options?: {}): void;
|
|
1942
2742
|
}
|
|
1943
2743
|
|
|
1944
|
-
|
|
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 };
|
|
2744
|
+
export { BlockAPI, BlockComponent, Button, ButtonMapping$1 as ButtonMapping, ChestUISystem, CollectionPanel, type ConstructorOf, ContainerUISystem, Control, DataBinding, DataBindingObject, type EncodeDecoder, EntityAPI, Factory, FeatureAPI, FlipbookTextures, type FloatLiteral, Grid, GridProp, Guidebook, type ISerializer, Image, Input, ItemAPI, ItemCategory, ItemComponent, ItemTextureManager, Label, Layout, Matrix, Modifications, Panel, type RawType, RecipeAPI, ScrollView, ScrollingPanel, Serializable, Serializer, ServerFormSystem, ServerUISystem, Sound, Sprite, StackPanel, Text, UIElement, UISystem, UISystemRegistry, UISystemRegistryServer, Vec3, Vec4, type Vector3, type Vector4, decode, defaultSerializer, encode, f64, form_button_panel, getMetadata, getOrCreateMetadata, isRawJSON, jsonEncodeDecoder, jsonEncoderReplacer, registry, serialize, terrainTextureManager };
|