-
-
Save mogery/15ba45e87c385e77e3a08fbdb0a26a93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.buffer = Buffer.concat([ | |
// packet length is added by wrapper | |
BufferMangler.writeVarInt(this.constructor.id), // 0x25 | |
BufferMangler.writeVarInt(this.x), // chunk x | |
BufferMangler.writeVarInt(this.z), // chunk y | |
BufferMangler.writeUInt8(1), // trust edges | |
// sky light mask | |
BufferMangler.writeVarInt(1), | |
BufferMangler.writeBigUInt64BE(0b111111111111111110n), // Y=17 to 0 | |
// block light mask | |
BufferMangler.writeVarInt(1), | |
BufferMangler.writeBigUInt64BE(0b000000000000000000n), // Y=0 | |
// empty sky light mask | |
BufferMangler.writeVarInt(1), | |
BufferMangler.writeBigUInt64BE(0b000000000000000001n), // Y=-1 | |
// empty block light mask | |
BufferMangler.writeVarInt(1), | |
BufferMangler.writeBigUInt64BE(0b111111111111111111n), // Y=17 to -1 | |
// sky light array | |
BufferMangler.writeVarInt(17), // length | |
Buffer.concat(new Array(17).fill(0).map(() => { | |
return Buffer.concat([ | |
BufferMangler.writeVarInt(2048), | |
Buffer.concat(new Array(2048).fill(0xff).map(x => BufferMangler.writeUInt8(x))) | |
]) | |
})), | |
// block light array | |
BufferMangler.writeVarInt(0), // length | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment