sapdon 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/build.d.ts +7 -0
- package/dist/cli/build.js +234 -0
- package/dist/cli/dev-server/client.d.ts +2 -0
- package/dist/cli/dev-server/client.js +21 -0
- package/dist/cli/dev-server/config.d.ts +3 -0
- package/dist/cli/dev-server/config.js +3 -0
- package/dist/cli/dev-server/handles.d.ts +4 -0
- package/dist/cli/dev-server/handles.js +5 -0
- package/dist/cli/dev-server/hmr.d.ts +1 -0
- package/dist/cli/dev-server/hmr.js +13 -0
- package/dist/cli/dev-server/index.d.ts +4 -0
- package/dist/cli/dev-server/index.js +17 -0
- package/dist/cli/dev-server/server.d.ts +14 -0
- package/dist/cli/dev-server/server.js +59 -0
- package/dist/cli/dev-server/syncFiles.d.ts +3 -0
- package/dist/cli/dev-server/syncFiles.js +37 -0
- package/dist/cli/index.d.ts +23 -0
- package/dist/cli/index.js +1 -0
- package/dist/cli/init.d.ts +9 -0
- package/dist/cli/init.js +80 -0
- package/dist/cli/load.d.ts +3 -0
- package/dist/cli/load.js +94 -0
- package/dist/cli/start.d.ts +2 -0
- package/dist/cli/start.js +2 -0
- package/dist/cli/tools/textureSet.d.ts +13 -0
- package/dist/cli/tools/textureSet.js +103 -0
- package/dist/cli/utils.d.ts +13 -0
- package/dist/cli/utils.js +89 -0
- package/dist/core/addon/biome.d.ts +22 -0
- package/dist/core/addon/biome.js +27 -0
- package/dist/core/addon/block/block.d.ts +41 -0
- package/dist/core/addon/block/block.js +46 -0
- package/dist/core/addon/controllers/animationController.d.ts +43 -0
- package/dist/core/addon/controllers/animationController.js +73 -0
- package/dist/core/addon/entity/clientEntity.d.ts +107 -0
- package/dist/core/addon/entity/clientEntity.js +149 -0
- package/dist/core/addon/entity/entity.d.ts +42 -0
- package/dist/core/addon/entity/entity.js +50 -0
- package/dist/core/addon/feature/oreFeature.d.ts +19 -0
- package/dist/core/addon/feature/oreFeature.js +24 -0
- package/dist/core/addon/featureRule.d.ts +20 -0
- package/dist/core/addon/featureRule.js +25 -0
- package/dist/core/addon/item/attachable.d.ts +94 -0
- package/dist/core/addon/item/attachable.js +134 -0
- package/dist/core/addon/item/item.d.ts +19 -0
- package/dist/core/addon/item/item.js +26 -0
- package/dist/core/addon/manifest.d.ts +49 -0
- package/dist/core/addon/manifest.js +65 -0
- package/dist/core/addon/menuCategory.d.ts +6 -0
- package/dist/core/addon/menuCategory.js +7 -0
- package/dist/core/addon/recipe/baseRecipe.d.ts +12 -0
- package/dist/core/addon/recipe/baseRecipe.js +23 -0
- package/dist/core/addon/recipe/data.d.ts +66 -0
- package/dist/core/addon/recipe/data.js +74 -0
- package/dist/core/addon/recipe/furnace.d.ts +17 -0
- package/dist/core/addon/recipe/furnace.js +43 -0
- package/dist/core/addon/recipe/shaped.d.ts +26 -0
- package/dist/core/addon/recipe/shaped.js +53 -0
- package/dist/core/addon/recipe/shapeless.d.ts +18 -0
- package/dist/core/addon/recipe/shapeless.js +36 -0
- package/dist/core/biome/biome.d.ts +14 -0
- package/dist/core/biome/biome.js +23 -0
- package/dist/core/biome/biomeComponent.d.ts +46 -0
- package/dist/core/biome/biomeComponent.js +77 -0
- package/dist/core/block/basicBlock.d.ts +48 -0
- package/dist/core/block/basicBlock.js +105 -0
- package/dist/core/block/block.d.ts +32 -0
- package/dist/core/block/block.js +92 -0
- package/dist/core/block/blockComponent.d.ts +187 -0
- package/dist/core/block/blockComponent.js +500 -0
- package/dist/core/block/cropBlock.d.ts +4 -0
- package/dist/core/block/cropBlock.js +27 -0
- package/dist/core/block/geometryBlock.d.ts +12 -0
- package/dist/core/block/geometryBlock.js +16 -0
- package/dist/core/block/oreBlock.d.ts +9 -0
- package/dist/core/block/oreBlock.js +25 -0
- package/dist/core/block/rotatableBlock.d.ts +27 -0
- package/dist/core/block/rotatableBlock.js +107 -0
- package/dist/core/block/tileBlock.d.ts +17 -0
- package/dist/core/block/tileBlock.js +125 -0
- package/dist/core/entity/basicEntity.d.ts +111 -0
- package/dist/core/entity/basicEntity.js +170 -0
- package/dist/core/entity/behavior/followMob.d.ts +12 -0
- package/dist/core/entity/behavior/followMob.js +35 -0
- package/dist/core/entity/behavior/followParent.d.ts +7 -0
- package/dist/core/entity/behavior/followParent.js +15 -0
- package/dist/core/entity/behavior/randomStroll.d.ts +31 -0
- package/dist/core/entity/behavior/randomStroll.js +63 -0
- package/dist/core/entity/behavior/tempt.d.ts +73 -0
- package/dist/core/entity/behavior/tempt.js +134 -0
- package/dist/core/entity/bundles/basicBundle.d.ts +13 -0
- package/dist/core/entity/bundles/basicBundle.js +45 -0
- package/dist/core/entity/clientEntity.d.ts +20 -0
- package/dist/core/entity/clientEntity.js +37 -0
- package/dist/core/entity/componets/entityComponet.d.ts +202 -0
- package/dist/core/entity/componets/entityComponet.js +347 -0
- package/dist/core/entity/data/nativeEntityData.d.ts +9 -0
- package/dist/core/entity/data/nativeEntityData.js +38 -0
- package/dist/core/entity/entity.d.ts +15 -0
- package/dist/core/entity/entity.js +18 -0
- package/dist/core/entity/nativeEntity.d.ts +8 -0
- package/dist/core/entity/nativeEntity.js +28 -0
- package/dist/core/entity/navigation/walk.d.ts +23 -0
- package/dist/core/entity/navigation/walk.js +56 -0
- package/dist/core/entity/projectile.d.ts +3 -0
- package/dist/core/entity/projectile.js +7 -0
- package/dist/core/factory/biomeFactory.d.ts +4 -0
- package/dist/core/factory/biomeFactory.js +13 -0
- package/dist/core/factory/blockFactory.d.ts +34 -0
- package/dist/core/factory/blockFactory.js +143 -0
- package/dist/core/factory/entityFactory.d.ts +17 -0
- package/dist/core/factory/entityFactory.js +75 -0
- package/dist/core/factory/featureFactory.d.ts +6 -0
- package/dist/core/factory/featureFactory.js +23 -0
- package/dist/core/factory/itemExtra.d.ts +8 -0
- package/dist/core/factory/itemExtra.js +9 -0
- package/dist/core/factory/itemFactory.d.ts +27 -0
- package/dist/core/factory/itemFactory.js +112 -0
- package/dist/core/factory/recipeFactory.d.ts +18 -0
- package/dist/core/factory/recipeFactory.js +39 -0
- package/dist/core/factory/uiFactory.d.ts +12 -0
- package/dist/core/factory/uiFactory.js +32 -0
- package/dist/core/feature/oreFeature.d.ts +10 -0
- package/dist/core/feature/oreFeature.js +11 -0
- package/dist/core/feature-rule/condition/biomeFilter.d.ts +26 -0
- package/dist/core/feature-rule/condition/biomeFilter.js +36 -0
- package/dist/core/feature-rule/condition/featureConditions.d.ts +27 -0
- package/dist/core/feature-rule/condition/featureConditions.js +37 -0
- package/dist/core/feature-rule/distribution/coordinateDistribution.d.ts +17 -0
- package/dist/core/feature-rule/distribution/coordinateDistribution.js +23 -0
- package/dist/core/feature-rule/distribution/featureDistribution.d.ts +31 -0
- package/dist/core/feature-rule/distribution/featureDistribution.js +41 -0
- package/dist/core/feature-rule/featureRule.d.ts +17 -0
- package/dist/core/feature-rule/featureRule.js +26 -0
- package/dist/core/index.d.ts +2062 -0
- package/dist/core/index.js +1 -0
- package/dist/core/item/armor.d.ts +21 -0
- package/dist/core/item/armor.js +90 -0
- package/dist/core/item/attachable.d.ts +6 -0
- package/dist/core/item/attachable.js +26 -0
- package/dist/core/item/food.d.ts +24 -0
- package/dist/core/item/food.js +38 -0
- package/dist/core/item/item.d.ts +36 -0
- package/dist/core/item/item.js +69 -0
- package/dist/core/item/itemComponents.d.ts +113 -0
- package/dist/core/item/itemComponents.js +225 -0
- package/dist/core/registry.d.ts +12 -0
- package/dist/core/registry.js +16 -0
- package/dist/core/texture.d.ts +18 -0
- package/dist/core/texture.js +38 -0
- package/dist/core/ui/buttonMapping.d.ts +97 -0
- package/dist/core/ui/buttonMapping.js +132 -0
- package/dist/core/ui/dataBindingObject.d.ts +97 -0
- package/dist/core/ui/dataBindingObject.js +134 -0
- package/dist/core/ui/elements/button.d.ts +21 -0
- package/dist/core/ui/elements/button.js +101 -0
- package/dist/core/ui/elements/collectionPanel.d.ts +12 -0
- package/dist/core/ui/elements/collectionPanel.js +53 -0
- package/dist/core/ui/elements/grid.d.ts +8 -0
- package/dist/core/ui/elements/grid.js +33 -0
- package/dist/core/ui/elements/image.d.ts +13 -0
- package/dist/core/ui/elements/image.js +55 -0
- package/dist/core/ui/elements/label.d.ts +14 -0
- package/dist/core/ui/elements/label.js +61 -0
- package/dist/core/ui/elements/panel.d.ts +11 -0
- package/dist/core/ui/elements/panel.js +49 -0
- package/dist/core/ui/elements/scrollingPanel.d.ts +14 -0
- package/dist/core/ui/elements/scrollingPanel.js +59 -0
- package/dist/core/ui/elements/stackPanel.d.ts +14 -0
- package/dist/core/ui/elements/stackPanel.js +37 -0
- package/dist/core/ui/elements/uiElement.d.ts +53 -0
- package/dist/core/ui/elements/uiElement.js +129 -0
- package/dist/core/ui/properties/control.d.ts +214 -0
- package/dist/core/ui/properties/control.js +286 -0
- package/dist/core/ui/properties/dataBinding.d.ts +6 -0
- package/dist/core/ui/properties/dataBinding.js +16 -0
- package/dist/core/ui/properties/factory.d.ts +37 -0
- package/dist/core/ui/properties/factory.js +62 -0
- package/dist/core/ui/properties/gridProp.d.ts +65 -0
- package/dist/core/ui/properties/gridProp.js +90 -0
- package/dist/core/ui/properties/input.d.ts +97 -0
- package/dist/core/ui/properties/input.js +134 -0
- package/dist/core/ui/properties/layout.d.ts +105 -0
- package/dist/core/ui/properties/layout.js +145 -0
- package/dist/core/ui/properties/scrollView.d.ts +105 -0
- package/dist/core/ui/properties/scrollView.js +145 -0
- package/dist/core/ui/properties/sound.d.ts +47 -0
- package/dist/core/ui/properties/sound.js +66 -0
- package/dist/core/ui/properties/sprite.d.ts +161 -0
- package/dist/core/ui/properties/sprite.js +222 -0
- package/dist/core/ui/properties/text.d.ts +135 -0
- package/dist/core/ui/properties/text.js +187 -0
- package/dist/core/ui/registry/uiSystemRegistry.d.ts +8 -0
- package/dist/core/ui/registry/uiSystemRegistry.js +26 -0
- package/dist/core/ui/systems/chest.d.ts +5 -0
- package/dist/core/ui/systems/chest.js +21 -0
- package/dist/core/ui/systems/containerUISystem.d.ts +67 -0
- package/dist/core/ui/systems/containerUISystem.js +214 -0
- package/dist/core/ui/systems/guidebook.d.ts +9 -0
- package/dist/core/ui/systems/guidebook.js +206 -0
- package/dist/core/ui/systems/serverForm.d.ts +13 -0
- package/dist/core/ui/systems/serverForm.js +116 -0
- package/dist/core/ui/systems/system.d.ts +16 -0
- package/dist/core/ui/systems/system.js +37 -0
- package/dist/oc/index.d.ts +142 -0
- package/dist/oc/index.js +1 -0
- package/doc/sapdon-ts.md +35 -1
- package/package.json +6 -8
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BiomeFilter } from "./biomeFilter.js";
|
|
2
|
+
/**
|
|
3
|
+
* 表示功能规则生成条件的类
|
|
4
|
+
*/
|
|
5
|
+
export class FeatureConditions {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.conditions = {
|
|
8
|
+
placement_pass: "underground_pass", // 默认值
|
|
9
|
+
"minecraft:biome_filter": []
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 设置生成阶段(placement_pass)
|
|
14
|
+
* @param {string} pass - 生成阶段标识符(如 "underground_pass")
|
|
15
|
+
* @returns {FeatureConditions} 返回自身以支持链式调用
|
|
16
|
+
*/
|
|
17
|
+
setPlacementPass(pass) {
|
|
18
|
+
this.conditions.placement_pass = pass;
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 设置生物群系过滤器
|
|
23
|
+
* @param {BiomeFilter} biomeFilter - 生物群系过滤条件对象
|
|
24
|
+
* @returns {FeatureConditions} 返回自身以支持链式调用
|
|
25
|
+
*/
|
|
26
|
+
setBiomeFilter(biomeFilter) {
|
|
27
|
+
this.conditions["minecraft:biome_filter"] = biomeFilter.toJson();
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 转换为 JSON 格式
|
|
32
|
+
* @returns {Object} 返回生成条件对象
|
|
33
|
+
*/
|
|
34
|
+
toJson() {
|
|
35
|
+
return this.conditions;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表示单个坐标轴(x/y/z)分布规则的类
|
|
3
|
+
*/
|
|
4
|
+
export class CoordinateDistribution {
|
|
5
|
+
/**
|
|
6
|
+
* @param {"uniform" | "triangle"} distribution - 分布类型
|
|
7
|
+
* @param {Array<number>} extent - 范围(如 [0, 16])
|
|
8
|
+
*/
|
|
9
|
+
constructor(distribution?: "uniform" | "triangle", extent?: Array<number>);
|
|
10
|
+
distribution: "triangle" | "uniform";
|
|
11
|
+
extent: number[];
|
|
12
|
+
/**
|
|
13
|
+
* 转换为 JSON 格式
|
|
14
|
+
* @returns {Object} 返回坐标分布配置
|
|
15
|
+
*/
|
|
16
|
+
toJson(): Object;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表示单个坐标轴(x/y/z)分布规则的类
|
|
3
|
+
*/
|
|
4
|
+
export class CoordinateDistribution {
|
|
5
|
+
/**
|
|
6
|
+
* @param {"uniform" | "triangle"} distribution - 分布类型
|
|
7
|
+
* @param {Array<number>} extent - 范围(如 [0, 16])
|
|
8
|
+
*/
|
|
9
|
+
constructor(distribution = "uniform", extent = [0, 16]) {
|
|
10
|
+
this.distribution = distribution;
|
|
11
|
+
this.extent = extent;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 转换为 JSON 格式
|
|
15
|
+
* @returns {Object} 返回坐标分布配置
|
|
16
|
+
*/
|
|
17
|
+
toJson() {
|
|
18
|
+
return {
|
|
19
|
+
distribution: this.distribution,
|
|
20
|
+
extent: this.extent
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表示功能规则分布配置的类
|
|
3
|
+
*/
|
|
4
|
+
export class FeatureDistribution {
|
|
5
|
+
distribution: {
|
|
6
|
+
iterations: number;
|
|
7
|
+
coordinate_eval_order: string;
|
|
8
|
+
x: Object;
|
|
9
|
+
y: Object;
|
|
10
|
+
z: Object;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* 设置迭代次数
|
|
14
|
+
* @param {number} iterations - 放置尝试次数
|
|
15
|
+
* @returns {FeatureDistribution} 返回自身以支持链式调用
|
|
16
|
+
*/
|
|
17
|
+
setIterations(iterations: number): FeatureDistribution;
|
|
18
|
+
/**
|
|
19
|
+
* 设置坐标轴的分布规则
|
|
20
|
+
* @param {"x" | "y" | "z"} axis - 坐标轴
|
|
21
|
+
* @param {CoordinateDistribution} config - 分布配置
|
|
22
|
+
* @returns {FeatureDistribution} 返回自身以支持链式调用
|
|
23
|
+
*/
|
|
24
|
+
setAxisDistribution(axis: "x" | "y" | "z", config: CoordinateDistribution): FeatureDistribution;
|
|
25
|
+
/**
|
|
26
|
+
* 转换为 JSON 格式
|
|
27
|
+
* @returns {Object} 返回分布规则对象
|
|
28
|
+
*/
|
|
29
|
+
toJson(): Object;
|
|
30
|
+
}
|
|
31
|
+
import { CoordinateDistribution } from "./coordinateDistribution.js";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CoordinateDistribution } from "./coordinateDistribution.js";
|
|
2
|
+
/**
|
|
3
|
+
* 表示功能规则分布配置的类
|
|
4
|
+
*/
|
|
5
|
+
export class FeatureDistribution {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.distribution = {
|
|
8
|
+
iterations: 10, // 默认值
|
|
9
|
+
coordinate_eval_order: "zyx",
|
|
10
|
+
x: new CoordinateDistribution().toJson(),
|
|
11
|
+
y: new CoordinateDistribution().toJson(),
|
|
12
|
+
z: new CoordinateDistribution().toJson()
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 设置迭代次数
|
|
17
|
+
* @param {number} iterations - 放置尝试次数
|
|
18
|
+
* @returns {FeatureDistribution} 返回自身以支持链式调用
|
|
19
|
+
*/
|
|
20
|
+
setIterations(iterations) {
|
|
21
|
+
this.distribution.iterations = iterations;
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 设置坐标轴的分布规则
|
|
26
|
+
* @param {"x" | "y" | "z"} axis - 坐标轴
|
|
27
|
+
* @param {CoordinateDistribution} config - 分布配置
|
|
28
|
+
* @returns {FeatureDistribution} 返回自身以支持链式调用
|
|
29
|
+
*/
|
|
30
|
+
setAxisDistribution(axis, config) {
|
|
31
|
+
this.distribution[axis] = config.toJson();
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 转换为 JSON 格式
|
|
36
|
+
* @returns {Object} 返回分布规则对象
|
|
37
|
+
*/
|
|
38
|
+
toJson() {
|
|
39
|
+
return this.distribution;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class FeatureRule {
|
|
2
|
+
constructor(identifier: any, places_feature: any);
|
|
3
|
+
identifier: any;
|
|
4
|
+
places_feature: any;
|
|
5
|
+
condition: FeatureConditions;
|
|
6
|
+
distribution: FeatureDistribution;
|
|
7
|
+
setPlacementPass(pass: any): void;
|
|
8
|
+
setBiomeFilter(biomeFilter: any): void;
|
|
9
|
+
setIterations(iterations: any): void;
|
|
10
|
+
setAxisDistribution(axis: any, config: any): void;
|
|
11
|
+
toJson(): {
|
|
12
|
+
format_version: any;
|
|
13
|
+
"minecraft:feature_rules": any;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
import { FeatureConditions } from "./condition/featureConditions.js";
|
|
17
|
+
import { FeatureDistribution } from "./distribution/featureDistribution.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AddonFeatureRule, AddonFeatureRuleDecription, AddonFeatureRuleDenifition } from "../addon/featureRule.js";
|
|
2
|
+
import { FeatureConditions } from "./condition/featureConditions.js";
|
|
3
|
+
import { FeatureDistribution } from "./distribution/featureDistribution.js";
|
|
4
|
+
export class FeatureRule {
|
|
5
|
+
constructor(identifier, places_feature) {
|
|
6
|
+
this.identifier = identifier;
|
|
7
|
+
this.places_feature = places_feature;
|
|
8
|
+
this.condition = new FeatureConditions();
|
|
9
|
+
this.distribution = new FeatureDistribution();
|
|
10
|
+
}
|
|
11
|
+
setPlacementPass(pass) {
|
|
12
|
+
this.condition.setPlacementPass(pass);
|
|
13
|
+
}
|
|
14
|
+
setBiomeFilter(biomeFilter) {
|
|
15
|
+
this.condition.setBiomeFilter(biomeFilter);
|
|
16
|
+
}
|
|
17
|
+
setIterations(iterations) {
|
|
18
|
+
this.distribution.setIterations(iterations);
|
|
19
|
+
}
|
|
20
|
+
setAxisDistribution(axis, config) {
|
|
21
|
+
this.distribution.setAxisDistribution(axis, config);
|
|
22
|
+
}
|
|
23
|
+
toJson() {
|
|
24
|
+
return new AddonFeatureRule("1.13.0", new AddonFeatureRuleDenifition(new AddonFeatureRuleDecription(this.identifier, this.places_feature), this.condition.toJson(), this.distribution.toJson())).toJson();
|
|
25
|
+
}
|
|
26
|
+
}
|