sapdon 3.0.0 → 3.0.2

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.
Files changed (206) hide show
  1. package/README.md +9 -7
  2. package/doc/cli.md +24 -0
  3. package/doc/sapdon-ts.md +17 -5
  4. package/package.json +2 -2
  5. package/dist/cli/build.d.ts +0 -7
  6. package/dist/cli/build.js +0 -232
  7. package/dist/cli/dev-server/client.d.ts +0 -2
  8. package/dist/cli/dev-server/client.js +0 -20
  9. package/dist/cli/dev-server/config.d.ts +0 -3
  10. package/dist/cli/dev-server/config.js +0 -3
  11. package/dist/cli/dev-server/hmr.d.ts +0 -1
  12. package/dist/cli/dev-server/hmr.js +0 -13
  13. package/dist/cli/dev-server/index.d.ts +0 -3
  14. package/dist/cli/dev-server/index.js +0 -11
  15. package/dist/cli/dev-server/server.d.ts +0 -6
  16. package/dist/cli/dev-server/server.js +0 -50
  17. package/dist/cli/dev-server/syncFiles.d.ts +0 -3
  18. package/dist/cli/dev-server/syncFiles.js +0 -36
  19. package/dist/cli/index.d.ts +0 -1
  20. package/dist/cli/index.js +0 -1
  21. package/dist/cli/init.d.ts +0 -9
  22. package/dist/cli/init.js +0 -80
  23. package/dist/cli/load.d.ts +0 -3
  24. package/dist/cli/load.js +0 -94
  25. package/dist/cli/start.d.ts +0 -2
  26. package/dist/cli/start.js +0 -156
  27. package/dist/cli/tools/textureSet.d.ts +0 -13
  28. package/dist/cli/tools/textureSet.js +0 -103
  29. package/dist/cli/utils.d.ts +0 -13
  30. package/dist/cli/utils.js +0 -89
  31. package/dist/core/addon/biome.d.ts +0 -22
  32. package/dist/core/addon/biome.js +0 -27
  33. package/dist/core/addon/block/block.d.ts +0 -41
  34. package/dist/core/addon/block/block.js +0 -46
  35. package/dist/core/addon/controllers/animationController.d.ts +0 -43
  36. package/dist/core/addon/controllers/animationController.js +0 -73
  37. package/dist/core/addon/entity/clientEntity.d.ts +0 -107
  38. package/dist/core/addon/entity/clientEntity.js +0 -149
  39. package/dist/core/addon/entity/entity.d.ts +0 -42
  40. package/dist/core/addon/entity/entity.js +0 -50
  41. package/dist/core/addon/feature/oreFeature.d.ts +0 -19
  42. package/dist/core/addon/feature/oreFeature.js +0 -24
  43. package/dist/core/addon/featureRule.d.ts +0 -20
  44. package/dist/core/addon/featureRule.js +0 -25
  45. package/dist/core/addon/item/attachable.d.ts +0 -94
  46. package/dist/core/addon/item/attachable.js +0 -134
  47. package/dist/core/addon/item/item.d.ts +0 -19
  48. package/dist/core/addon/item/item.js +0 -26
  49. package/dist/core/addon/manifest.d.ts +0 -49
  50. package/dist/core/addon/manifest.js +0 -65
  51. package/dist/core/addon/menuCategory.d.ts +0 -6
  52. package/dist/core/addon/menuCategory.js +0 -7
  53. package/dist/core/addon/recipe/baseRecipe.d.ts +0 -12
  54. package/dist/core/addon/recipe/baseRecipe.js +0 -23
  55. package/dist/core/addon/recipe/data.d.ts +0 -66
  56. package/dist/core/addon/recipe/data.js +0 -74
  57. package/dist/core/addon/recipe/furnace.d.ts +0 -17
  58. package/dist/core/addon/recipe/furnace.js +0 -43
  59. package/dist/core/addon/recipe/shaped.d.ts +0 -26
  60. package/dist/core/addon/recipe/shaped.js +0 -53
  61. package/dist/core/addon/recipe/shapeless.d.ts +0 -18
  62. package/dist/core/addon/recipe/shapeless.js +0 -36
  63. package/dist/core/biome/biome.d.ts +0 -14
  64. package/dist/core/biome/biome.js +0 -23
  65. package/dist/core/biome/biomeComponent.d.ts +0 -46
  66. package/dist/core/biome/biomeComponent.js +0 -77
  67. package/dist/core/block/basicBlock.d.ts +0 -48
  68. package/dist/core/block/basicBlock.js +0 -105
  69. package/dist/core/block/block.d.ts +0 -32
  70. package/dist/core/block/block.js +0 -92
  71. package/dist/core/block/blockComponent.d.ts +0 -187
  72. package/dist/core/block/blockComponent.js +0 -500
  73. package/dist/core/block/cropBlock.d.ts +0 -4
  74. package/dist/core/block/cropBlock.js +0 -27
  75. package/dist/core/block/geometryBlock.d.ts +0 -12
  76. package/dist/core/block/geometryBlock.js +0 -16
  77. package/dist/core/block/oreBlock.d.ts +0 -9
  78. package/dist/core/block/oreBlock.js +0 -25
  79. package/dist/core/block/rotatableBlock.d.ts +0 -27
  80. package/dist/core/block/rotatableBlock.js +0 -107
  81. package/dist/core/block/tileBlock.d.ts +0 -17
  82. package/dist/core/block/tileBlock.js +0 -125
  83. package/dist/core/entity/basicEntity.d.ts +0 -111
  84. package/dist/core/entity/basicEntity.js +0 -170
  85. package/dist/core/entity/behavior/followMob.d.ts +0 -12
  86. package/dist/core/entity/behavior/followMob.js +0 -35
  87. package/dist/core/entity/behavior/followParent.d.ts +0 -7
  88. package/dist/core/entity/behavior/followParent.js +0 -15
  89. package/dist/core/entity/behavior/randomStroll.d.ts +0 -31
  90. package/dist/core/entity/behavior/randomStroll.js +0 -63
  91. package/dist/core/entity/behavior/tempt.d.ts +0 -73
  92. package/dist/core/entity/behavior/tempt.js +0 -134
  93. package/dist/core/entity/bundles/basicBundle.d.ts +0 -13
  94. package/dist/core/entity/bundles/basicBundle.js +0 -45
  95. package/dist/core/entity/clientEntity.d.ts +0 -20
  96. package/dist/core/entity/clientEntity.js +0 -37
  97. package/dist/core/entity/componets/entityComponet.d.ts +0 -202
  98. package/dist/core/entity/componets/entityComponet.js +0 -347
  99. package/dist/core/entity/data/nativeEntityData.d.ts +0 -9
  100. package/dist/core/entity/data/nativeEntityData.js +0 -38
  101. package/dist/core/entity/entity.d.ts +0 -15
  102. package/dist/core/entity/entity.js +0 -18
  103. package/dist/core/entity/nativeEntity.d.ts +0 -8
  104. package/dist/core/entity/nativeEntity.js +0 -28
  105. package/dist/core/entity/navigation/walk.d.ts +0 -23
  106. package/dist/core/entity/navigation/walk.js +0 -56
  107. package/dist/core/entity/projectile.d.ts +0 -3
  108. package/dist/core/entity/projectile.js +0 -7
  109. package/dist/core/factory/biomeFactory.d.ts +0 -4
  110. package/dist/core/factory/biomeFactory.js +0 -13
  111. package/dist/core/factory/blockFactory.d.ts +0 -34
  112. package/dist/core/factory/blockFactory.js +0 -143
  113. package/dist/core/factory/entityFactory.d.ts +0 -17
  114. package/dist/core/factory/entityFactory.js +0 -75
  115. package/dist/core/factory/featureFactory.d.ts +0 -6
  116. package/dist/core/factory/featureFactory.js +0 -23
  117. package/dist/core/factory/itemExtra.d.ts +0 -8
  118. package/dist/core/factory/itemExtra.js +0 -9
  119. package/dist/core/factory/itemFactory.d.ts +0 -27
  120. package/dist/core/factory/itemFactory.js +0 -112
  121. package/dist/core/factory/recipeFactory.d.ts +0 -18
  122. package/dist/core/factory/recipeFactory.js +0 -39
  123. package/dist/core/factory/uiFactory.d.ts +0 -11
  124. package/dist/core/factory/uiFactory.js +0 -32
  125. package/dist/core/feature/oreFeature.d.ts +0 -10
  126. package/dist/core/feature/oreFeature.js +0 -11
  127. package/dist/core/feature-rule/condition/biomeFilter.d.ts +0 -26
  128. package/dist/core/feature-rule/condition/biomeFilter.js +0 -36
  129. package/dist/core/feature-rule/condition/featureConditions.d.ts +0 -27
  130. package/dist/core/feature-rule/condition/featureConditions.js +0 -37
  131. package/dist/core/feature-rule/distribution/coordinateDistribution.d.ts +0 -17
  132. package/dist/core/feature-rule/distribution/coordinateDistribution.js +0 -23
  133. package/dist/core/feature-rule/distribution/featureDistribution.d.ts +0 -31
  134. package/dist/core/feature-rule/distribution/featureDistribution.js +0 -41
  135. package/dist/core/feature-rule/featureRule.d.ts +0 -17
  136. package/dist/core/feature-rule/featureRule.js +0 -26
  137. package/dist/core/index.d.ts +0 -24
  138. package/dist/core/index.js +0 -21
  139. package/dist/core/item/armor.d.ts +0 -21
  140. package/dist/core/item/armor.js +0 -90
  141. package/dist/core/item/attachable.d.ts +0 -6
  142. package/dist/core/item/attachable.js +0 -26
  143. package/dist/core/item/food.d.ts +0 -24
  144. package/dist/core/item/food.js +0 -38
  145. package/dist/core/item/item.d.ts +0 -36
  146. package/dist/core/item/item.js +0 -69
  147. package/dist/core/item/itemComponents.d.ts +0 -113
  148. package/dist/core/item/itemComponents.js +0 -225
  149. package/dist/core/registry.d.ts +0 -12
  150. package/dist/core/registry.js +0 -16
  151. package/dist/core/texture.d.ts +0 -18
  152. package/dist/core/texture.js +0 -38
  153. package/dist/core/ui/buttonMapping.d.ts +0 -97
  154. package/dist/core/ui/buttonMapping.js +0 -132
  155. package/dist/core/ui/dataBindingObject.d.ts +0 -97
  156. package/dist/core/ui/dataBindingObject.js +0 -134
  157. package/dist/core/ui/elements/button.d.ts +0 -21
  158. package/dist/core/ui/elements/button.js +0 -101
  159. package/dist/core/ui/elements/collectionPanel.d.ts +0 -12
  160. package/dist/core/ui/elements/collectionPanel.js +0 -53
  161. package/dist/core/ui/elements/grid.d.ts +0 -8
  162. package/dist/core/ui/elements/grid.js +0 -33
  163. package/dist/core/ui/elements/image.d.ts +0 -13
  164. package/dist/core/ui/elements/image.js +0 -55
  165. package/dist/core/ui/elements/label.d.ts +0 -14
  166. package/dist/core/ui/elements/label.js +0 -61
  167. package/dist/core/ui/elements/panel.d.ts +0 -11
  168. package/dist/core/ui/elements/panel.js +0 -49
  169. package/dist/core/ui/elements/scrollingPanel.d.ts +0 -14
  170. package/dist/core/ui/elements/scrollingPanel.js +0 -59
  171. package/dist/core/ui/elements/stackPanel.d.ts +0 -14
  172. package/dist/core/ui/elements/stackPanel.js +0 -37
  173. package/dist/core/ui/elements/uiElement.d.ts +0 -53
  174. package/dist/core/ui/elements/uiElement.js +0 -129
  175. package/dist/core/ui/properties/control.d.ts +0 -214
  176. package/dist/core/ui/properties/control.js +0 -286
  177. package/dist/core/ui/properties/dataBinding.d.ts +0 -6
  178. package/dist/core/ui/properties/dataBinding.js +0 -16
  179. package/dist/core/ui/properties/factory.d.ts +0 -37
  180. package/dist/core/ui/properties/factory.js +0 -62
  181. package/dist/core/ui/properties/gridProp.d.ts +0 -65
  182. package/dist/core/ui/properties/gridProp.js +0 -90
  183. package/dist/core/ui/properties/input.d.ts +0 -97
  184. package/dist/core/ui/properties/input.js +0 -134
  185. package/dist/core/ui/properties/layout.d.ts +0 -105
  186. package/dist/core/ui/properties/layout.js +0 -145
  187. package/dist/core/ui/properties/scrollView.d.ts +0 -105
  188. package/dist/core/ui/properties/scrollView.js +0 -145
  189. package/dist/core/ui/properties/sound.d.ts +0 -47
  190. package/dist/core/ui/properties/sound.js +0 -66
  191. package/dist/core/ui/properties/sprite.d.ts +0 -161
  192. package/dist/core/ui/properties/sprite.js +0 -222
  193. package/dist/core/ui/properties/text.d.ts +0 -135
  194. package/dist/core/ui/properties/text.js +0 -187
  195. package/dist/core/ui/registry/uiSystemRegistry.d.ts +0 -8
  196. package/dist/core/ui/registry/uiSystemRegistry.js +0 -26
  197. package/dist/core/ui/systems/chest.d.ts +0 -4
  198. package/dist/core/ui/systems/chest.js +0 -21
  199. package/dist/core/ui/systems/containerUISystem.d.ts +0 -64
  200. package/dist/core/ui/systems/containerUISystem.js +0 -206
  201. package/dist/core/ui/systems/guidebook.d.ts +0 -8
  202. package/dist/core/ui/systems/guidebook.js +0 -206
  203. package/dist/core/ui/systems/serverForm.d.ts +0 -12
  204. package/dist/core/ui/systems/serverForm.js +0 -116
  205. package/dist/core/ui/systems/system.d.ts +0 -16
  206. package/dist/core/ui/systems/system.js +0 -37
@@ -1,73 +0,0 @@
1
- export class AddonAnimationController {
2
- constructor(format_version, definition) {
3
- this.format_version = format_version;
4
- this.definition = definition;
5
- }
6
- toJson() {
7
- return {
8
- format_version: this.format_version,
9
- ["animation_controllers"]: this.definition
10
- };
11
- }
12
- }
13
- export class AddonAnimationStateMachine {
14
- constructor(identifier) {
15
- this.identifier = identifier; // 状态机的唯一标识符(例如 "helicopter.blade")
16
- this.namespace = identifier.split(":")[0]; // 标识符的命名空间部分(冒号前的部分)
17
- this.name = identifier.split(":")[1]; // 标识符的名称部分(冒号后的部分)
18
- // 状态机属性
19
- this.initialState = null; // 状态机的初始状态
20
- this.states = new Map(); // 使用 Map 存储所有状态,键为状态名,值为状态数据
21
- }
22
- /**
23
- * 设置状态机的初始状态。
24
- * @param {string} stateName - 初始状态的名称。
25
- * @returns {AddonAnimationStateMachine} - 返回实例以支持链式调用。
26
- */
27
- setInitialState(stateName) {
28
- this.initialState = stateName;
29
- return this; // 支持链式调用
30
- }
31
- /**
32
- * 添加一个新状态到状态机。
33
- * @param {string} stateName - 状态的名称。
34
- * @param {string[]} animations - 该状态播放的动画列表。
35
- * @returns {AddonAnimationStateMachine} - 返回实例以支持链式调用。
36
- */
37
- addState(stateName, animations = []) {
38
- this.states.set(stateName, {
39
- animations: animations, // 该状态的动画列表
40
- transitions: [] // 该状态的过渡条件列表
41
- });
42
- return this; // 支持链式调用
43
- }
44
- /**
45
- * 添加一个状态之间的过渡条件。
46
- * @param {string} fromState - 过渡的起始状态名称。
47
- * @param {string} toState - 过渡的目标状态名称。
48
- * @param {string} condition - 触发过渡的条件(例如 "q.is_on_ground")。
49
- * @returns {AddonAnimationStateMachine} - 返回实例以支持链式调用。
50
- */
51
- addTransition(fromState, toState, condition) {
52
- if (!this.states.has(fromState)) {
53
- throw new Error(`状态 "${fromState}" 不存在。`);
54
- }
55
- const state = this.states.get(fromState);
56
- state.transitions.push({
57
- [toState]: condition // 添加过渡条件
58
- });
59
- return this; // 支持链式调用
60
- }
61
- /**
62
- * 将整个状态机转换为 JSON 兼容的对象。
63
- * @returns {object} - 包含格式版本的完整动画控制器定义。
64
- */
65
- toJson() {
66
- return {
67
- [`controller.animation.${this.namespace}.${this.name}`]: {
68
- initial_state: this.initialState,
69
- states: Object.fromEntries(this.states)
70
- }
71
- };
72
- }
73
- }
@@ -1,107 +0,0 @@
1
- export class AddonClientEntity {
2
- /**
3
- * 客户端实体类
4
- * @param {string} format_version 格式版本
5
- * @param {AddonClientEntityDefinition} definitions 实体定义
6
- */
7
- constructor(format_version: string, definitions: AddonClientEntityDefinition);
8
- format_version: string;
9
- definitions: AddonClientEntityDefinition;
10
- /**
11
- * 将对象转换为 JSON 格式
12
- * @returns {Object} JSON 对象
13
- */
14
- toJson(): any;
15
- }
16
- export class AddonClientEntityDefinition {
17
- /**
18
- * 客户端实体定义类
19
- * @param {Description} description 实体描述
20
- */
21
- constructor(description: Description);
22
- description: Description;
23
- }
24
- export class AddonClientEntityDescription {
25
- /**
26
- * 实体描述类
27
- * @param {string} identifier 实体标识符
28
- * @param {string} min_engine_version 最低引擎版本
29
- */
30
- constructor(identifier: string, min_engine_version: string);
31
- identifier: string;
32
- min_engine_version: string;
33
- /**
34
- * 添加材质
35
- * @param {string} name 材质名称
36
- * @param {string} material 材质路径
37
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
38
- */
39
- addMaterial(name: string, material: string): AddonClientEntityDescription;
40
- materials: {};
41
- /**
42
- * 添加纹理
43
- * @param {string} name 纹理名称
44
- * @param {string} texture 纹理路径
45
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
46
- */
47
- addTexture(name: string, texture: string): AddonClientEntityDescription;
48
- textures: {};
49
- /**
50
- * 添加几何体
51
- * @param {string} name 几何体名称
52
- * @param {string} geometry 几何体路径
53
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
54
- */
55
- addGeometry(name: string, geometry: string): AddonClientEntityDescription;
56
- geometry: {};
57
- /**
58
- * 添加动画
59
- * @param {string} name 动画名称
60
- * @param {string} animation 动画路径
61
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
62
- */
63
- addAnimation(name: string, animation: string): AddonClientEntityDescription;
64
- animations: {};
65
- /**
66
- * 添加动画控制器
67
- * @param {string} name 控制器名称
68
- * @param {string} controller 控制器路径
69
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
70
- */
71
- addAnimationController(name: string, controller: string): AddonClientEntityDescription;
72
- animation_controllers: any[];
73
- /**
74
- * 添加渲染控制器
75
- * @param {string} controller 渲染控制器路径
76
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
77
- */
78
- addRenderController(controller: string): AddonClientEntityDescription;
79
- render_controllers: any[];
80
- /**
81
- * 添加定位器
82
- * @param {string} name 定位器名称
83
- * @param {Object} locator 定位器数据
84
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
85
- */
86
- addLocator(name: string, locator: any): AddonClientEntityDescription;
87
- locators: {};
88
- /**
89
- * 设置生成蛋
90
- * @param {string} texture 生成蛋纹理
91
- * @param {number} texture_index 生成蛋纹理索引
92
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
93
- */
94
- setSpawnEgg(texture: string, texture_index: number): AddonClientEntityDescription;
95
- spawn_egg: {
96
- texture: string;
97
- texture_index: number;
98
- };
99
- /**
100
- * 设置脚本
101
- * @param {string} key 脚本键
102
- * @param {string} value 脚本值
103
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
104
- */
105
- setScript(key: string, value: string): AddonClientEntityDescription;
106
- scripts: {};
107
- }
@@ -1,149 +0,0 @@
1
- export class AddonClientEntity {
2
- /**
3
- * 客户端实体类
4
- * @param {string} format_version 格式版本
5
- * @param {AddonClientEntityDefinition} definitions 实体定义
6
- */
7
- constructor(format_version, definitions) {
8
- this.format_version = format_version;
9
- this.definitions = definitions;
10
- }
11
- /**
12
- * 将对象转换为 JSON 格式
13
- * @returns {Object} JSON 对象
14
- */
15
- toJson() {
16
- return {
17
- format_version: this.format_version,
18
- ["minecraft:client_entity"]: this.definitions
19
- };
20
- }
21
- }
22
- export class AddonClientEntityDefinition {
23
- /**
24
- * 客户端实体定义类
25
- * @param {Description} description 实体描述
26
- */
27
- constructor(description) {
28
- this.description = description;
29
- }
30
- }
31
- export class AddonClientEntityDescription {
32
- /**
33
- * 实体描述类
34
- * @param {string} identifier 实体标识符
35
- * @param {string} min_engine_version 最低引擎版本
36
- */
37
- constructor(identifier, min_engine_version) {
38
- this.identifier = identifier;
39
- this.min_engine_version = min_engine_version;
40
- }
41
- /**
42
- * 添加材质
43
- * @param {string} name 材质名称
44
- * @param {string} material 材质路径
45
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
46
- */
47
- addMaterial(name, material) {
48
- if (this.materials == undefined)
49
- this.materials = {};
50
- this.materials[name] = material;
51
- return this;
52
- }
53
- /**
54
- * 添加纹理
55
- * @param {string} name 纹理名称
56
- * @param {string} texture 纹理路径
57
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
58
- */
59
- addTexture(name, texture) {
60
- if (this.textures == undefined)
61
- this.textures = {};
62
- this.textures[name] = texture;
63
- return this;
64
- }
65
- /**
66
- * 添加几何体
67
- * @param {string} name 几何体名称
68
- * @param {string} geometry 几何体路径
69
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
70
- */
71
- addGeometry(name, geometry) {
72
- if (this.geometry == undefined)
73
- this.geometry = {};
74
- this.geometry[name] = geometry;
75
- return this;
76
- }
77
- /**
78
- * 添加动画
79
- * @param {string} name 动画名称
80
- * @param {string} animation 动画路径
81
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
82
- */
83
- addAnimation(name, animation) {
84
- if (this.animations == undefined)
85
- this.animations = {};
86
- this.animations[name] = animation;
87
- return this;
88
- }
89
- /**
90
- * 添加动画控制器
91
- * @param {string} name 控制器名称
92
- * @param {string} controller 控制器路径
93
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
94
- */
95
- addAnimationController(name, controller) {
96
- if (this.animation_controllers == undefined)
97
- this.animation_controllers = [];
98
- this.animation_controllers.push({ [name]: controller });
99
- return this;
100
- }
101
- /**
102
- * 添加渲染控制器
103
- * @param {string} controller 渲染控制器路径
104
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
105
- */
106
- addRenderController(controller) {
107
- if (this.render_controllers == undefined)
108
- this.render_controllers = [];
109
- this.render_controllers.push(controller);
110
- return this;
111
- }
112
- /**
113
- * 添加定位器
114
- * @param {string} name 定位器名称
115
- * @param {Object} locator 定位器数据
116
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
117
- */
118
- addLocator(name, locator) {
119
- if (this.locators == undefined)
120
- this.locators = {};
121
- this.locators[name] = locator;
122
- return this;
123
- }
124
- /**
125
- * 设置生成蛋
126
- * @param {string} texture 生成蛋纹理
127
- * @param {number} texture_index 生成蛋纹理索引
128
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
129
- */
130
- setSpawnEgg(texture, texture_index) {
131
- this.spawn_egg = {
132
- texture: texture,
133
- texture_index: texture_index
134
- };
135
- return this;
136
- }
137
- /**
138
- * 设置脚本
139
- * @param {string} key 脚本键
140
- * @param {string} value 脚本值
141
- * @returns {AddonClientEntityDescription} 返回当前实例以支持链式调用
142
- */
143
- setScript(key, value) {
144
- if (this.scripts == undefined)
145
- this.scripts = {};
146
- this.scripts[key] = value;
147
- return this;
148
- }
149
- }
@@ -1,42 +0,0 @@
1
- export class AddonEntity {
2
- /**
3
- * 实体类
4
- * @param {string} format_version 格式版本
5
- * @param {AddonEntityDefinition} definitions 实体定义
6
- */
7
- constructor(format_version: string, definitions: AddonEntityDefinition);
8
- format_version: string;
9
- definitions: AddonEntityDefinition;
10
- /**
11
- * 将对象转换为 JSON 格式
12
- * @returns {Object} JSON 对象
13
- */
14
- toJson(): any;
15
- }
16
- export class AddonEntityDefinition {
17
- /**
18
- * 实体定义类
19
- * @param {AddonEntityDescription} description 实体描述
20
- * @param {Object} components 实体组件
21
- */
22
- constructor(description: AddonEntityDescription, components?: any, component_groups?: {}, events?: {});
23
- description: AddonEntityDescription;
24
- components: any;
25
- component_groups: {};
26
- events: {};
27
- }
28
- export class AddonEntityDescription {
29
- /**
30
- * 实体描述类
31
- * @param {string} identifier 实体标识符
32
- * @param {boolean} is_spawnable 是否可生成
33
- * @param {boolean} is_summonable 是否可召唤
34
- * @param {string} runtime_identifier 复刻标识符
35
- */
36
- constructor(identifier: string, is_spawnable: boolean, is_summonable: boolean, properties: {}, runtime_identifier: string);
37
- identifier: string;
38
- is_spawnable: boolean;
39
- is_summonable: boolean;
40
- properties: {};
41
- runtime_identifier: string;
42
- }
@@ -1,50 +0,0 @@
1
- export class AddonEntity {
2
- /**
3
- * 实体类
4
- * @param {string} format_version 格式版本
5
- * @param {AddonEntityDefinition} definitions 实体定义
6
- */
7
- constructor(format_version, definitions) {
8
- this.format_version = format_version;
9
- this.definitions = definitions;
10
- }
11
- /**
12
- * 将对象转换为 JSON 格式
13
- * @returns {Object} JSON 对象
14
- */
15
- toJson() {
16
- return {
17
- format_version: this.format_version,
18
- ["minecraft:entity"]: this.definitions
19
- };
20
- }
21
- }
22
- export class AddonEntityDefinition {
23
- /**
24
- * 实体定义类
25
- * @param {AddonEntityDescription} description 实体描述
26
- * @param {Object} components 实体组件
27
- */
28
- constructor(description, components = {}, component_groups = {}, events = {}) {
29
- this.description = description;
30
- this.components = components; // 修正拼写错误
31
- this.component_groups = component_groups;
32
- this.events = events;
33
- }
34
- }
35
- export class AddonEntityDescription {
36
- /**
37
- * 实体描述类
38
- * @param {string} identifier 实体标识符
39
- * @param {boolean} is_spawnable 是否可生成
40
- * @param {boolean} is_summonable 是否可召唤
41
- * @param {string} runtime_identifier 复刻标识符
42
- */
43
- constructor(identifier, is_spawnable = false, is_summonable = false, properties = {}, runtime_identifier) {
44
- this.identifier = identifier;
45
- this.is_spawnable = is_spawnable;
46
- this.is_summonable = is_summonable;
47
- this.properties = properties;
48
- this.runtime_identifier = runtime_identifier;
49
- }
50
- }
@@ -1,19 +0,0 @@
1
- export class AddonOreFeature {
2
- constructor(format_version: any, definition: any);
3
- format_version: any;
4
- definition: any;
5
- toJson(): {
6
- format_version: any;
7
- "minecraft:ore_feature": any;
8
- };
9
- }
10
- export class AddonOreFeatureDescription {
11
- constructor(identifier: any);
12
- identifier: any;
13
- }
14
- export class AddonOreFeatureDefinition {
15
- constructor(description: any, count: any, replace_rules: any);
16
- description: any;
17
- count: any;
18
- replace_rules: any;
19
- }
@@ -1,24 +0,0 @@
1
- export class AddonOreFeature {
2
- constructor(format_version, definition) {
3
- this.format_version = format_version;
4
- this.definition = definition;
5
- }
6
- toJson() {
7
- return {
8
- format_version: this.format_version,
9
- ["minecraft:ore_feature"]: this.definition
10
- };
11
- }
12
- }
13
- export class AddonOreFeatureDescription {
14
- constructor(identifier) {
15
- this.identifier = identifier;
16
- }
17
- }
18
- export class AddonOreFeatureDefinition {
19
- constructor(description, count, replace_rules) {
20
- this.description = description;
21
- this.count = count;
22
- this.replace_rules = replace_rules;
23
- }
24
- }
@@ -1,20 +0,0 @@
1
- export class AddonFeatureRule {
2
- constructor(format_version: any, denifition: any);
3
- format_version: any;
4
- denifition: any;
5
- toJson(): {
6
- format_version: any;
7
- "minecraft:feature_rules": any;
8
- };
9
- }
10
- export class AddonFeatureRuleDenifition {
11
- constructor(description: any, conditions: any, distribution: any);
12
- description: any;
13
- conditions: any;
14
- distribution: any;
15
- }
16
- export class AddonFeatureRuleDecription {
17
- constructor(identifier: any, places_feature: any);
18
- identifier: any;
19
- places_feature: any;
20
- }
@@ -1,25 +0,0 @@
1
- export class AddonFeatureRule {
2
- constructor(format_version, denifition) {
3
- this.format_version = format_version;
4
- this.denifition = denifition;
5
- }
6
- toJson() {
7
- return {
8
- format_version: this.format_version,
9
- ["minecraft:feature_rules"]: this.denifition
10
- };
11
- }
12
- }
13
- export class AddonFeatureRuleDenifition {
14
- constructor(description, conditions, distribution) {
15
- this.description = description;
16
- this.conditions = conditions;
17
- this.distribution = distribution;
18
- }
19
- }
20
- export class AddonFeatureRuleDecription {
21
- constructor(identifier, places_feature) {
22
- this.identifier = identifier;
23
- this.places_feature = places_feature;
24
- }
25
- }
@@ -1,94 +0,0 @@
1
- export class AddonAttachable {
2
- /**
3
- * 可附着物类 继承客户端实体
4
- * @param {string} format_version 格式版本
5
- * @param {AddonAttachableDefinition} definitions 实体定义
6
- */
7
- constructor(format_version: string, definitions: AddonAttachableDefinition);
8
- format_version: string;
9
- definitions: AddonAttachableDefinition;
10
- /**
11
- * 将对象转换为 JSON 格式
12
- * @returns {Object} JSON 对象
13
- */
14
- toJson(): any;
15
- }
16
- export class AddonAttachableDefinition {
17
- /**
18
- * 客户端实体定义类
19
- * @param {Description} description 实体描述
20
- */
21
- constructor(description: Description);
22
- description: Description;
23
- }
24
- export class AddonAttachableDescription {
25
- /**
26
- * 可附着物描述类
27
- * @param {string} identifier 标识符
28
- */
29
- constructor(identifier: string);
30
- identifier: string;
31
- /**
32
- * 添加材质
33
- * @param {string} name 材质名称
34
- * @param {string} material 材质路径
35
- * @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
36
- */
37
- addMaterial(name: string, material: string): AddonAttachableDescription;
38
- materials: {};
39
- /**
40
- * 添加纹理
41
- * @param {string} name 纹理名称
42
- * @param {string} texture 纹理路径
43
- * @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
44
- */
45
- addTexture(name: string, texture: string): AddonAttachableDescription;
46
- textures: {};
47
- /**
48
- * 添加几何体
49
- * @param {string} name 几何体名称
50
- * @param {string} geometry 几何体路径
51
- * @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
52
- */
53
- addGeometry(name: string, geometry: string): AddonAttachableDescription;
54
- geometry: {};
55
- /**
56
- * 添加动画
57
- * @param {string} name 动画名称
58
- * @param {string} animation 动画路径
59
- * @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
60
- */
61
- addAnimation(name: string, animation: string): AddonAttachableDescription;
62
- animations: {};
63
- /**
64
- * 添加动画控制器
65
- * @param {string} name 控制器名称
66
- * @param {string} controller 控制器路径
67
- * @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
68
- */
69
- addAnimationController(name: string, controller: string): AddonAttachableDescription;
70
- animation_controllers: any[];
71
- /**
72
- * 添加渲染控制器
73
- * @param {string} controller 渲染控制器路径
74
- * @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
75
- */
76
- addRenderController(controller: string): AddonAttachableDescription;
77
- render_controllers: any[];
78
- /**
79
- * 添加定位器
80
- * @param {string} name 定位器名称
81
- * @param {Object} locator 定位器数据
82
- * @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
83
- */
84
- addLocator(name: string, locator: any): AddonAttachableDescription;
85
- locators: {};
86
- /**
87
- * 设置脚本
88
- * @param {string} key 脚本键
89
- * @param {string} value 脚本值
90
- * @returns {AddonAttachableDescription} 返回当前实例以支持链式调用
91
- */
92
- setScript(key: string, value: string): AddonAttachableDescription;
93
- scripts: {};
94
- }