sapdon 3.3.3 → 3.4.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 +17 -7
- package/doc/dev/architecture.md +418 -415
- package/doc/dev/cli.md +467 -467
- package/doc/dev/core.md +751 -717
- package/doc/dev/lr-paradigm.md +85 -0
- package/doc/dev/workflow.md +257 -0
- package/doc/hello_sapdon/hello_sapdon.md +3 -3
- package/doc/user/api/block.md +599 -14
- package/doc/user/api/item.md +284 -55
- package/doc/user/api/neo-guidebook.md +409 -0
- package/doc/user/api/sapdon-ui.md +185 -0
- package/doc/user/config/build-config.md +4 -5
- package/doc/user/quick-start.md +20 -6
- package/doc/user/tutorials/block.md +12 -1
- package/doc/user/tutorials/item.md +3 -3
- package/doc/user/tutorials/neo-guidebook-experience.md +381 -0
- package/doc/user/tutorials/neo-guidebook.md +640 -0
- package/doc/user/tutorials/sapdon-ui.md +207 -0
- package/package.json +5 -1
- package/prod/cli/index.js +1 -1
- package/prod/cli/start.js +1 -1
- package/prod/core/index.d.ts +1557 -299
- package/prod/core/index.js +1 -1
- package/prod/oc/index.d.ts +3 -1
- package/prod/oc/index.js +1 -1
- package/prod/utils/index.d.ts +0 -7
- package/prod/utils/index.js +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Minecraft Bedrock 版 Addon 开发框架,将 JSON 配置抽象为 TypeScript
|
|
|
26
26
|
|
|
27
27
|
### 环境要求
|
|
28
28
|
|
|
29
|
-
- Node.js
|
|
29
|
+
- Node.js 18+
|
|
30
30
|
- npm
|
|
31
31
|
|
|
32
32
|
### 安装
|
|
@@ -61,10 +61,10 @@ my_addon/
|
|
|
61
61
|
|
|
62
62
|
```typescript
|
|
63
63
|
// main.ts
|
|
64
|
-
import { ItemAPI, EntityAPI, registry, ItemComponent } from '@sapdon/core'
|
|
64
|
+
import { ItemAPI, ItemCategory, EntityAPI, registry, ItemComponent } from '@sapdon/core'
|
|
65
65
|
|
|
66
66
|
// 创建一个物品
|
|
67
|
-
ItemAPI.createItem('my_addon:magic_ingot',
|
|
67
|
+
ItemAPI.createItem('my_addon:magic_ingot', ItemCategory.Items, 'magic_ingot')
|
|
68
68
|
.addComponent(ItemComponent.setDisplayName('魔法锭'))
|
|
69
69
|
|
|
70
70
|
// 提交注册
|
|
@@ -91,15 +91,17 @@ sapdon build .
|
|
|
91
91
|
### 物品
|
|
92
92
|
|
|
93
93
|
```typescript
|
|
94
|
+
import { ItemAPI, ItemCategory } from '@sapdon/core'
|
|
95
|
+
|
|
94
96
|
// 基础物品
|
|
95
|
-
ItemAPI.createItem('my:item',
|
|
97
|
+
ItemAPI.createItem('my:item', ItemCategory.Items, 'texture')
|
|
96
98
|
|
|
97
99
|
// 食物
|
|
98
|
-
ItemAPI.createFood('my:food',
|
|
99
|
-
.addComponent(ItemComponent.setFoodComponent(4, 0.6))
|
|
100
|
+
ItemAPI.createFood('my:food', ItemCategory.Items, 'apple')
|
|
101
|
+
.addComponent(ItemComponent.setFoodComponent({ nutrition: 4, saturationModifier: 0.6 }))
|
|
100
102
|
|
|
101
103
|
// 带自定义组件的物品
|
|
102
|
-
ItemAPI.createItem('my:tool',
|
|
104
|
+
ItemAPI.createItem('my:tool', ItemCategory.Items, 'tool_tex')
|
|
103
105
|
.addComponent(ItemComponent.setHandEquipped(true))
|
|
104
106
|
.addComponent(ItemComponent.setDurability(250))
|
|
105
107
|
.format_version = '1.21.90'
|
|
@@ -209,6 +211,8 @@ RecipeAPI.registerSimpleFurnace('my:smelted', 'my:ore')
|
|
|
209
211
|
| [实体教程](./doc/user/tutorials/entity.md) | 创建实体 → 组件 → AI 行为 |
|
|
210
212
|
| [方块教程](./doc/user/tutorials/block.md) | 基础方块 → 旋转 → 作物 |
|
|
211
213
|
| [配方教程](./doc/user/tutorials/recipe.md) | 有序/无序/熔炉配方 |
|
|
214
|
+
| [指南书教程](./doc/user/tutorials/neo-guidebook.md) | NeoGuidebook API 用法 |
|
|
215
|
+
| [指南书实战经验](./doc/user/tutorials/neo-guidebook-experience.md) | 接入流程与踩坑清单 |
|
|
212
216
|
| [物品 API](./doc/user/api/item.md) | ItemAPI、Item、ItemComponent |
|
|
213
217
|
| [实体 API](./doc/user/api/entity.md) | EntityAPI、EntityComponent、AI |
|
|
214
218
|
| [方块 API](./doc/user/api/block.md) | BlockAPI、BlockComponent |
|
|
@@ -239,6 +243,12 @@ npm run build
|
|
|
239
243
|
|
|
240
244
|
---
|
|
241
245
|
|
|
246
|
+
## 致谢
|
|
247
|
+
|
|
248
|
+
感谢 [Bedrock Wiki](https://wiki.bedrock.dev/) 提供的物品、方块、实体等组件与功能的方法文档,本项目(尤其是 `examples/items_demo` 中的自定义武器、投掷物品等示例)参考了其中的规范实现。
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
242
252
|
## 社区
|
|
243
253
|
|
|
244
254
|
- QQ 群:`810904181`
|