bc-minecraft-bedrock-project 1.19.73-1 → 1.19.73-4
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/lib/src/Lib/Internal/BehaviorPack/Entity.d.ts +3 -1
- package/lib/src/Lib/Internal/BehaviorPack/Entity.js.map +1 -1
- package/lib/src/Lib/Project/BehaviorPack/Block/Block.d.ts +1 -25
- package/lib/src/Lib/Project/BehaviorPack/Block/Block.js +0 -50
- package/lib/src/Lib/Project/BehaviorPack/Block/Block.js.map +1 -1
- package/lib/src/Lib/Project/BehaviorPack/Block/BlockState.d.ts +30 -0
- package/lib/src/Lib/Project/BehaviorPack/Block/BlockState.js +54 -0
- package/lib/src/Lib/Project/BehaviorPack/Block/BlockState.js.map +1 -0
- package/lib/src/Lib/Project/BehaviorPack/Block/Process.js +2 -2
- package/lib/src/Lib/Project/BehaviorPack/Block/Process.js.map +1 -1
- package/lib/src/Lib/Project/BehaviorPack/Block/index.d.ts +1 -0
- package/lib/src/Lib/Project/BehaviorPack/Block/index.js +1 -0
- package/lib/src/Lib/Project/BehaviorPack/Block/index.js.map +1 -1
- package/package.json +1 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentContainer, ComponentGroups } from
|
|
1
|
+
import { ComponentContainer, ComponentGroups } from "bc-minecraft-bedrock-types/lib/src/Minecraft/Components";
|
|
2
2
|
import { SMap } from "../../Types/SMap";
|
|
3
3
|
import { ScriptContainer } from "../Types/Script";
|
|
4
4
|
/**The interface that deals with entity events that add or remove component groups*/
|
|
@@ -18,6 +18,8 @@ export interface EntityEvent {
|
|
|
18
18
|
randomize?: (EntityEvent & {
|
|
19
19
|
weight: number;
|
|
20
20
|
})[];
|
|
21
|
+
/** */
|
|
22
|
+
set_property?: Record<string, string | number | boolean>;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* @deprecated Replace with @see {@link ComponentContainer}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../../../../src/Lib/Internal/BehaviorPack/Entity.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../../../../src/Lib/Internal/BehaviorPack/Entity.ts"],"names":[],"mappings":";;;AA4DA,MAAM;AACN,IAAiB,MAAM,CAwBtB;AAxBD,WAAiB,MAAM;IACrB;;;OAGG;IACH,SAAgB,EAAE,CAAC,KAAU;QAC3B,IACE,OAAO,KAAK,KAAK,QAAQ;YACzB,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ;YACxC,OAAO,KAAK,CAAC,kBAAkB,CAAC,KAAK,QAAQ,EAC7C;YACA,MAAM,CAAC,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC;YAEpC,IACE,OAAO,CAAC,CAAC,WAAW,KAAK,QAAQ;gBACjC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,KAAK,QAAQ;gBAC5C,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ,EAChC;gBACA,OAAO,IAAI,CAAC;aACb;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAlBe,SAAE,KAkBjB,CAAA;AACH,CAAC,EAxBgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAwBtB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Types } from "bc-minecraft-bedrock-types";
|
|
2
2
|
import { Molang } from "bc-minecraft-molang";
|
|
3
3
|
import { MolangCarrier } from "../../../Types";
|
|
4
|
+
import { BlockState } from "./BlockState";
|
|
4
5
|
/** */
|
|
5
6
|
export interface Block extends Types.BaseObject, MolangCarrier<Molang.MolangSet> {
|
|
6
7
|
/** */
|
|
@@ -8,28 +9,3 @@ export interface Block extends Types.BaseObject, MolangCarrier<Molang.MolangSet>
|
|
|
8
9
|
/** */
|
|
9
10
|
states: BlockState[];
|
|
10
11
|
}
|
|
11
|
-
/** */
|
|
12
|
-
export interface BlockState {
|
|
13
|
-
/** */
|
|
14
|
-
name: string;
|
|
15
|
-
/** */
|
|
16
|
-
type: "byte" | "int" | "string";
|
|
17
|
-
/** */
|
|
18
|
-
values: string[];
|
|
19
|
-
}
|
|
20
|
-
/** */
|
|
21
|
-
export declare namespace BlockState {
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param value
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
function is(value: any): value is BlockState;
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
30
|
-
* @param name
|
|
31
|
-
* @param values
|
|
32
|
-
* @returns
|
|
33
|
-
*/
|
|
34
|
-
function create(name: string, values: string[] | number[] | boolean[]): BlockState | undefined;
|
|
35
|
-
}
|
|
@@ -1,53 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BlockState = void 0;
|
|
4
|
-
/** */
|
|
5
|
-
var BlockState;
|
|
6
|
-
(function (BlockState) {
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @param value
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
function is(value) {
|
|
13
|
-
if (value && typeof value.name === "string" && typeof value.type === "string") {
|
|
14
|
-
if (value.type === "byte" || value.type === "int" || value.type === "string") {
|
|
15
|
-
if (Array.isArray(value.values))
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
BlockState.is = is;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param name
|
|
25
|
-
* @param values
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
function create(name, values) {
|
|
29
|
-
const out = {
|
|
30
|
-
name: name,
|
|
31
|
-
type: "string",
|
|
32
|
-
values: [],
|
|
33
|
-
};
|
|
34
|
-
const f = typeof values[0];
|
|
35
|
-
switch (f) {
|
|
36
|
-
case "boolean":
|
|
37
|
-
out.type = "byte";
|
|
38
|
-
out.values = values.map((x) => (x === true ? "1" : "0"));
|
|
39
|
-
break;
|
|
40
|
-
case "string":
|
|
41
|
-
out.type = "string";
|
|
42
|
-
out.values = values.map((x) => x.toString());
|
|
43
|
-
break;
|
|
44
|
-
case "number":
|
|
45
|
-
out.type = "int";
|
|
46
|
-
out.values = values.map((x) => x.toString());
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
return out;
|
|
50
|
-
}
|
|
51
|
-
BlockState.create = create;
|
|
52
|
-
})(BlockState = exports.BlockState || (exports.BlockState = {}));
|
|
53
3
|
//# sourceMappingURL=Block.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Block.js","sourceRoot":"","sources":["../../../../../../src/Lib/Project/BehaviorPack/Block/Block.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Block.js","sourceRoot":"","sources":["../../../../../../src/Lib/Project/BehaviorPack/Block/Block.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**The block state description*/
|
|
2
|
+
interface BaseBlockState<T extends string, U> {
|
|
3
|
+
/**The name of the block state*/
|
|
4
|
+
name: string;
|
|
5
|
+
/**The type of the block state*/
|
|
6
|
+
type: T;
|
|
7
|
+
/**The possible values of the block state*/
|
|
8
|
+
values: U[];
|
|
9
|
+
}
|
|
10
|
+
export type BlockStateInt = BaseBlockState<"int", number>;
|
|
11
|
+
export type BlockStateBool = BaseBlockState<"bool", boolean>;
|
|
12
|
+
export type BlockStateString = BaseBlockState<"string", string>;
|
|
13
|
+
export type BlockState = BlockStateInt | BlockStateBool | BlockStateString;
|
|
14
|
+
/** */
|
|
15
|
+
export declare namespace BlockState {
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param value
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
function is(value: any): value is BlockState;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param name
|
|
25
|
+
* @param values
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
function create(name: string, values: string[] | number[] | boolean[]): BlockState | undefined;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlockState = void 0;
|
|
4
|
+
/** */
|
|
5
|
+
var BlockState;
|
|
6
|
+
(function (BlockState) {
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param value
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
function is(value) {
|
|
13
|
+
if (value && typeof value.name === "string" && typeof value.type === "string") {
|
|
14
|
+
if (typeof value.type === "string") {
|
|
15
|
+
if (Array.isArray(value.values))
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
BlockState.is = is;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param name
|
|
25
|
+
* @param values
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
function create(name, values) {
|
|
29
|
+
const f = typeof values[0];
|
|
30
|
+
switch (f) {
|
|
31
|
+
case "boolean":
|
|
32
|
+
return {
|
|
33
|
+
name: name,
|
|
34
|
+
type: "bool",
|
|
35
|
+
values: values,
|
|
36
|
+
};
|
|
37
|
+
default:
|
|
38
|
+
case "string":
|
|
39
|
+
return {
|
|
40
|
+
name: name,
|
|
41
|
+
type: "string",
|
|
42
|
+
values: values,
|
|
43
|
+
};
|
|
44
|
+
case "number":
|
|
45
|
+
return {
|
|
46
|
+
name: name,
|
|
47
|
+
type: "int",
|
|
48
|
+
values: values,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
BlockState.create = create;
|
|
53
|
+
})(BlockState = exports.BlockState || (exports.BlockState = {}));
|
|
54
|
+
//# sourceMappingURL=BlockState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockState.js","sourceRoot":"","sources":["../../../../../../src/Lib/Project/BehaviorPack/Block/BlockState.ts"],"names":[],"mappings":";;;AAeA,MAAM;AACN,IAAiB,UAAU,CAgD1B;AAhDD,WAAiB,UAAU;IACzB;;;;OAIG;IACH,SAAgB,EAAE,CAAC,KAAU;QAC3B,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YAC7E,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;gBAClC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;oBAAE,OAAO,IAAI,CAAC;aAC9C;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IARe,aAAE,KAQjB,CAAA;IAED;;;;;OAKG;IACH,SAAgB,MAAM,CAAC,IAAY,EAAE,MAAuC;QAC1E,MAAM,CAAC,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;QAE3B,QAAQ,CAAC,EAAE;YACT,KAAK,SAAS;gBACZ,OAAO;oBACL,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,MAAmB;iBAC5B,CAAC;YAEJ,QAAQ;YACR,KAAK,QAAQ;gBACX,OAAO;oBACL,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,MAAkB;iBAC3B,CAAC;YACJ,KAAK,QAAQ;gBACX,OAAO;oBACL,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE,KAAK;oBACX,MAAM,EAAE,MAAkB;iBAC3B,CAAC;SACL;IACH,CAAC;IAzBe,iBAAM,SAyBrB,CAAA;AACH,CAAC,EAhDgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAgD1B"}
|
|
@@ -24,12 +24,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Process = void 0;
|
|
27
|
-
const Block_1 = require("./Block");
|
|
28
27
|
const Internal_1 = require("../../../Internal");
|
|
29
28
|
const bc_minecraft_molang_1 = require("bc-minecraft-molang");
|
|
30
29
|
const Types_1 = require("../../../Types");
|
|
31
30
|
const bc_minecraft_bedrock_types_1 = require("bc-minecraft-bedrock-types");
|
|
32
31
|
const Internal = __importStar(require("../../../Internal/BehaviorPack"));
|
|
32
|
+
const BlockState_1 = require("./BlockState");
|
|
33
33
|
/**
|
|
34
34
|
*
|
|
35
35
|
* @param doc
|
|
@@ -53,7 +53,7 @@ function Process(doc) {
|
|
|
53
53
|
const props = container.description.properties;
|
|
54
54
|
if (props)
|
|
55
55
|
Types_1.SMap.forEach(props, (values, prop) => {
|
|
56
|
-
const s =
|
|
56
|
+
const s = BlockState_1.BlockState.create(prop, values);
|
|
57
57
|
if (s)
|
|
58
58
|
out.states.push(s);
|
|
59
59
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Process.js","sourceRoot":"","sources":["../../../../../../src/Lib/Project/BehaviorPack/Block/Process.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"Process.js","sourceRoot":"","sources":["../../../../../../src/Lib/Project/BehaviorPack/Block/Process.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAAyC;AACzC,6DAA6C;AAC7C,0CAAmE;AACnE,2EAAmD;AAEnD,yEAA2D;AAC3D,6CAA0C;AAE1C;;;;GAIG;AACH,SAAgB,OAAO,CAAC,GAAiB;IACvC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;IACpB,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IAC9B,MAAM,GAAG,GAAG,eAAI,CAAC,EAAE,CAAiB,GAAG,CAAC,CAAC;IAEzC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IAE9C,MAAM,SAAS,GAAG,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACzC,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC;IAE5C,MAAM,GAAG,GAAU;QACjB,EAAE,EAAE,EAAE;QACN,QAAQ,EAAE,kCAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzD,MAAM,EAAE,4BAAM,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC;QAC3C,MAAM,EAAE,EAAE;QACV,aAAa,EAAE,qBAAa,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC;KAClE,CAAC;IAEF,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC;IAC/C,IAAI,KAAK;QACP,YAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;YACnC,MAAM,CAAC,GAAG,uBAAU,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAE1C,IAAI,CAAC;gBAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IAEL,OAAO,GAAG,CAAC;AACb,CAAC;AA3BD,0BA2BC"}
|
|
@@ -16,5 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
__exportStar(require("./Block"), exports);
|
|
19
|
+
__exportStar(require("./BlockState"), exports);
|
|
19
20
|
__exportStar(require("./Process"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/Lib/Project/BehaviorPack/Block/index.ts"],"names":[],"mappings":";AAAA,oBAAoB;;;;;;;;;;;;;;;;AAEpB,0CAAwB;AACxB,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/Lib/Project/BehaviorPack/Block/index.ts"],"names":[],"mappings":";AAAA,oBAAoB;;;;;;;;;;;;;;;;AAEpB,0CAAwB;AACxB,+CAA6B;AAC7B,4CAA0B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bc-minecraft-bedrock-project",
|
|
3
|
-
"version": "1.19.73-
|
|
3
|
+
"version": "1.19.73-4",
|
|
4
4
|
"description": "The typescript library responsible for reading/parsing minecraft bedrock data",
|
|
5
5
|
"main": "./lib/src/main.js",
|
|
6
6
|
"types": "./lib/src/main.d.ts",
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"@types/node": "^18.15.11",
|
|
46
46
|
"chai": "^4.3.7",
|
|
47
47
|
"mocha": "^10.2.0",
|
|
48
|
-
"mocha-junit-reporter": "^2.2.0",
|
|
49
48
|
"rimraf": "^5.0.0",
|
|
50
49
|
"ts-node": "^10.9.1",
|
|
51
50
|
"typescript": "^5.0.4"
|