Created
October 12, 2015 13:14
-
-
Save rom1504/f4626c3f7e994a37f63a to your computer and use it in GitHub Desktop.
testing chunk compression
This file contains hidden or 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
| var Chunk = require('prismarine-chunk')("1.8"); | |
| var Vec3 = require("vec3"); | |
| var chunk=new Chunk(); | |
| for (var x = 0; x < 16;x++) { | |
| for (var z = 0; z < 16; z++) { | |
| chunk.setBlockType(new Vec3(x, 50, z), 2); | |
| for (var y = 0; y < 256; y++) { | |
| chunk.setSkyLight(new Vec3(x, y, z), 15); | |
| } | |
| } | |
| } | |
| console.log(chunk.data.length); | |
| var zlib = require("zlib"); | |
| zlib.deflate(chunk.data, function(err, newChunk) { console.log(newChunk.length); }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment