@occultus/api 0.28.0 → 0.29.1
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 +11 -11
- package/script/api.js +90 -46
- package/src/apiVer.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@occultus/api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://codeberg.org/TeamOccultus/StarTenonAPI"
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"author": "CTN Studios",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@occultus/artifact-api": "0.23.0",
|
|
27
26
|
"@occultus/common": "0.20.0",
|
|
28
|
-
"@occultus/article-api": "0.24.0",
|
|
29
|
-
"@occultus/time-api": "0.22.0",
|
|
30
27
|
"@occultus/block-api": "0.23.0",
|
|
31
|
-
"@occultus/
|
|
28
|
+
"@occultus/artifact-api": "0.23.0",
|
|
29
|
+
"@occultus/time-api": "0.22.0",
|
|
32
30
|
"@occultus/text-api": "0.24.0",
|
|
31
|
+
"@occultus/entity-api": "0.22.1",
|
|
33
32
|
"@occultus/skill-api": "0.21.0",
|
|
34
33
|
"@occultus/format-api": "0.21.0",
|
|
35
|
-
"@occultus/task-api": "0.23.2",
|
|
36
34
|
"@occultus/item-api": "0.23.0",
|
|
37
35
|
"@occultus/music-api": "0.22.0",
|
|
36
|
+
"@occultus/task-api": "0.23.3",
|
|
38
37
|
"@occultus/math-api": "0.23.0",
|
|
39
|
-
"@occultus/random-api": "0.22.1",
|
|
40
|
-
"@occultus/notification-api": "0.21.0",
|
|
41
38
|
"@occultus/loot-api": "0.21.0",
|
|
39
|
+
"@occultus/random-api": "0.22.1",
|
|
40
|
+
"@occultus/notification-api": "0.22.0",
|
|
42
41
|
"@occultus/logger-api": "0.21.0",
|
|
43
42
|
"@occultus/job-api": "0.23.0",
|
|
44
|
-
"@occultus/tutorial-api": "0.24.0",
|
|
45
43
|
"@occultus/toolkit": "0.25.0",
|
|
46
44
|
"@occultus/condition-api": "0.23.1",
|
|
47
|
-
"@occultus/
|
|
45
|
+
"@occultus/article-api": "0.24.0",
|
|
46
|
+
"@occultus/tutorial-api": "0.24.0",
|
|
47
|
+
"@occultus/logue-api": "0.26.0-beta.1",
|
|
48
48
|
"@occultus/credits-api": "0.23.2",
|
|
49
|
-
"@occultus/
|
|
49
|
+
"@occultus/effect-api": "0.22.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@minecraft/server": "^2.4.0",
|
package/script/api.js
CHANGED
|
@@ -25,12 +25,13 @@ var StarTenon = class {
|
|
|
25
25
|
* - 10:加入了 Server Binding API
|
|
26
26
|
* - 10.1:新的工具集函数,BlockEntity 的 API 行为变化
|
|
27
27
|
* - 11:教程 API 的改进,单独的依赖库文件的提供
|
|
28
|
+
* - 12:加入了 Toast API
|
|
28
29
|
*/
|
|
29
|
-
static apiLevel =
|
|
30
|
+
static apiLevel = 12;
|
|
30
31
|
/**
|
|
31
32
|
* Star Tenon API 对应的版本号
|
|
32
33
|
*/
|
|
33
|
-
static version = `0.
|
|
34
|
+
static version = `0.29.1 (API: ${this.apiLevel})`;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
// ../node_modules/.pnpm/@occultus+core@1.1.0_@minec_cddd9d27654ecc6961f34ac46dfd0b14/node_modules/@occultus/core/src/api/error/SDKError.ts
|
|
@@ -3014,6 +3015,8 @@ var Task = class extends FormLike {
|
|
|
3014
3015
|
this.description = description;
|
|
3015
3016
|
this.options = options;
|
|
3016
3017
|
}
|
|
3018
|
+
compeleteEvent = () => {
|
|
3019
|
+
};
|
|
3017
3020
|
/**
|
|
3018
3021
|
* 向玩家展示任务
|
|
3019
3022
|
* @param player 要展示任务的玩家
|
|
@@ -3122,6 +3125,7 @@ var Task = class extends FormLike {
|
|
|
3122
3125
|
parseToRaw(this.name, player)
|
|
3123
3126
|
]
|
|
3124
3127
|
});
|
|
3128
|
+
this.compeleteEvent(player, this);
|
|
3125
3129
|
player.playSound(this.options.completeSound ?? "random.levelup");
|
|
3126
3130
|
}
|
|
3127
3131
|
/**
|
|
@@ -3133,6 +3137,9 @@ var Task = class extends FormLike {
|
|
|
3133
3137
|
pushToServer(server) {
|
|
3134
3138
|
server.addTask(this);
|
|
3135
3139
|
}
|
|
3140
|
+
onComplete(event) {
|
|
3141
|
+
this.compeleteEvent = event;
|
|
3142
|
+
}
|
|
3136
3143
|
};
|
|
3137
3144
|
|
|
3138
3145
|
// ../packages/task/src/ui/TaskListScreen.ts
|
|
@@ -4053,6 +4060,42 @@ var WelcomeNotification = class {
|
|
|
4053
4060
|
}
|
|
4054
4061
|
};
|
|
4055
4062
|
|
|
4063
|
+
// ../packages/notification/src/api/Toast.ts
|
|
4064
|
+
import { world as world12 } from "@minecraft/server";
|
|
4065
|
+
var Toast = class {
|
|
4066
|
+
/**
|
|
4067
|
+
* @param content 通知消息,推荐不超过两行
|
|
4068
|
+
* @param iconPath 通知图标路径
|
|
4069
|
+
*/
|
|
4070
|
+
constructor(content, iconPath) {
|
|
4071
|
+
this.content = content;
|
|
4072
|
+
this.iconPath = iconPath;
|
|
4073
|
+
}
|
|
4074
|
+
/**
|
|
4075
|
+
* 向玩家发送吐司通知
|
|
4076
|
+
* @param player
|
|
4077
|
+
*/
|
|
4078
|
+
send(player) {
|
|
4079
|
+
player.onScreenDisplay.setTitle(
|
|
4080
|
+
{
|
|
4081
|
+
rawtext: [{ text: "toast:" }, parseToRaw(this.content, player)]
|
|
4082
|
+
},
|
|
4083
|
+
{
|
|
4084
|
+
subtitle: `toast:${this.iconPath}`,
|
|
4085
|
+
fadeInDuration: 0,
|
|
4086
|
+
fadeOutDuration: 0,
|
|
4087
|
+
stayDuration: 1
|
|
4088
|
+
}
|
|
4089
|
+
);
|
|
4090
|
+
}
|
|
4091
|
+
/**
|
|
4092
|
+
* 向所有玩家发送吐司通知
|
|
4093
|
+
*/
|
|
4094
|
+
sendToWorld() {
|
|
4095
|
+
world12.getAllPlayers().forEach((player) => this.send(player));
|
|
4096
|
+
}
|
|
4097
|
+
};
|
|
4098
|
+
|
|
4056
4099
|
// ../packages/loot/src/api/base/CustomLoot.ts
|
|
4057
4100
|
var CustomLoot = class {
|
|
4058
4101
|
/**
|
|
@@ -4124,7 +4167,7 @@ var CustomEntityLoot = class extends CustomLoot {
|
|
|
4124
4167
|
};
|
|
4125
4168
|
|
|
4126
4169
|
// ../packages/loot/src/api/CustomLootServer.ts
|
|
4127
|
-
import { world as
|
|
4170
|
+
import { world as world13, system as system10 } from "@minecraft/server";
|
|
4128
4171
|
var CustomLootServer = class {
|
|
4129
4172
|
/**
|
|
4130
4173
|
* 存储实体类型ID与对应战利品表路径的映射
|
|
@@ -4135,14 +4178,14 @@ var CustomLootServer = class {
|
|
|
4135
4178
|
*/
|
|
4136
4179
|
blockLootMap = /* @__PURE__ */ new Map();
|
|
4137
4180
|
constructor() {
|
|
4138
|
-
|
|
4181
|
+
world13.afterEvents.entityDie.subscribe((event) => {
|
|
4139
4182
|
const entity = event.deadEntity;
|
|
4140
4183
|
const lootTable = this.entityLootMap.get(entity.typeId);
|
|
4141
4184
|
if (lootTable) {
|
|
4142
4185
|
loot(entity.dimension, entity.location, lootTable);
|
|
4143
4186
|
}
|
|
4144
4187
|
});
|
|
4145
|
-
|
|
4188
|
+
world13.beforeEvents.playerBreakBlock.subscribe((event) => {
|
|
4146
4189
|
const block = event.block;
|
|
4147
4190
|
const lootTable = this.blockLootMap.get(block.typeId);
|
|
4148
4191
|
if (lootTable) {
|
|
@@ -4171,7 +4214,7 @@ var CustomLootServer = class {
|
|
|
4171
4214
|
};
|
|
4172
4215
|
|
|
4173
4216
|
// ../packages/logger/src/api/Logger.ts
|
|
4174
|
-
import { world as
|
|
4217
|
+
import { world as world15 } from "@minecraft/server";
|
|
4175
4218
|
|
|
4176
4219
|
// ../packages/logger/src/enum/LogLevel.ts
|
|
4177
4220
|
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
@@ -4184,7 +4227,7 @@ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
|
4184
4227
|
})(LogLevel || {});
|
|
4185
4228
|
|
|
4186
4229
|
// ../packages/logger/src/api/LoggerInternalUtils.ts
|
|
4187
|
-
import { world as
|
|
4230
|
+
import { world as world14 } from "@minecraft/server";
|
|
4188
4231
|
|
|
4189
4232
|
// ../packages/logger/src/data/LogLevelMap.ts
|
|
4190
4233
|
var LogLevelMap = {
|
|
@@ -4201,13 +4244,13 @@ var LoggerInternalUtils = class {
|
|
|
4201
4244
|
if (player) {
|
|
4202
4245
|
return player.getDynamicProperty("occultus:log_level") ?? 3 /* Fatal */;
|
|
4203
4246
|
}
|
|
4204
|
-
return
|
|
4247
|
+
return world14.getDynamicProperty("occultus:log_level") ?? 3 /* Fatal */;
|
|
4205
4248
|
}
|
|
4206
4249
|
static setLogLevel(level, player) {
|
|
4207
4250
|
if (player) {
|
|
4208
4251
|
player.setDynamicProperty("occultus:log_level", level);
|
|
4209
4252
|
} else {
|
|
4210
|
-
|
|
4253
|
+
world14.setDynamicProperty("occultus:log_level", level);
|
|
4211
4254
|
}
|
|
4212
4255
|
}
|
|
4213
4256
|
static stringfyMessage(message, level, namespace) {
|
|
@@ -4235,7 +4278,7 @@ var LoggerInternalUtils = class {
|
|
|
4235
4278
|
if (this.getLogLevel() > level) {
|
|
4236
4279
|
return;
|
|
4237
4280
|
}
|
|
4238
|
-
|
|
4281
|
+
world14.sendMessage(message);
|
|
4239
4282
|
}
|
|
4240
4283
|
static sendLogToPlayer(message, player, level) {
|
|
4241
4284
|
if (this.getLogLevel(player) > level) {
|
|
@@ -4352,7 +4395,7 @@ var Logger = class _Logger {
|
|
|
4352
4395
|
);
|
|
4353
4396
|
this.addToHistory(msg);
|
|
4354
4397
|
console.error(msg);
|
|
4355
|
-
|
|
4398
|
+
world15.sendMessage(msg);
|
|
4356
4399
|
throw new Error(msg);
|
|
4357
4400
|
}
|
|
4358
4401
|
/**
|
|
@@ -4677,9 +4720,9 @@ import { ActionFormData as ActionFormData3 } from "@minecraft/server-ui";
|
|
|
4677
4720
|
import {
|
|
4678
4721
|
CustomCommandSource as CustomCommandSource2,
|
|
4679
4722
|
CustomCommandStatus as CustomCommandStatus2,
|
|
4680
|
-
Player as
|
|
4723
|
+
Player as Player17,
|
|
4681
4724
|
system as system13,
|
|
4682
|
-
world as
|
|
4725
|
+
world as world16
|
|
4683
4726
|
} from "@minecraft/server";
|
|
4684
4727
|
var ArtifactEvents = class _ArtifactEvents {
|
|
4685
4728
|
static registryConponent(componentName) {
|
|
@@ -4690,16 +4733,16 @@ var ArtifactEvents = class _ArtifactEvents {
|
|
|
4690
4733
|
}
|
|
4691
4734
|
});
|
|
4692
4735
|
});
|
|
4693
|
-
|
|
4736
|
+
world16.afterEvents.playerBreakBlock.subscribe((arg) => {
|
|
4694
4737
|
_ArtifactEvents.onMineBlock(arg);
|
|
4695
4738
|
});
|
|
4696
|
-
|
|
4739
|
+
world16.afterEvents.entityHitEntity.subscribe((arg) => {
|
|
4697
4740
|
_ArtifactEvents.onHitEntity(arg);
|
|
4698
4741
|
});
|
|
4699
|
-
|
|
4742
|
+
world16.afterEvents.entityHurt.subscribe((arg) => {
|
|
4700
4743
|
_ArtifactEvents.onHurt(arg);
|
|
4701
4744
|
});
|
|
4702
|
-
|
|
4745
|
+
world16.afterEvents.playerSpawn.subscribe((arg) => {
|
|
4703
4746
|
if (arg.player.hasTag("artifact_cooldown") && arg.player.isValid) {
|
|
4704
4747
|
arg.player.removeTag("artifact_cooldown");
|
|
4705
4748
|
}
|
|
@@ -4735,7 +4778,7 @@ var ArtifactEvents = class _ArtifactEvents {
|
|
|
4735
4778
|
}
|
|
4736
4779
|
static onHitEntity(arg) {
|
|
4737
4780
|
const { damagingEntity } = arg;
|
|
4738
|
-
if (!(damagingEntity instanceof
|
|
4781
|
+
if (!(damagingEntity instanceof Player17)) return;
|
|
4739
4782
|
ArtifactUtils.getArtifactSlotRegistry().getAll().forEach((slot) => {
|
|
4740
4783
|
slot.getArtifact(damagingEntity)?.hitEntityEvent(arg);
|
|
4741
4784
|
});
|
|
@@ -4748,7 +4791,7 @@ var ArtifactEvents = class _ArtifactEvents {
|
|
|
4748
4791
|
}
|
|
4749
4792
|
static onHurt(arg) {
|
|
4750
4793
|
const { hurtEntity } = arg;
|
|
4751
|
-
if (!(hurtEntity instanceof
|
|
4794
|
+
if (!(hurtEntity instanceof Player17)) return;
|
|
4752
4795
|
ArtifactUtils.getArtifactSlotRegistry().getAll().forEach((slot) => {
|
|
4753
4796
|
slot.getArtifact(hurtEntity)?.hurtEvent(arg);
|
|
4754
4797
|
});
|
|
@@ -4769,7 +4812,7 @@ var ArtifactEvents = class _ArtifactEvents {
|
|
|
4769
4812
|
return {
|
|
4770
4813
|
status: CustomCommandStatus2.Failure
|
|
4771
4814
|
};
|
|
4772
|
-
if (!(origin.sourceEntity instanceof
|
|
4815
|
+
if (!(origin.sourceEntity instanceof Player17))
|
|
4773
4816
|
return {
|
|
4774
4817
|
status: CustomCommandStatus2.Failure
|
|
4775
4818
|
};
|
|
@@ -5581,7 +5624,7 @@ import {
|
|
|
5581
5624
|
system as system17,
|
|
5582
5625
|
CustomCommandSource as CustomCommandSource3,
|
|
5583
5626
|
CustomCommandStatus as CustomCommandStatus3,
|
|
5584
|
-
Player as
|
|
5627
|
+
Player as Player20
|
|
5585
5628
|
} from "@minecraft/server";
|
|
5586
5629
|
var TutorialUtils = class {
|
|
5587
5630
|
constructor() {
|
|
@@ -5603,7 +5646,7 @@ var TutorialUtils = class {
|
|
|
5603
5646
|
return {
|
|
5604
5647
|
status: CustomCommandStatus3.Failure
|
|
5605
5648
|
};
|
|
5606
|
-
if (!(origin.sourceEntity instanceof
|
|
5649
|
+
if (!(origin.sourceEntity instanceof Player20))
|
|
5607
5650
|
return {
|
|
5608
5651
|
status: CustomCommandStatus3.Failure
|
|
5609
5652
|
};
|
|
@@ -5684,7 +5727,7 @@ var TutorialCenter = class extends FormLike {
|
|
|
5684
5727
|
};
|
|
5685
5728
|
|
|
5686
5729
|
// ../packages/tutorial/src/api/base/TutorialServer.ts
|
|
5687
|
-
import { Player as
|
|
5730
|
+
import { Player as Player22, world as world17 } from "@minecraft/server";
|
|
5688
5731
|
var TutorialServer = class {
|
|
5689
5732
|
tutorials = {
|
|
5690
5733
|
itemMap: /* @__PURE__ */ new Map(),
|
|
@@ -5703,7 +5746,7 @@ var TutorialServer = class {
|
|
|
5703
5746
|
* @private
|
|
5704
5747
|
*/
|
|
5705
5748
|
startUp() {
|
|
5706
|
-
|
|
5749
|
+
world17.afterEvents.playerInventoryItemChange.subscribe((arg) => {
|
|
5707
5750
|
const { itemStack, player } = arg;
|
|
5708
5751
|
if (!itemStack) return;
|
|
5709
5752
|
itemStack.getTags().forEach((tag) => {
|
|
@@ -5715,33 +5758,33 @@ var TutorialServer = class {
|
|
|
5715
5758
|
this.tutorials.itemMap.get(itemStack.typeId)?.unlock(player);
|
|
5716
5759
|
}
|
|
5717
5760
|
});
|
|
5718
|
-
|
|
5761
|
+
world17.afterEvents.playerBreakBlock.subscribe((arg) => {
|
|
5719
5762
|
const { brokenBlockPermutation } = arg;
|
|
5720
5763
|
const id = brokenBlockPermutation.type.id;
|
|
5721
5764
|
if (this.tutorials.blockMap.has(id)) {
|
|
5722
5765
|
this.tutorials.blockMap.get(id)?.unlock(arg.player);
|
|
5723
5766
|
}
|
|
5724
5767
|
});
|
|
5725
|
-
|
|
5768
|
+
world17.afterEvents.playerPlaceBlock.subscribe((arg) => {
|
|
5726
5769
|
const { block, player } = arg;
|
|
5727
5770
|
if (this.tutorials.blockMap.has(block.typeId)) {
|
|
5728
5771
|
this.tutorials.blockMap.get(block.typeId)?.unlock(player);
|
|
5729
5772
|
}
|
|
5730
5773
|
});
|
|
5731
|
-
|
|
5774
|
+
world17.afterEvents.entityHitEntity.subscribe((arg) => {
|
|
5732
5775
|
const { damagingEntity, hitEntity } = arg;
|
|
5733
|
-
if (damagingEntity instanceof
|
|
5776
|
+
if (damagingEntity instanceof Player22) {
|
|
5734
5777
|
const tutorial = this.tutorials.entityMap.get(hitEntity.typeId);
|
|
5735
5778
|
if (tutorial) tutorial.unlock(damagingEntity);
|
|
5736
5779
|
return;
|
|
5737
5780
|
}
|
|
5738
|
-
if (hitEntity instanceof
|
|
5781
|
+
if (hitEntity instanceof Player22) {
|
|
5739
5782
|
const tutorial = this.tutorials.entityMap.get(damagingEntity.typeId);
|
|
5740
5783
|
if (tutorial) tutorial.unlock(hitEntity);
|
|
5741
5784
|
return;
|
|
5742
5785
|
}
|
|
5743
5786
|
});
|
|
5744
|
-
|
|
5787
|
+
world17.afterEvents.playerDimensionChange.subscribe((arg) => {
|
|
5745
5788
|
const { toDimension, player } = arg;
|
|
5746
5789
|
if (this.tutorials.dimensionMap.has(toDimension.id)) {
|
|
5747
5790
|
this.tutorials.dimensionMap.get(toDimension.id)?.unlock(player);
|
|
@@ -5931,7 +5974,7 @@ import {
|
|
|
5931
5974
|
CustomCommandStatus as CustomCommandStatus4,
|
|
5932
5975
|
ItemLockMode,
|
|
5933
5976
|
ItemStack as ItemStack11,
|
|
5934
|
-
Player as
|
|
5977
|
+
Player as Player23,
|
|
5935
5978
|
system as system20
|
|
5936
5979
|
} from "@minecraft/server";
|
|
5937
5980
|
var JobInternalUtils = class _JobInternalUtils {
|
|
@@ -6038,7 +6081,7 @@ var JobInternalUtils = class _JobInternalUtils {
|
|
|
6038
6081
|
return {
|
|
6039
6082
|
status: CustomCommandStatus4.Failure
|
|
6040
6083
|
};
|
|
6041
|
-
if (!(origin.sourceEntity instanceof
|
|
6084
|
+
if (!(origin.sourceEntity instanceof Player23))
|
|
6042
6085
|
return {
|
|
6043
6086
|
status: CustomCommandStatus4.Failure
|
|
6044
6087
|
};
|
|
@@ -6361,7 +6404,7 @@ var JobDetailScreen = class {
|
|
|
6361
6404
|
};
|
|
6362
6405
|
|
|
6363
6406
|
// ../packages/job/src/api/JobSkill.ts
|
|
6364
|
-
import { system as system22, world as
|
|
6407
|
+
import { system as system22, world as world18 } from "@minecraft/server";
|
|
6365
6408
|
var JobSkillComponent = class {
|
|
6366
6409
|
constructor(componentName) {
|
|
6367
6410
|
this.componentName = componentName;
|
|
@@ -6380,7 +6423,7 @@ var JobSkill = class {
|
|
|
6380
6423
|
this.name = name;
|
|
6381
6424
|
this.description = description;
|
|
6382
6425
|
this.lastingTicks = lastingTicks;
|
|
6383
|
-
|
|
6426
|
+
world18.afterEvents.itemUse.subscribe((arg) => {
|
|
6384
6427
|
const { source, itemStack } = arg;
|
|
6385
6428
|
if (itemStack.typeId !== this.typeId) return;
|
|
6386
6429
|
if (isInCooldown(itemStack, source)) {
|
|
@@ -6411,18 +6454,18 @@ var JobSkill = class {
|
|
|
6411
6454
|
};
|
|
6412
6455
|
|
|
6413
6456
|
// ../packages/job/src/api/JobServer.ts
|
|
6414
|
-
import { world as
|
|
6457
|
+
import { world as world19 } from "@minecraft/server";
|
|
6415
6458
|
|
|
6416
6459
|
// ../packages/job/src/events/JobEvents.ts
|
|
6417
6460
|
import {
|
|
6418
|
-
Player as
|
|
6461
|
+
Player as Player26
|
|
6419
6462
|
} from "@minecraft/server";
|
|
6420
6463
|
var JobEvents = class {
|
|
6421
6464
|
constructor() {
|
|
6422
6465
|
}
|
|
6423
6466
|
static onHitEntity(arg, server) {
|
|
6424
6467
|
const { damagingEntity } = arg;
|
|
6425
|
-
if (!(damagingEntity instanceof
|
|
6468
|
+
if (!(damagingEntity instanceof Player26)) return;
|
|
6426
6469
|
const job = server.getJob(damagingEntity);
|
|
6427
6470
|
if (!job) return;
|
|
6428
6471
|
job.hitEntityEvent(arg, damagingEntity);
|
|
@@ -6435,9 +6478,9 @@ var JobEvents = class {
|
|
|
6435
6478
|
}
|
|
6436
6479
|
static onHurt(arg, server) {
|
|
6437
6480
|
const { hurtEntity } = arg;
|
|
6438
|
-
if (!(hurtEntity instanceof
|
|
6481
|
+
if (!(hurtEntity instanceof Player26)) {
|
|
6439
6482
|
const damagingEntity = arg.damageSource.damagingEntity;
|
|
6440
|
-
if (!(damagingEntity instanceof
|
|
6483
|
+
if (!(damagingEntity instanceof Player26)) return;
|
|
6441
6484
|
const job2 = server.getJob(damagingEntity);
|
|
6442
6485
|
if (!job2) return;
|
|
6443
6486
|
job2.causeDamageEvent(arg, damagingEntity);
|
|
@@ -6449,7 +6492,7 @@ var JobEvents = class {
|
|
|
6449
6492
|
}
|
|
6450
6493
|
static onProjectileHit(arg, server) {
|
|
6451
6494
|
const { source } = arg;
|
|
6452
|
-
if (!(source instanceof
|
|
6495
|
+
if (!(source instanceof Player26)) return;
|
|
6453
6496
|
const job = server.getJob(source);
|
|
6454
6497
|
if (!job) return;
|
|
6455
6498
|
job.projectileHitEvent(arg, source);
|
|
@@ -6460,16 +6503,16 @@ var JobEvents = class {
|
|
|
6460
6503
|
var JobServer = class {
|
|
6461
6504
|
jobs = /* @__PURE__ */ new Map();
|
|
6462
6505
|
startUp() {
|
|
6463
|
-
|
|
6506
|
+
world19.afterEvents.playerBreakBlock.subscribe((arg) => {
|
|
6464
6507
|
JobEvents.onMineBlock(arg, this);
|
|
6465
6508
|
});
|
|
6466
|
-
|
|
6509
|
+
world19.afterEvents.entityHitEntity.subscribe((arg) => {
|
|
6467
6510
|
JobEvents.onHitEntity(arg, this);
|
|
6468
6511
|
});
|
|
6469
|
-
|
|
6512
|
+
world19.afterEvents.entityHurt.subscribe((arg) => {
|
|
6470
6513
|
JobEvents.onHurt(arg, this);
|
|
6471
6514
|
});
|
|
6472
|
-
|
|
6515
|
+
world19.afterEvents.projectileHitEntity.subscribe((arg) => {
|
|
6473
6516
|
JobEvents.onProjectileHit(arg, this);
|
|
6474
6517
|
});
|
|
6475
6518
|
}
|
|
@@ -6586,7 +6629,7 @@ var CreditsScreen = class {
|
|
|
6586
6629
|
import {
|
|
6587
6630
|
CustomCommandSource as CustomCommandSource5,
|
|
6588
6631
|
CustomCommandStatus as CustomCommandStatus5,
|
|
6589
|
-
Player as
|
|
6632
|
+
Player as Player28,
|
|
6590
6633
|
system as system23
|
|
6591
6634
|
} from "@minecraft/server";
|
|
6592
6635
|
var CreditsManager = class {
|
|
@@ -6613,7 +6656,7 @@ var CreditsManager = class {
|
|
|
6613
6656
|
return {
|
|
6614
6657
|
status: CustomCommandStatus5.Failure
|
|
6615
6658
|
};
|
|
6616
|
-
if (!(origin.sourceEntity instanceof
|
|
6659
|
+
if (!(origin.sourceEntity instanceof Player28))
|
|
6617
6660
|
return {
|
|
6618
6661
|
status: CustomCommandStatus5.Failure
|
|
6619
6662
|
};
|
|
@@ -6784,6 +6827,7 @@ export {
|
|
|
6784
6827
|
Tick,
|
|
6785
6828
|
Time,
|
|
6786
6829
|
TimeSpec,
|
|
6830
|
+
Toast,
|
|
6787
6831
|
ToolMaterial,
|
|
6788
6832
|
TranslateProvider,
|
|
6789
6833
|
Tutorial,
|
package/src/apiVer.ts
CHANGED
|
@@ -26,10 +26,11 @@ export class StarTenon {
|
|
|
26
26
|
* - 10:加入了 Server Binding API
|
|
27
27
|
* - 10.1:新的工具集函数,BlockEntity 的 API 行为变化
|
|
28
28
|
* - 11:教程 API 的改进,单独的依赖库文件的提供
|
|
29
|
+
* - 12:加入了 Toast API
|
|
29
30
|
*/
|
|
30
|
-
static apiLevel: number =
|
|
31
|
+
static apiLevel: number = 12;
|
|
31
32
|
/**
|
|
32
33
|
* Star Tenon API 对应的版本号
|
|
33
34
|
*/
|
|
34
|
-
static version: string = `0.
|
|
35
|
+
static version: string = `0.29.1 (API: ${this.apiLevel})`;
|
|
35
36
|
}
|