@block_factory/lib 0.0.4 → 0.0.6

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.
Files changed (35) hide show
  1. package/_module/BlockFactory.ts +4 -1
  2. package/_module/DataTypes.ts +10 -0
  3. package/_module/Framework/EntityTasks.ts +164 -0
  4. package/_module/Framework/ItemTasks.ts +157 -0
  5. package/_module/Framework/PlayerTasks.ts +125 -0
  6. package/_module/Framework/Threads.ts +72 -0
  7. package/_module/util/Signal.ts +73 -7
  8. package/_module/util/Wrapper/IEntity.ts +6 -5
  9. package/_module/util/Wrapper/IPlayer.ts +10 -4
  10. package/_types/_module/BlockFactory.d.ts +4 -1
  11. package/_types/_module/BlockFactory.d.ts.map +1 -1
  12. package/_types/_module/DataTypes.d.ts +10 -0
  13. package/_types/_module/DataTypes.d.ts.map +1 -0
  14. package/_types/_module/Framework/EntityTasks.d.ts +37 -0
  15. package/_types/_module/Framework/EntityTasks.d.ts.map +1 -0
  16. package/_types/_module/Framework/ItemTasks.d.ts +59 -0
  17. package/_types/_module/Framework/ItemTasks.d.ts.map +1 -0
  18. package/_types/_module/Framework/PlayerTasks.d.ts +28 -0
  19. package/_types/_module/Framework/PlayerTasks.d.ts.map +1 -0
  20. package/_types/_module/Framework/Threads.d.ts +22 -0
  21. package/_types/_module/Framework/Threads.d.ts.map +1 -0
  22. package/_types/_module/Types.d.ts +10 -0
  23. package/_types/_module/Types.d.ts.map +1 -0
  24. package/_types/_module/util/Signal.d.ts +63 -4
  25. package/_types/_module/util/Signal.d.ts.map +1 -1
  26. package/_types/_module/util/Wrapper/IEntity.d.ts +4 -4
  27. package/_types/_module/util/Wrapper/IEntity.d.ts.map +1 -1
  28. package/_types/_module/util/Wrapper/IPlayer.d.ts +4 -3
  29. package/_types/_module/util/Wrapper/IPlayer.d.ts.map +1 -1
  30. package/index.js +506 -60
  31. package/package.json +36 -34
  32. package/typedoc.json +6 -0
  33. package/_module/sys/Threads.ts +0 -43
  34. package/_types/_module/sys/Threads.d.ts +0 -16
  35. package/_types/_module/sys/Threads.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,34 +1,36 @@
