forked from michaljaz/webmc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblocksDef.js
More file actions
28 lines (19 loc) · 735 Bytes
/
blocksDef.js
File metadata and controls
28 lines (19 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Generated by CoffeeScript 2.5.1
(function() {
var Block, bbox, buildPath, fs, i, j, maxStateId, ref, result;
fs = require("fs");
Block = require("prismarine-block")("1.16.3");
maxStateId = 17111;
result = [];
for (i = j = 0, ref = maxStateId; (0 <= ref ? j <= ref : j >= ref); i = 0 <= ref ? ++j : --j) {
if (Block.fromStateId(i).boundingBox === "block") {
bbox = 1;
} else {
bbox = 0;
}
result.push([Block.fromStateId(i).name, bbox]);
}
buildPath = `${__dirname}/../client/static/assets/blocks`;
fs.writeFileSync(`${buildPath}/blocksDef.json`, JSON.stringify(result));
console.log(`\x1b[32mGenerated blocksDefinitions: ${buildPath}/blocksDef.json\x1b[0m\n`);
}).call(this);