implement block in hand

(cherry picked from commit 75fd4edd9f67b2cbf5abffc1ea417920106b1353)
This commit is contained in:
LabyStudio
2022-04-14 20:50:18 +02:00
parent 96b287bedc
commit 5c47dd6599
13 changed files with 145 additions and 68 deletions
@@ -33,7 +33,7 @@ window.MetadataChunkBlock = class {
let newLevel = 0;
let typeId = world.getBlockAt(x, y, z);
let block = Block.getById(typeId);
let opacity = typeId === 0 ? 0 : block.getOpacity() * 255;
let opacity = typeId === 0 ? 0 : Math.round(block.getOpacity() * 255);
if (opacity === 0) {
opacity = 1;
+3 -1
View File
@@ -1,6 +1,8 @@
window.Random = class {
constructor(seed) {
static instances = 0;
constructor(seed = Date.now() % 1000000000 ^ Random.instances++ * 1000) {
this.mask = 0xffffffff;
this.m_w = (123456789 + seed) & this.mask;
this.m_z = (987654321 - seed) & this.mask;