@serenityjs/data 0.0.0

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.
Binary file
@@ -0,0 +1,51 @@
1
+ interface BlockStates {
2
+ identifier: string;
3
+ values: Array<string | number | boolean>;
4
+ }
5
+ interface BlockTypes {
6
+ identifier: string;
7
+ loggable: boolean;
8
+ states: Array<string>;
9
+ }
10
+ interface BlockPermutations {
11
+ identifier: string;
12
+ hash: number;
13
+ state: Record<string, string | number | boolean>;
14
+ }
15
+ interface ItemTypes {
16
+ identifier: string;
17
+ }
18
+ /**
19
+ * Block states for all blocks in the game.
20
+ */
21
+ declare const BLOCK_STATES: Array<BlockStates>;
22
+ /**
23
+ * Block types for all blocks in the game.
24
+ */
25
+ declare const BLOCK_TYPES: Array<BlockTypes>;
26
+ /**
27
+ * Block permutations for all blocks in the game.
28
+ */
29
+ declare const BLOCK_PERMUTATIONS: Array<BlockPermutations>;
30
+ /**
31
+ * Item types for all items in the game.
32
+ */
33
+ declare const ITEM_TYPES: Array<ItemTypes>;
34
+ /**
35
+ * Raw NBT data for the canonical block states.
36
+ */
37
+ declare const CANONICAL_BLOCK_STATES: Buffer;
38
+ /**
39
+ * Raw NBT data for the biome definition list.
40
+ */
41
+ declare const BIOME_DEFINITION_LIST: Buffer;
42
+ /**
43
+ * Raw binary data for the creative content.
44
+ */
45
+ declare const CREATIVE_CONTENT: Buffer;
46
+ /**
47
+ * Raw binary data for the item states.
48
+ */
49
+ declare const ITEMDATA: Buffer;
50
+
51
+ export { BIOME_DEFINITION_LIST, BLOCK_PERMUTATIONS, BLOCK_STATES, BLOCK_TYPES, CANONICAL_BLOCK_STATES, CREATIVE_CONTENT, ITEMDATA, ITEM_TYPES };
package/dist/index.js ADDED
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ BIOME_DEFINITION_LIST: () => BIOME_DEFINITION_LIST,
24
+ BLOCK_PERMUTATIONS: () => BLOCK_PERMUTATIONS,
25
+ BLOCK_STATES: () => BLOCK_STATES,
26
+ BLOCK_TYPES: () => BLOCK_TYPES,
27
+ CANONICAL_BLOCK_STATES: () => CANONICAL_BLOCK_STATES,
28
+ CREATIVE_CONTENT: () => CREATIVE_CONTENT,
29
+ ITEMDATA: () => ITEMDATA,
30
+ ITEM_TYPES: () => ITEM_TYPES
31
+ });
32
+ module.exports = __toCommonJS(src_exports);
33
+ var import_node_fs = require("fs");
34
+ var import_node_path = require("path");
35
+ var data = (0, import_node_path.resolve)(__dirname, "../data");
36
+ var BLOCK_STATES = JSON.parse(
37
+ (0, import_node_fs.readFileSync)((0, import_node_path.resolve)(data, "block_states.json"), "utf8")
38
+ );
39
+ var BLOCK_TYPES = JSON.parse(
40
+ (0, import_node_fs.readFileSync)((0, import_node_path.resolve)(data, "block_types.json"), "utf8")
41
+ );
42
+ var BLOCK_PERMUTATIONS = JSON.parse(
43
+ (0, import_node_fs.readFileSync)((0, import_node_path.resolve)(data, "block_permutations.json"), "utf8")
44
+ );
45
+ var ITEM_TYPES = JSON.parse(
46
+ (0, import_node_fs.readFileSync)((0, import_node_path.resolve)(data, "item_types.json"), "utf8")
47
+ );
48
+ var CANONICAL_BLOCK_STATES = (0, import_node_fs.readFileSync)(
49
+ (0, import_node_path.resolve)(data, "canonical_block_states.nbt")
50
+ );
51
+ var BIOME_DEFINITION_LIST = (0, import_node_fs.readFileSync)(
52
+ (0, import_node_path.resolve)(data, "biome_definition_list.nbt")
53
+ );
54
+ var CREATIVE_CONTENT = (0, import_node_fs.readFileSync)((0, import_node_path.resolve)(data, "creative_content.bin"));
55
+ var ITEMDATA = (0, import_node_fs.readFileSync)((0, import_node_path.resolve)(data, "itemdata.bin"));
56
+ // Annotate the CommonJS export names for ESM import in node:
57
+ 0 && (module.exports = {
58
+ BIOME_DEFINITION_LIST,
59
+ BLOCK_PERMUTATIONS,
60
+ BLOCK_STATES,
61
+ BLOCK_TYPES,
62
+ CANONICAL_BLOCK_STATES,
63
+ CREATIVE_CONTENT,
64
+ ITEMDATA,
65
+ ITEM_TYPES
66
+ });
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@serenityjs/data",
3
+ "version": "0.0.0",
4
+ "main": "./dist/index.js",
5
+ "types": "./dist/index.d.ts",
6
+ "repository": "https://github.com/SerenityJS/serenity",
7
+ "files": [
8
+ "dist/**",
9
+ "data/**"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsup",
13
+ "watch": "tsup --watch",
14
+ "lint": "eslint src/",
15
+ "typecheck": "tsc --noEmit",
16
+ "test": "jest"
17
+ },
18
+ "jest": {
19
+ "preset": "@serenityjs/jest-presets/jest/node"
20
+ },
21
+ "devDependencies": {
22
+ "@serenityjs/eslint-config": "*",
23
+ "@serenityjs/jest-presets": "*",
24
+ "@serenityjs/typescript-config": "*",
25
+ "@types/jest": "^29.5.12",
26
+ "@types/node": "^20.11.24",
27
+ "jest": "^29.7.0",
28
+ "tsup": "^8.0.2",
29
+ "typescript": "^5.4.2"
30
+ }
31
+ }