@occultus/api 0.29.2 → 0.29.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/package.json +8 -8
- package/script/api.js +30 -10
- package/src/apiVer.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@occultus/api",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://codeberg.org/TeamOccultus/StarTenonAPI"
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@occultus/artifact-api": "0.23.0",
|
|
27
27
|
"@occultus/common": "0.20.0",
|
|
28
|
-
"@occultus/article-api": "0.24.0",
|
|
29
28
|
"@occultus/text-api": "0.24.0",
|
|
29
|
+
"@occultus/article-api": "0.24.0",
|
|
30
30
|
"@occultus/time-api": "0.22.0",
|
|
31
31
|
"@occultus/format-api": "0.21.0",
|
|
32
32
|
"@occultus/entity-api": "0.22.1",
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
"@occultus/skill-api": "0.21.0",
|
|
35
35
|
"@occultus/task-api": "0.23.3",
|
|
36
36
|
"@occultus/item-api": "0.23.0",
|
|
37
|
-
"@occultus/music-api": "0.22.0",
|
|
38
37
|
"@occultus/math-api": "0.23.0",
|
|
38
|
+
"@occultus/music-api": "0.22.0",
|
|
39
|
+
"@occultus/notification-api": "0.22.0",
|
|
39
40
|
"@occultus/random-api": "0.22.1",
|
|
41
|
+
"@occultus/loot-api": "0.21.0",
|
|
40
42
|
"@occultus/logger-api": "0.21.0",
|
|
41
|
-
"@occultus/notification-api": "0.22.0",
|
|
42
43
|
"@occultus/tutorial-api": "0.24.0",
|
|
43
44
|
"@occultus/job-api": "0.23.0",
|
|
44
45
|
"@occultus/toolkit": "0.26.0",
|
|
45
46
|
"@occultus/condition-api": "0.23.1",
|
|
46
|
-
"@occultus/effect-api": "0.22.
|
|
47
|
-
"@occultus/
|
|
48
|
-
"@occultus/logue-api": "0.26.0-beta.1"
|
|
49
|
-
"@occultus/credits-api": "0.23.2"
|
|
47
|
+
"@occultus/effect-api": "0.22.1",
|
|
48
|
+
"@occultus/credits-api": "0.23.2",
|
|
49
|
+
"@occultus/logue-api": "0.26.0-beta.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@minecraft/server": "^2.4.0",
|
package/script/api.js
CHANGED
|
@@ -26,12 +26,13 @@ var StarTenon = class {
|
|
|
26
26
|
* - 10.1:新的工具集函数,BlockEntity 的 API 行为变化
|
|
27
27
|
* - 11:教程 API 的改进,单独的依赖库文件的提供
|
|
28
28
|
* - 12:加入了 Toast API
|
|
29
|
+
* - 12.1:新的工具集函数(颜色相关)
|
|
29
30
|
*/
|
|
30
|
-
static apiLevel = 12;
|
|
31
|
+
static apiLevel = 12.1;
|
|
31
32
|
/**
|
|
32
33
|
* Star Tenon API 对应的版本号
|
|
33
34
|
*/
|
|
34
|
-
static version = `0.29.
|
|
35
|
+
static version = `0.29.3 (API: ${this.apiLevel})`;
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
// ../node_modules/.pnpm/@occultus+core@1.1.0_@minec_cddd9d27654ecc6961f34ac46dfd0b14/node_modules/@occultus/core/src/api/error/SDKError.ts
|
|
@@ -2433,6 +2434,17 @@ function startCooldown(item, player) {
|
|
|
2433
2434
|
return true;
|
|
2434
2435
|
}
|
|
2435
2436
|
|
|
2437
|
+
// ../packages/toolkit/src/color.ts
|
|
2438
|
+
function rgbToHex(rgb) {
|
|
2439
|
+
return "#" + ((1 << 24) + (rgb.red << 16) + (rgb.green << 8) + rgb.blue).toString(16).slice(1);
|
|
2440
|
+
}
|
|
2441
|
+
function hexToRgb(hex) {
|
|
2442
|
+
let r = parseInt(hex.substring(1, 3), 16);
|
|
2443
|
+
let g = parseInt(hex.substring(3, 5), 16);
|
|
2444
|
+
let b = parseInt(hex.substring(5, 7), 16);
|
|
2445
|
+
return { red: r, green: g, blue: b };
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2436
2448
|
// ../packages/item/src/utils/WeaponInternalUtils.ts
|
|
2437
2449
|
var WeaponInternalUtils = class _WeaponInternalUtils {
|
|
2438
2450
|
/**
|
|
@@ -5830,7 +5842,7 @@ var TutorialServer = class {
|
|
|
5830
5842
|
};
|
|
5831
5843
|
|
|
5832
5844
|
// ../packages/effect/src/api/VirtualEffect.ts
|
|
5833
|
-
import { system as system19 } from "@minecraft/server";
|
|
5845
|
+
import { system as system19, world as world18 } from "@minecraft/server";
|
|
5834
5846
|
var VirtualEffect = class {
|
|
5835
5847
|
/**
|
|
5836
5848
|
* @param id 状态效果的 ID
|
|
@@ -5841,6 +5853,12 @@ var VirtualEffect = class {
|
|
|
5841
5853
|
this.id = id;
|
|
5842
5854
|
this.updateTick = updateTick;
|
|
5843
5855
|
this.type = type;
|
|
5856
|
+
world18.afterEvents.playerSpawn.subscribe((event) => {
|
|
5857
|
+
if (!event.initialSpawn) return;
|
|
5858
|
+
const player = event.player;
|
|
5859
|
+
player.setDynamicProperty(`${this.id}:runner`, void 0);
|
|
5860
|
+
player.setDynamicProperty(`${this.id}:amplifier`, void 0);
|
|
5861
|
+
});
|
|
5844
5862
|
}
|
|
5845
5863
|
/**
|
|
5846
5864
|
* 当状态效果更新时的事件
|
|
@@ -6404,7 +6422,7 @@ var JobDetailScreen = class {
|
|
|
6404
6422
|
};
|
|
6405
6423
|
|
|
6406
6424
|
// ../packages/job/src/api/JobSkill.ts
|
|
6407
|
-
import { system as system22, world as
|
|
6425
|
+
import { system as system22, world as world19 } from "@minecraft/server";
|
|
6408
6426
|
var JobSkillComponent = class {
|
|
6409
6427
|
constructor(componentName) {
|
|
6410
6428
|
this.componentName = componentName;
|
|
@@ -6423,7 +6441,7 @@ var JobSkill = class {
|
|
|
6423
6441
|
this.name = name;
|
|
6424
6442
|
this.description = description;
|
|
6425
6443
|
this.lastingTicks = lastingTicks;
|
|
6426
|
-
|
|
6444
|
+
world19.afterEvents.itemUse.subscribe((arg) => {
|
|
6427
6445
|
const { source, itemStack } = arg;
|
|
6428
6446
|
if (itemStack.typeId !== this.typeId) return;
|
|
6429
6447
|
if (isInCooldown(itemStack, source)) {
|
|
@@ -6454,7 +6472,7 @@ var JobSkill = class {
|
|
|
6454
6472
|
};
|
|
6455
6473
|
|
|
6456
6474
|
// ../packages/job/src/api/JobServer.ts
|
|
6457
|
-
import { world as
|
|
6475
|
+
import { world as world20 } from "@minecraft/server";
|
|
6458
6476
|
|
|
6459
6477
|
// ../packages/job/src/events/JobEvents.ts
|
|
6460
6478
|
import {
|
|
@@ -6503,16 +6521,16 @@ var JobEvents = class {
|
|
|
6503
6521
|
var JobServer = class {
|
|
6504
6522
|
jobs = /* @__PURE__ */ new Map();
|
|
6505
6523
|
startUp() {
|
|
6506
|
-
|
|
6524
|
+
world20.afterEvents.playerBreakBlock.subscribe((arg) => {
|
|
6507
6525
|
JobEvents.onMineBlock(arg, this);
|
|
6508
6526
|
});
|
|
6509
|
-
|
|
6527
|
+
world20.afterEvents.entityHitEntity.subscribe((arg) => {
|
|
6510
6528
|
JobEvents.onHitEntity(arg, this);
|
|
6511
6529
|
});
|
|
6512
|
-
|
|
6530
|
+
world20.afterEvents.entityHurt.subscribe((arg) => {
|
|
6513
6531
|
JobEvents.onHurt(arg, this);
|
|
6514
6532
|
});
|
|
6515
|
-
|
|
6533
|
+
world20.afterEvents.projectileHitEntity.subscribe((arg) => {
|
|
6516
6534
|
JobEvents.onProjectileHit(arg, this);
|
|
6517
6535
|
});
|
|
6518
6536
|
}
|
|
@@ -6871,6 +6889,7 @@ export {
|
|
|
6871
6889
|
giveItem,
|
|
6872
6890
|
hasFamily,
|
|
6873
6891
|
heal,
|
|
6892
|
+
hexToRgb,
|
|
6874
6893
|
inputListener2 as inputListener,
|
|
6875
6894
|
insertLoot,
|
|
6876
6895
|
isInCooldown,
|
|
@@ -6892,6 +6911,7 @@ export {
|
|
|
6892
6911
|
removeTagItemInContainer,
|
|
6893
6912
|
replaceItemByTag,
|
|
6894
6913
|
replaceItemStack,
|
|
6914
|
+
rgbToHex,
|
|
6895
6915
|
setCurrentHealth,
|
|
6896
6916
|
setEquipmentItem,
|
|
6897
6917
|
setSlot,
|
package/src/apiVer.ts
CHANGED