yeow-api 0.2.17 → 0.2.19
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 +1 -1
- package/src/event.ts +10 -1
- package/src/index.ts +5 -0
package/package.json
CHANGED
package/src/event.ts
CHANGED
|
@@ -354,7 +354,16 @@ export function eventOff(eventType: string, handler: Function): void {
|
|
|
354
354
|
for (const handler of handlers) {
|
|
355
355
|
try {
|
|
356
356
|
handler(wrapped);
|
|
357
|
-
} catch (e: any) {
|
|
357
|
+
} catch (e: any) {
|
|
358
|
+
const errInfo = {
|
|
359
|
+
message: e?.message || String(e),
|
|
360
|
+
stack: e?.stack || '',
|
|
361
|
+
fileName: e?.fileName || 'main.js',
|
|
362
|
+
lineNumber: e?.lineNumber || 0,
|
|
363
|
+
columnNumber: e?.columnNumber || 0,
|
|
364
|
+
};
|
|
365
|
+
(globalThis as any).$send('js-error', JSON.stringify(errInfo));
|
|
366
|
+
}
|
|
358
367
|
}
|
|
359
368
|
if (cancellable && localMods.cancelled) mods.cancelled = true;
|
|
360
369
|
return mods;
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export { call } from './task.js';
|
|
2
2
|
export { Location } from './location.js';
|
|
3
3
|
export { Player } from './player.js';
|
|
4
|
+
export { World } from './world.js';
|
|
5
|
+
export { Entity, LivingEntity } from './entity.js';
|
|
6
|
+
export { Block } from './block.js';
|
|
7
|
+
export { Inventory } from './inventory.js';
|
|
4
8
|
export { registerCommand } from './command.js';
|
|
5
9
|
export type { CommandOptions, CommandPayload, CommandSender } from './command.js';
|
|
6
10
|
export { eventOn, eventOff } from './event.js';
|
|
@@ -21,5 +25,6 @@ export { onInit, onLoad } from './lifecycle.js';
|
|
|
21
25
|
export { broadcast, broadcastSync, dispatchCommand, dispatchCommandSync, setMotd, setMotdSync, setIcon, setIconSync, getMotd, getVersion } from './server.js';
|
|
22
26
|
export { fs, readFile, readFileSync, readFileBase64, readFileBase64Sync, writeFile, writeFileSync, writeFileBase64, writeFileBase64Sync, existsSync, deleteFile, mkdir, list } from './fs.js';
|
|
23
27
|
export { assets, read as assetsRead, readSync as assetsReadSync, readBase64 as assetsReadBase64, readBase64Sync as assetsReadBase64Sync, extract as assetsExtract, extractSync as assetsExtractSync } from './assets.js';
|
|
28
|
+
export { path } from './path.js';
|
|
24
29
|
export { listen, respond, close, request, requestSync } from './http.js';
|
|
25
30
|
export { createServer } from './create-server.js';
|