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
package/dist/core/item/item.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { ItemComponent } from "./itemComponents.js";
|
|
2
|
-
import { AddonItem, AddonItemDefinition, AddonItemDescription } from "../addon/item/item.js";
|
|
3
|
-
import { AddonMenuCategory } from "../addon/menuCategory.js";
|
|
4
|
-
export class Item {
|
|
5
|
-
/**
|
|
6
|
-
* 物品类
|
|
7
|
-
* @param {string} identifier 物品唯一标识符
|
|
8
|
-
* @param {string} category 菜单栏分类 可选:"construction", "nature", "equipment", "items", and "none"
|
|
9
|
-
* @param {string} texture 物品纹理
|
|
10
|
-
* @param {Object} options 可选参数
|
|
11
|
-
* @param {string} options.group 分组
|
|
12
|
-
* @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
|
|
13
|
-
*/
|
|
14
|
-
constructor(identifier, category, texture, options = {}) {
|
|
15
|
-
// 参数校验
|
|
16
|
-
if (!identifier || typeof identifier !== "string") {
|
|
17
|
-
throw new Error("identifier is required and must be a string");
|
|
18
|
-
}
|
|
19
|
-
if (!category || typeof category !== "string") {
|
|
20
|
-
throw new Error("category is required and must be a string");
|
|
21
|
-
}
|
|
22
|
-
if (!texture || typeof texture !== "string") {
|
|
23
|
-
throw new Error("texture is required and must be a string");
|
|
24
|
-
}
|
|
25
|
-
const { group, hide_in_command = false, max_stack_size = 64, } = options;
|
|
26
|
-
this.identifier = identifier;
|
|
27
|
-
this.category = category;
|
|
28
|
-
this.texture = texture;
|
|
29
|
-
this.group = group;
|
|
30
|
-
this.hide_in_command = hide_in_command;
|
|
31
|
-
this.components = new Map();
|
|
32
|
-
// 初始化默认组件
|
|
33
|
-
this.addComponent(ItemComponent.combineComponents(ItemComponent.setIcon(this.texture), ItemComponent.setMaxStackSize(max_stack_size)));
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* 添加组件
|
|
37
|
-
* @param {Map} componentMap 组件 Map
|
|
38
|
-
*/
|
|
39
|
-
addComponent(componentMap) {
|
|
40
|
-
if (!componentMap || !(componentMap instanceof Map)) {
|
|
41
|
-
throw new Error("componentMap is required and must be a Map");
|
|
42
|
-
}
|
|
43
|
-
for (const [key, value] of componentMap.entries()) {
|
|
44
|
-
this.components.set(key, value);
|
|
45
|
-
}
|
|
46
|
-
return this;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 移除组件
|
|
50
|
-
* @param {string} key 组件名称
|
|
51
|
-
*/
|
|
52
|
-
removeComponent(key) {
|
|
53
|
-
if (!key || typeof key !== "string") {
|
|
54
|
-
throw new Error("key is required and must be a string");
|
|
55
|
-
}
|
|
56
|
-
this.components.delete(key);
|
|
57
|
-
return this;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* 将物品转换为 JSON 格式
|
|
61
|
-
* @returns {Object} JSON 格式的物品对象
|
|
62
|
-
*/
|
|
63
|
-
toJson() {
|
|
64
|
-
const item = new AddonItem("1.21.40", // 格式版本
|
|
65
|
-
new AddonItemDefinition(new AddonItemDescription(this.identifier, new AddonMenuCategory(this.category, this.group, this.hide_in_command)), Object.fromEntries(this.components) // 将 Map 转换为普通对象
|
|
66
|
-
));
|
|
67
|
-
return item.toJson();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
export class ItemComponent {
|
|
2
|
-
/**
|
|
3
|
-
* 物品的耐久度组件
|
|
4
|
-
* @param {number} max_durability 最大耐久
|
|
5
|
-
* @param {number} damage_chance_min 损坏最小几率
|
|
6
|
-
* @param {number} damage_chance_max 损坏最大几率
|
|
7
|
-
* @returns {ItemComponent}
|
|
8
|
-
*/
|
|
9
|
-
static setDurability(max_durability: number, damage_chance_min?: number, damage_chance_max?: number): ItemComponent;
|
|
10
|
-
static setBlockPlacer(block: any, replace_block_item: any, use_on: any): Map<any, any>;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param {Array} custom_components
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
static setCustomComponents(custom_components: any[]): Map<any, any>;
|
|
17
|
-
/**
|
|
18
|
-
* 设置物品的可投掷组件。
|
|
19
|
-
* @param {Boolean} doSwingAnimation - 是否使用挥动动画。
|
|
20
|
-
* @param {Number} launchPowerScale - 投掷力量的缩放比例。
|
|
21
|
-
* @param {Number} maxDrawDuration - 最大蓄力时间。
|
|
22
|
-
* @param {Number} maxLaunchPower - 最大投掷力量。
|
|
23
|
-
* @param {Number} minDrawDuration - 最小蓄力时间。
|
|
24
|
-
* @param {Boolean} scalePowerByDrawDuration - 投掷力量是否随蓄力时间增加。
|
|
25
|
-
* @returns {Map} - 新的组件集合。
|
|
26
|
-
*/
|
|
27
|
-
static setThrowable(doSwingAnimation?: boolean, launchPowerScale?: number, maxDrawDuration?: number, maxLaunchPower?: number, minDrawDuration?: number, scalePowerByDrawDuration?: boolean): Map<any, any>;
|
|
28
|
-
/**
|
|
29
|
-
* 设置物品的显示名称。
|
|
30
|
-
* @param {String} displayName - 显示名称或本地化键。
|
|
31
|
-
* @returns {Map} - 新的组件集合。
|
|
32
|
-
*/
|
|
33
|
-
static setDisplayName(displayName: string): Map<any, any>;
|
|
34
|
-
/**
|
|
35
|
-
* 设置物品的食物组件。
|
|
36
|
-
* @param {Boolean} canAlwaysEat - 是否随时可以食用。
|
|
37
|
-
* @param {Number} nutrition - 营养值。
|
|
38
|
-
* @param {Number} saturationModifier - 饱和度修正值。
|
|
39
|
-
* @param {String} [usingConvertsTo] - 食用后转换的目标物品。
|
|
40
|
-
* @returns {Map} - 新的组件集合。
|
|
41
|
-
*/
|
|
42
|
-
static setFoodComponent(canAlwaysEat: boolean, nutrition: number, saturationModifier: number, usingConvertsTo?: string): Map<any, any>;
|
|
43
|
-
/**
|
|
44
|
-
* 设置物品的燃料组件。
|
|
45
|
-
* @param {Number} duration - 燃料燃烧的持续时间(秒),最小值为 0.05。
|
|
46
|
-
* @returns {Map} - 新的组件集合。
|
|
47
|
-
*/
|
|
48
|
-
static setFuel(duration: number): Map<any, any>;
|
|
49
|
-
/**
|
|
50
|
-
* 设置物品的附魔光效组件。
|
|
51
|
-
* @param {Boolean} hasGlint - 是否显示附魔光效。
|
|
52
|
-
* @returns {Map} - 新的组件集合。
|
|
53
|
-
*/
|
|
54
|
-
static setGlint(hasGlint: boolean): Map<any, any>;
|
|
55
|
-
/**
|
|
56
|
-
* 设置物品的手持渲染方式组件。
|
|
57
|
-
* @param {Boolean} isHandEquipped - 是否像工具一样渲染。
|
|
58
|
-
* @returns {Map} - 新的组件集合。
|
|
59
|
-
*/
|
|
60
|
-
static setHandEquipped(isHandEquipped: boolean): Map<any, any>;
|
|
61
|
-
/**
|
|
62
|
-
* 设置物品的图标组件。
|
|
63
|
-
* @param {String} texture - 图标纹理名称。
|
|
64
|
-
* @returns {Map} - 新的组件集合。
|
|
65
|
-
*/
|
|
66
|
-
static setIcon(texture: string): Map<any, any>;
|
|
67
|
-
/**
|
|
68
|
-
* 设置物品的最大堆叠数量组件。
|
|
69
|
-
* @param {Number} maxStackSize - 最大堆叠数量,默认值为 64。
|
|
70
|
-
* @returns {Map} - 新的组件集合。
|
|
71
|
-
*/
|
|
72
|
-
static setMaxStackSize(maxStackSize?: number): Map<any, any>;
|
|
73
|
-
/**
|
|
74
|
-
* 设置物品的投射物组件。
|
|
75
|
-
* @param {Number} [minimumCriticalPower] - 投射物需要蓄力多久才能造成暴击。
|
|
76
|
-
* @param {String} [projectileEntity] - 作为投射物发射的实体名称。
|
|
77
|
-
* @returns {Map} - 新的组件集合。
|
|
78
|
-
*/
|
|
79
|
-
static setProjectile(minimumCriticalPower?: number, projectileEntity?: string): Map<any, any>;
|
|
80
|
-
/**
|
|
81
|
-
* 设置物品的使用修饰组件。
|
|
82
|
-
* @param {Number} [movementModifier] - 使用物品时玩家移动速度的缩放值。
|
|
83
|
-
* @param {Number} [useDuration] - 物品使用所需的时间(秒)。
|
|
84
|
-
* @returns {Map} - 新的组件集合。
|
|
85
|
-
*/
|
|
86
|
-
static setUseModifiers(movementModifier?: number, useDuration?: number): Map<any, any>;
|
|
87
|
-
/**
|
|
88
|
-
* 设置物品的可穿戴组件。
|
|
89
|
-
* @param {Number} [protection=0] - 物品提供的保护值。
|
|
90
|
-
* @param {String} [slot] - 物品可以穿戴的槽位(如 "head"、"chest" 等)。
|
|
91
|
-
* @returns {Map} - 新的组件集合。
|
|
92
|
-
*/
|
|
93
|
-
static setWearable(protection?: number, slot?: string): Map<any, any>;
|
|
94
|
-
/**
|
|
95
|
-
* 设置物品的使用动画组件。
|
|
96
|
-
* @param {String} animation - 物品使用时的动画类型(如 "eat"、"drink" 等)。
|
|
97
|
-
* @returns {Map} - 新的组件集合。
|
|
98
|
-
* @throws {Error} - 如果 animation 不是字符串类型。
|
|
99
|
-
*/
|
|
100
|
-
static setUseAnimation(animation: string): Map<any, any>;
|
|
101
|
-
/**
|
|
102
|
-
* 将多个组件集合合并为一个。
|
|
103
|
-
* @param {...Map} componentMaps - 多个组件集合。
|
|
104
|
-
* @returns {Map} - 合并后的组件集合。
|
|
105
|
-
*/
|
|
106
|
-
static combineComponents(...componentMaps: Map<any, any>[]): Map<any, any>;
|
|
107
|
-
/**
|
|
108
|
-
* 获取当前组件的 JSON 表示。
|
|
109
|
-
* @param {Map} components - 组件集合。
|
|
110
|
-
* @returns {Object} - 组件的 JSON 对象。
|
|
111
|
-
*/
|
|
112
|
-
static toJSON(components: Map<any, any>): Object;
|
|
113
|
-
}
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
export class ItemComponent {
|
|
2
|
-
/**
|
|
3
|
-
* 物品的耐久度组件
|
|
4
|
-
* @param {number} max_durability 最大耐久
|
|
5
|
-
* @param {number} damage_chance_min 损坏最小几率
|
|
6
|
-
* @param {number} damage_chance_max 损坏最大几率
|
|
7
|
-
* @returns {ItemComponent}
|
|
8
|
-
*/
|
|
9
|
-
static setDurability(max_durability, damage_chance_min = 0, damage_chance_max = 100) {
|
|
10
|
-
return new Map().set("minecraft:durability", {
|
|
11
|
-
"damage_chance": {
|
|
12
|
-
"min": damage_chance_min,
|
|
13
|
-
"max": damage_chance_max
|
|
14
|
-
},
|
|
15
|
-
"max_durability": max_durability
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
static setBlockPlacer(block, replace_block_item, use_on) {
|
|
19
|
-
return new Map().set("minecraft:block_placer", {
|
|
20
|
-
block: block,
|
|
21
|
-
replace_block_item: replace_block_item,
|
|
22
|
-
use_on: use_on
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @param {Array} custom_components
|
|
28
|
-
* @returns
|
|
29
|
-
*/
|
|
30
|
-
static setCustomComponents(custom_components) {
|
|
31
|
-
return new Map().set("minecraft:custom_components", [...custom_components]);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* 设置物品的可投掷组件。
|
|
35
|
-
* @param {Boolean} doSwingAnimation - 是否使用挥动动画。
|
|
36
|
-
* @param {Number} launchPowerScale - 投掷力量的缩放比例。
|
|
37
|
-
* @param {Number} maxDrawDuration - 最大蓄力时间。
|
|
38
|
-
* @param {Number} maxLaunchPower - 最大投掷力量。
|
|
39
|
-
* @param {Number} minDrawDuration - 最小蓄力时间。
|
|
40
|
-
* @param {Boolean} scalePowerByDrawDuration - 投掷力量是否随蓄力时间增加。
|
|
41
|
-
* @returns {Map} - 新的组件集合。
|
|
42
|
-
*/
|
|
43
|
-
static setThrowable(doSwingAnimation = false, launchPowerScale = 1.0, maxDrawDuration = 0.0, maxLaunchPower = 1.0, minDrawDuration = 0.0, scalePowerByDrawDuration = false) {
|
|
44
|
-
return new Map().set("minecraft:throwable", {
|
|
45
|
-
do_swing_animation: doSwingAnimation,
|
|
46
|
-
launch_power_scale: launchPowerScale,
|
|
47
|
-
max_draw_duration: maxDrawDuration,
|
|
48
|
-
max_launch_power: maxLaunchPower,
|
|
49
|
-
min_draw_duration: minDrawDuration,
|
|
50
|
-
scale_power_by_draw_duration: scalePowerByDrawDuration,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* 设置物品的显示名称。
|
|
55
|
-
* @param {String} displayName - 显示名称或本地化键。
|
|
56
|
-
* @returns {Map} - 新的组件集合。
|
|
57
|
-
*/
|
|
58
|
-
static setDisplayName(displayName) {
|
|
59
|
-
if (typeof displayName !== "string") {
|
|
60
|
-
throw new Error('显示名称必须是字符串类型');
|
|
61
|
-
}
|
|
62
|
-
return new Map().set("minecraft:display_name", { value: displayName });
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* 设置物品的食物组件。
|
|
66
|
-
* @param {Boolean} canAlwaysEat - 是否随时可以食用。
|
|
67
|
-
* @param {Number} nutrition - 营养值。
|
|
68
|
-
* @param {Number} saturationModifier - 饱和度修正值。
|
|
69
|
-
* @param {String} [usingConvertsTo] - 食用后转换的目标物品。
|
|
70
|
-
* @returns {Map} - 新的组件集合。
|
|
71
|
-
*/
|
|
72
|
-
static setFoodComponent(canAlwaysEat, nutrition, saturationModifier, usingConvertsTo) {
|
|
73
|
-
return new Map().set("minecraft:food", {
|
|
74
|
-
can_always_eat: canAlwaysEat,
|
|
75
|
-
nutrition: nutrition || 0,
|
|
76
|
-
saturation_modifier: saturationModifier || 0.6,
|
|
77
|
-
using_converts_to: usingConvertsTo || undefined,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* 设置物品的燃料组件。
|
|
82
|
-
* @param {Number} duration - 燃料燃烧的持续时间(秒),最小值为 0.05。
|
|
83
|
-
* @returns {Map} - 新的组件集合。
|
|
84
|
-
*/
|
|
85
|
-
static setFuel(duration) {
|
|
86
|
-
if (typeof duration !== "number" || duration < 0.05) {
|
|
87
|
-
throw new Error('燃料持续时间必须是一个大于或等于 0.05 的数字');
|
|
88
|
-
}
|
|
89
|
-
return new Map().set("minecraft:fuel", { duration });
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* 设置物品的附魔光效组件。
|
|
93
|
-
* @param {Boolean} hasGlint - 是否显示附魔光效。
|
|
94
|
-
* @returns {Map} - 新的组件集合。
|
|
95
|
-
*/
|
|
96
|
-
static setGlint(hasGlint) {
|
|
97
|
-
if (typeof hasGlint !== "boolean") {
|
|
98
|
-
throw new Error('附魔光效值必须是布尔类型');
|
|
99
|
-
}
|
|
100
|
-
return new Map().set("minecraft:glint", hasGlint);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* 设置物品的手持渲染方式组件。
|
|
104
|
-
* @param {Boolean} isHandEquipped - 是否像工具一样渲染。
|
|
105
|
-
* @returns {Map} - 新的组件集合。
|
|
106
|
-
*/
|
|
107
|
-
static setHandEquipped(isHandEquipped) {
|
|
108
|
-
if (typeof isHandEquipped !== "boolean") {
|
|
109
|
-
throw new Error('手持渲染方式值必须是布尔类型');
|
|
110
|
-
}
|
|
111
|
-
return new Map().set("minecraft:hand_equipped", isHandEquipped);
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* 设置物品的图标组件。
|
|
115
|
-
* @param {String} texture - 图标纹理名称。
|
|
116
|
-
* @returns {Map} - 新的组件集合。
|
|
117
|
-
*/
|
|
118
|
-
static setIcon(texture) {
|
|
119
|
-
if (typeof texture !== "string") {
|
|
120
|
-
throw new Error('图标纹理必须是字符串类型');
|
|
121
|
-
}
|
|
122
|
-
return new Map().set("minecraft:icon", texture);
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* 设置物品的最大堆叠数量组件。
|
|
126
|
-
* @param {Number} maxStackSize - 最大堆叠数量,默认值为 64。
|
|
127
|
-
* @returns {Map} - 新的组件集合。
|
|
128
|
-
*/
|
|
129
|
-
static setMaxStackSize(maxStackSize = 64) {
|
|
130
|
-
if (typeof maxStackSize !== "number" || maxStackSize <= 0 || !Number.isInteger(maxStackSize)) {
|
|
131
|
-
throw new Error('最大堆叠数量必须是正整数');
|
|
132
|
-
}
|
|
133
|
-
return new Map().set("minecraft:max_stack_size", maxStackSize);
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* 设置物品的投射物组件。
|
|
137
|
-
* @param {Number} [minimumCriticalPower] - 投射物需要蓄力多久才能造成暴击。
|
|
138
|
-
* @param {String} [projectileEntity] - 作为投射物发射的实体名称。
|
|
139
|
-
* @returns {Map} - 新的组件集合。
|
|
140
|
-
*/
|
|
141
|
-
static setProjectile(minimumCriticalPower, projectileEntity) {
|
|
142
|
-
const projectileComponent = {};
|
|
143
|
-
if (minimumCriticalPower !== undefined) {
|
|
144
|
-
if (typeof minimumCriticalPower !== "number" || minimumCriticalPower < 0) {
|
|
145
|
-
throw new Error('minimumCriticalPower 必须是非负数');
|
|
146
|
-
}
|
|
147
|
-
projectileComponent.minimum_critical_power = minimumCriticalPower;
|
|
148
|
-
}
|
|
149
|
-
if (projectileEntity !== undefined) {
|
|
150
|
-
if (typeof projectileEntity !== "string") {
|
|
151
|
-
throw new Error('projectileEntity 必须是字符串类型');
|
|
152
|
-
}
|
|
153
|
-
projectileComponent.projectile_entity = projectileEntity;
|
|
154
|
-
}
|
|
155
|
-
return new Map().set("minecraft:projectile", projectileComponent);
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* 设置物品的使用修饰组件。
|
|
159
|
-
* @param {Number} [movementModifier] - 使用物品时玩家移动速度的缩放值。
|
|
160
|
-
* @param {Number} [useDuration] - 物品使用所需的时间(秒)。
|
|
161
|
-
* @returns {Map} - 新的组件集合。
|
|
162
|
-
*/
|
|
163
|
-
static setUseModifiers(movementModifier, useDuration) {
|
|
164
|
-
const useModifiersComponent = {};
|
|
165
|
-
if (movementModifier !== undefined) {
|
|
166
|
-
if (typeof movementModifier !== "number") {
|
|
167
|
-
throw new Error('movementModifier 必须是数字类型');
|
|
168
|
-
}
|
|
169
|
-
useModifiersComponent.movement_modifier = movementModifier;
|
|
170
|
-
}
|
|
171
|
-
if (useDuration !== undefined) {
|
|
172
|
-
if (typeof useDuration !== "number" || useDuration < 0) {
|
|
173
|
-
throw new Error('useDuration 必须是非负数');
|
|
174
|
-
}
|
|
175
|
-
useModifiersComponent.use_duration = useDuration;
|
|
176
|
-
}
|
|
177
|
-
return new Map().set("minecraft:use_modifiers", useModifiersComponent);
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* 设置物品的可穿戴组件。
|
|
181
|
-
* @param {Number} [protection=0] - 物品提供的保护值。
|
|
182
|
-
* @param {String} [slot] - 物品可以穿戴的槽位(如 "head"、"chest" 等)。
|
|
183
|
-
* @returns {Map} - 新的组件集合。
|
|
184
|
-
*/
|
|
185
|
-
static setWearable(protection = 0, slot) {
|
|
186
|
-
const wearableComponent = { protection };
|
|
187
|
-
if (slot !== undefined) {
|
|
188
|
-
if (typeof slot !== "string") {
|
|
189
|
-
throw new Error('slot 必须是字符串类型');
|
|
190
|
-
}
|
|
191
|
-
wearableComponent.slot = slot;
|
|
192
|
-
}
|
|
193
|
-
return new Map().set("minecraft:wearable", wearableComponent);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* 设置物品的使用动画组件。
|
|
197
|
-
* @param {String} animation - 物品使用时的动画类型(如 "eat"、"drink" 等)。
|
|
198
|
-
* @returns {Map} - 新的组件集合。
|
|
199
|
-
* @throws {Error} - 如果 animation 不是字符串类型。
|
|
200
|
-
*/
|
|
201
|
-
static setUseAnimation(animation) {
|
|
202
|
-
// 检查 animation 是否为字符串
|
|
203
|
-
if (typeof animation !== "string") {
|
|
204
|
-
throw new Error('animation 必须是字符串类型');
|
|
205
|
-
}
|
|
206
|
-
// 返回包含动画设置的 Map 对象
|
|
207
|
-
return new Map().set("minecraft:use_animation", animation);
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* 将多个组件集合合并为一个。
|
|
211
|
-
* @param {...Map} componentMaps - 多个组件集合。
|
|
212
|
-
* @returns {Map} - 合并后的组件集合。
|
|
213
|
-
*/
|
|
214
|
-
static combineComponents(...componentMaps) {
|
|
215
|
-
return new Map(componentMaps.flatMap(map => [...map]));
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* 获取当前组件的 JSON 表示。
|
|
219
|
-
* @param {Map} components - 组件集合。
|
|
220
|
-
* @returns {Object} - 组件的 JSON 对象。
|
|
221
|
-
*/
|
|
222
|
-
static toJSON(components) {
|
|
223
|
-
return Object.fromEntries(components);
|
|
224
|
-
}
|
|
225
|
-
}
|
package/dist/core/registry.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export class GRegistry {
|
|
2
|
-
static dataList: any[];
|
|
3
|
-
/**
|
|
4
|
-
* 生成注册器
|
|
5
|
-
* @param {string} name 文件名字
|
|
6
|
-
* @param {string} root 根目录,如 "behavior"、"resource" 等
|
|
7
|
-
* @param {string} path 数据的路径,如 "blocks/"、"items/"、"recipes/" 等
|
|
8
|
-
* @param {string} data 实例 必须包含 toJson 方法
|
|
9
|
-
*/
|
|
10
|
-
static register(name: string, root: string, path: string, data: string): void;
|
|
11
|
-
static getDataList(): any[];
|
|
12
|
-
}
|
package/dist/core/registry.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export class GRegistry {
|
|
2
|
-
static dataList = [];
|
|
3
|
-
/**
|
|
4
|
-
* 生成注册器
|
|
5
|
-
* @param {string} name 文件名字
|
|
6
|
-
* @param {string} root 根目录,如 "behavior"、"resource" 等
|
|
7
|
-
* @param {string} path 数据的路径,如 "blocks/"、"items/"、"recipes/" 等
|
|
8
|
-
* @param {string} data 实例 必须包含 toJson 方法
|
|
9
|
-
*/
|
|
10
|
-
static register(name, root, path, data) {
|
|
11
|
-
GRegistry.dataList.push({ name, root, path, data });
|
|
12
|
-
}
|
|
13
|
-
static getDataList() {
|
|
14
|
-
return [...GRegistry.dataList];
|
|
15
|
-
}
|
|
16
|
-
}
|
package/dist/core/texture.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export class ItemTextureManager {
|
|
2
|
-
static item_texture_sets: Map<any, any>;
|
|
3
|
-
static getItemTextureSet(): Map<any, any>;
|
|
4
|
-
static getItemTextures(): any;
|
|
5
|
-
static registerTextureData(texture_name: any, texture_data: any): void;
|
|
6
|
-
static registerTexture(texture_name: any, texture_path: any): void;
|
|
7
|
-
}
|
|
8
|
-
export class terrainTextureManager {
|
|
9
|
-
static terrain_texture_sets: Map<any, any>;
|
|
10
|
-
static getTerrainTextureSet(): Map<any, any>;
|
|
11
|
-
static getTerrainTextures(): any;
|
|
12
|
-
static registerTextureData(texture_name: any, texture_data: any): void;
|
|
13
|
-
static registerTexture(texture_name: any, texture_path: any): void;
|
|
14
|
-
}
|
|
15
|
-
export namespace FlipbookTextures {
|
|
16
|
-
let flipbook_textures: never[];
|
|
17
|
-
function registerFlipbookTexture(atlas_tile: any, texture: any, ticks_per_frame: any, options?: {}): void;
|
|
18
|
-
}
|
package/dist/core/texture.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export class ItemTextureManager {
|
|
2
|
-
static item_texture_sets = new Map();
|
|
3
|
-
static getItemTextureSet() {
|
|
4
|
-
return this.item_texture_sets;
|
|
5
|
-
}
|
|
6
|
-
static getItemTextures() {
|
|
7
|
-
return Object.fromEntries(this.item_texture_sets);
|
|
8
|
-
}
|
|
9
|
-
static registerTextureData(texture_name, texture_data) {
|
|
10
|
-
this.item_texture_sets.set(texture_name, texture_data);
|
|
11
|
-
}
|
|
12
|
-
static registerTexture(texture_name, texture_path) {
|
|
13
|
-
this.registerTextureData(texture_name, { textures: texture_path });
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export class terrainTextureManager {
|
|
17
|
-
static terrain_texture_sets = new Map();
|
|
18
|
-
static getTerrainTextureSet() {
|
|
19
|
-
return this.terrain_texture_sets;
|
|
20
|
-
}
|
|
21
|
-
static getTerrainTextures() {
|
|
22
|
-
return Object.fromEntries(this.terrain_texture_sets);
|
|
23
|
-
}
|
|
24
|
-
static registerTextureData(texture_name, texture_data) {
|
|
25
|
-
this.terrain_texture_sets.set(texture_name, texture_data);
|
|
26
|
-
}
|
|
27
|
-
static registerTexture(texture_name, texture_path) {
|
|
28
|
-
this.registerTextureData(texture_name, { textures: texture_path });
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export const FlipbookTextures = {
|
|
32
|
-
flipbook_textures: [],
|
|
33
|
-
registerFlipbookTexture(atlas_tile, texture, ticks_per_frame, options = {}) {
|
|
34
|
-
const flipbook_texture = { "atlas_tile": atlas_tile, "flipbook_texture": texture, ticks_per_frame };
|
|
35
|
-
Object.assign(flipbook_texture, options);
|
|
36
|
-
this.flipbook_textures.push(flipbook_texture);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ButtonMapping 类
|
|
3
|
-
*
|
|
4
|
-
* 该类表示按钮映射配置,用于定义输入事件的映射关系。
|
|
5
|
-
*
|
|
6
|
-
* 属性:
|
|
7
|
-
* - ignored: boolean - 是否忽略映射(默认值:false)
|
|
8
|
-
* - from_button_id: string - 触发事件的按钮 ID
|
|
9
|
-
* - to_button_id: string - 事件触发时执行的按钮 ID
|
|
10
|
-
* - mapping_type: enum - 映射类型(可能值:global, pressed, double_pressed, focused)
|
|
11
|
-
* - scope: enum - 映射范围(可能值:view, controller)
|
|
12
|
-
* - input_mode_condition: enum - 输入模式条件(可能值:not_gaze, not_gamepad, gamepad_and_not_gaze)
|
|
13
|
-
* - ignore_input_scope: boolean - 是否忽略输入范围
|
|
14
|
-
* - consume_event: boolean - 是否消耗事件
|
|
15
|
-
* - handle_select: boolean - 是否处理选择事件
|
|
16
|
-
* - handle_deselect: boolean - 是否处理取消选择事件
|
|
17
|
-
* - button_up_right_of_first_refusal: boolean - 是否在首次拒绝后处理按钮释放事件
|
|
18
|
-
*/
|
|
19
|
-
export class ButtonMapping {
|
|
20
|
-
ignored: boolean;
|
|
21
|
-
from_button_id: string;
|
|
22
|
-
to_button_id: string;
|
|
23
|
-
mapping_type: string | null;
|
|
24
|
-
scope: string | null;
|
|
25
|
-
input_mode_condition: string | null;
|
|
26
|
-
ignore_input_scope: boolean;
|
|
27
|
-
consume_event: boolean;
|
|
28
|
-
handle_select: boolean;
|
|
29
|
-
handle_deselect: boolean;
|
|
30
|
-
button_up_right_of_first_refusal: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* 设置是否忽略映射。
|
|
33
|
-
* @param {boolean} ignored - 是否忽略映射(默认值:false)
|
|
34
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
35
|
-
*/
|
|
36
|
-
setIgnored(ignored?: boolean): ButtonMapping;
|
|
37
|
-
/**
|
|
38
|
-
* 设置触发事件的按钮 ID。
|
|
39
|
-
* @param {string} fromButtonId - 触发事件的按钮 ID
|
|
40
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
41
|
-
*/
|
|
42
|
-
setFromButtonId(fromButtonId: string): ButtonMapping;
|
|
43
|
-
/**
|
|
44
|
-
* 设置事件触发时执行的按钮 ID。
|
|
45
|
-
* @param {string} toButtonId - 事件触发时执行的按钮 ID
|
|
46
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
47
|
-
*/
|
|
48
|
-
setToButtonId(toButtonId: string): ButtonMapping;
|
|
49
|
-
/**
|
|
50
|
-
* 设置映射类型。
|
|
51
|
-
* @param {string} mappingType - 映射类型(可能值:global, pressed, double_pressed, focused)
|
|
52
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
53
|
-
*/
|
|
54
|
-
setMappingType(mappingType: string): ButtonMapping;
|
|
55
|
-
/**
|
|
56
|
-
* 设置映射范围。
|
|
57
|
-
* @param {string} scope - 映射范围(可能值:view, controller)
|
|
58
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
59
|
-
*/
|
|
60
|
-
setScope(scope: string): ButtonMapping;
|
|
61
|
-
/**
|
|
62
|
-
* 设置输入模式条件。
|
|
63
|
-
* @param {string} condition - 输入模式条件(可能值:not_gaze, not_gamepad, gamepad_and_not_gaze)
|
|
64
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
65
|
-
*/
|
|
66
|
-
setInputModeCondition(condition: string): ButtonMapping;
|
|
67
|
-
/**
|
|
68
|
-
* 设置是否忽略输入范围。
|
|
69
|
-
* @param {boolean} ignore - 是否忽略输入范围
|
|
70
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
71
|
-
*/
|
|
72
|
-
setIgnoreInputScope(ignore?: boolean): ButtonMapping;
|
|
73
|
-
/**
|
|
74
|
-
* 设置是否消耗事件。
|
|
75
|
-
* @param {boolean} consume - 是否消耗事件
|
|
76
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
77
|
-
*/
|
|
78
|
-
setConsumeEvent(consume?: boolean): ButtonMapping;
|
|
79
|
-
/**
|
|
80
|
-
* 设置是否处理选择事件。
|
|
81
|
-
* @param {boolean} handle - 是否处理选择事件
|
|
82
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
83
|
-
*/
|
|
84
|
-
setHandleSelect(handle?: boolean): ButtonMapping;
|
|
85
|
-
/**
|
|
86
|
-
* 设置是否处理取消选择事件。
|
|
87
|
-
* @param {boolean} handle - 是否处理取消选择事件
|
|
88
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
89
|
-
*/
|
|
90
|
-
setHandleDeselect(handle?: boolean): ButtonMapping;
|
|
91
|
-
/**
|
|
92
|
-
* 设置是否在首次拒绝后处理按钮释放事件。
|
|
93
|
-
* @param {boolean} handle - 是否处理按钮释放事件
|
|
94
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
95
|
-
*/
|
|
96
|
-
setButtonUpRightOfFirstRefusal(handle?: boolean): ButtonMapping;
|
|
97
|
-
}
|