@occultus/music-api 0.18.1 → 0.20.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 CHANGED
@@ -1,6 +1,52 @@
1
1
  # Star Tenon Music API
2
2
 
3
- > [!IMPORTANT]
4
- > 该包仍处于开发阶段,可能会有一些问题亟待修复
3
+ 本包提供了音乐相关的 API,可以方便的创建新的音乐唱片。
5
4
 
6
- 本包提供了方便的自定义唱片的 API,可以方便的创建新的音乐唱片。
5
+ ## MusicDisc 和 MusicDiscServer
6
+
7
+ 本包提供了两个类:`MusicDisc` 和 `MusicDiscServer`,其分别用于储存自定义的音乐唱片的数据和管理音乐唱片服务器端逻辑。
8
+
9
+ 具体用法如下:
10
+
11
+ ```typescript
12
+ // 创建音乐唱片服务器实例
13
+ const musicServer = new MusicDiscServer();
14
+
15
+ // 创建一个新的音乐唱片实例
16
+ const disc = new MusicDisc(
17
+ "occultus:music_disc_example",
18
+ "Example Track",
19
+ "Example Disc",
20
+ "Example Artist"
21
+ );
22
+
23
+ // 添加唱片到服务器
24
+ musicServer.addDisc(disc);
25
+ ```
26
+
27
+ ## 支持版本
28
+
29
+ 本 API 支持任意可以运行 Script API v2.0.0+ 的游戏版本,包括:
30
+
31
+ - 1.21.90;
32
+ - 1.21.100;
33
+ - 1.21.110;
34
+ - 以及更多……
35
+
36
+ 注意:本包理论上可以在部分更旧的版本上运作,但未经过严格的测试。
37
+
38
+ ## 协议
39
+
40
+ 本项目使用 MIT License 授权:
41
+
42
+ ```text
43
+ The MIT License (MIT)
44
+
45
+ Copyright © 2025 CTN Studios
46
+
47
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
48
+
49
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
50
+
51
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
52
+ ```
package/package.json CHANGED
@@ -1,6 +1,15 @@
1
1
  {
2
2
  "name": "@occultus/music-api",
3
- "version": "0.18.1",
3
+ "version": "0.20.0",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://codeberg.org/TeamOccultus/StarTenonAPI"
7
+ },
8
+ "homepage": "https://codeberg.org/TeamOccultus/StarTenonAPI",
9
+ "bugs": {
10
+ "url": "https://codeberg.org/TeamOccultus/StarTenonAPI/issues",
11
+ "email": "FangLiulii@outlook.com"
12
+ },
4
13
  "description": "Star Tenon music api",
5
14
  "main": "src/index.ts",
6
15
  "keywords": [
@@ -9,19 +18,22 @@
9
18
  "Script API"
10
19
  ],
11
20
  "contributors": [
12
- "FangLimao <mucigames@outlook.com>",
21
+ "FangLimao <FangLiulii@outlook.com>",
13
22
  "RawDiamondMC <RawDiamondMC@outlook.com>"
14
23
  ],
15
24
  "license": "MIT",
16
25
  "author": "CTN Studios",
17
26
  "peerDependencies": {
18
- "@minecraft/server": "2.3.0-beta.1.21.110-preview.20",
19
- "@occultus/core": ">=0.18.2 || <0.19.0"
27
+ "@minecraft/server": ">=2.0.0",
28
+ "@occultus/core": ">=0.18.4 || <0.19.0"
20
29
  },
21
30
  "dependencies": {
22
- "@occultus/format-api": "0.18.1"
31
+ "@occultus/format-api": "0.20.0"
23
32
  },
24
33
  "devDependencies": {
25
34
  "typedoc": "^0.28.9"
35
+ },
36
+ "scripts": {
37
+ "test": "tsc"
26
38
  }
27
39
  }
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  PlayerBreakBlockBeforeEvent,
3
3
  PlayerInteractWithBlockBeforeEvent,
4
- RawMessage,
5
4
  system,
6
5
  world,
7
6
  } from "@minecraft/server";
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "include": ["src/*"],
2
+ "include": ["src/**/*"],
3
3
  "exclude": ["./out"],
4
4
  "Modules": {
5
5
  "resolvePackageJsonExports": true
@@ -10,9 +10,9 @@
10
10
  "target": "es2022",
11
11
  "lib": ["es2020", "dom"],
12
12
  "strict": true,
13
- "moduleResolution": "node16",
13
+ "moduleResolution": "bundler",
14
14
  "esModuleInterop": true,
15
- "module": "node16",
15
+ "module": "es2022",
16
16
  "outDir": ".",
17
17
  "removeComments": true,
18
18
  "newLine": "lf",