1
- {
2
- "name": "@block_factory/lib",
3
- "version": "0.0.4",
4
- "main": "index.js",
5
- "types": "index.d.ts",
6
- "description": "Typescript Library for Minecraft Bedrock Edition",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/Block-Factory-Studio/bf-lib.git"
10
- },
11
- "author": "Block Factory x Donthedev",
12
- "contributors": [
13
- {
14
- "name": "Donthedev",
15
- "email": "donthedev@blockfactory.studio"
16
- }
17
- ],
18
- "license": "MIT",
19
- "bugs": {
20
- "url": "https://github.com/Block-Factory-Studio/bf-mcbr-library/issues"
21
- },
22
- "homepage": "https://github.com/Block-Factory-Studio/bf-mcbr-library#readme",
23
- "dependencies": {
24
- "@minecraft/server": "^2.4.0",
25
- "@minecraft/server-ui": "^2.0.0"
26
- },
27
- "devDependencies": {
28
- "esbuild": "^0.25.9"
29
- },
30
- "scripts": {
31
- "build": "node esbuild.config.mjs",
32
- "build:types": "tsc -p tsconfig.types.json"
33
- }
34
- }
1
+ {
2
+ "name": "@block_factory/lib",
3
+ "version": "0.0.6",
4
+ "main": "index.js",
5
+ "types": "index.d.ts",
6
+ "description": "Typescript Library for Minecraft Bedrock Edition",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Block-Factory-Studio/bf-lib.git"
10
+ },
11
+ "author": "Block Factory x Donthedev",
12
+ "contributors": [
13
+ {
14
+ "name": "Donthedev",
15
+ "email": "donthedev@blockfactory.studio"
16
+ }
17
+ ],
18
+ "license": "MIT",
19
+ "bugs": {
20
+ "url": "https://github.com/Block-Factory-Studio/bf-mcbr-library/issues"
21
+ },
22
+ "homepage": "https://github.com/Block-Factory-Studio/bf-mcbr-library#readme",
23
+ "dependencies": {
24
+ "@minecraft/server": "^2.4.0",
25
+ "@minecraft/server-ui": "^2.0.0"
26
+ },
27
+ "devDependencies": {
28
+ "esbuild": "^0.25.9",
29
+ "typedoc": "^0.28.16",
30
+ "typedoc-plugin-markdown": "^4.9.0"
31
+ },
32
+ "scripts": {
33
+ "build": "node esbuild.config.mjs",
34
+ "build:types": "tsc -p tsconfig.types.json"
35
+ }
36
+ }
package/typedoc.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "entryPoints": ["./index.ts"],
3
+ "out": "docs",
4
+ "plugin": ["typedoc-plugin-markdown"],
5
+ "readme": "none"
6
+ }
@@ -1,43 +0,0 @@
1
- import { system, TicksPerSecond } from "@minecraft/server";
2
- import { Signal } from "../util/Signal";
3
-
4
- class Threads {
5
- public static create(): Threads { return new Threads() }
6
- public readonly MAIN = new Signal<number>();
7
- public readonly LATE = new Signal();
8
- public MAIN_INTERVAL_RATE: number = 0;
9
- public LATE_INTERVAL_RATE: number = TicksPerSecond;
10
-
11
- private _MAIN_ID: number;
12
- private _LATE_ID: number;
13
- private _delta = this.createDeltaTimer();
14
-
15
- private constructor() {
16
- this._MAIN_ID = system.runInterval(() => {
17
- if (this.MAIN.count <= 0) return;
18
- try { const delta = this._delta(); this.MAIN.emit(delta) }
19
- catch (error) {
20
- throw Error(`ERROR: _THREAD_.MAIN:${this._MAIN_ID} | ${error}`)
21
- }
22
- }, this.MAIN_INTERVAL_RATE);
23
-
24
- this._LATE_ID = system.runInterval(() => {
25
- if (this.LATE.count <= 0) return;
26
- try { this.LATE.emit() }
27
- catch (error) { throw Error(`ERROR: _THREAD_.LATE:${this._LATE_ID} | ${error}`) }
28
- }, this.LATE_INTERVAL_RATE);
29
- }
30
-
31
- private createDeltaTimer() {
32
- let last = Date.now();
33
-
34
- return function nextDelta(): number {
35
- const now = Date.now();
36
- const delta = (now - last) / 1000; // seconds
37
- last = now;
38
- return delta;
39
- };
40
- }
41
- }
42
-
43
- export const _THREAD_ = Threads.create();
@@ -1,16 +0,0 @@
1
- import { Signal } from "../util/Signal";
2
- declare class Threads {
3
- static create(): Threads;
4
- readonly MAIN: Signal<number>;
5
- readonly LATE: Signal<void>;
6
- MAIN_INTERVAL_RATE: number;
7
- LATE_INTERVAL_RATE: number;
8
- private _MAIN_ID;
9
- private _LATE_ID;
10
- private _delta;
11
- private constructor();
12
- private createDeltaTimer;
13
- }
14
- export declare const _THREAD_: Threads;
15
- export {};
16
- //# sourceMappingURL=Threads.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Threads.d.ts","sourceRoot":"","sources":["../../../_module/sys/Threads.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,cAAM,OAAO;WACK,MAAM,IAAI,OAAO;IAC/B,SAAgB,IAAI,iBAAwB;IAC5C,SAAgB,IAAI,eAAgB;IAC7B,kBAAkB,EAAE,MAAM,CAAK;IAC/B,kBAAkB,EAAE,MAAM,CAAkB;IAEnD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAA2B;IAEzC,OAAO;IAgBP,OAAO,CAAC,gBAAgB;CAU3B;AAED,eAAO,MAAM,QAAQ,SAAmB,CAAC"}