Skip to content

Instantly share code, notes, and snippets.

@Matthewacon
Created February 21, 2016 15:44
Show Gist options
  • Save Matthewacon/9f2fbcf389a401f3bb60 to your computer and use it in GitHub Desktop.
Save Matthewacon/9f2fbcf389a401f3bb60 to your computer and use it in GitHub Desktop.
const Chunk = require('prismarine-chunk')(require("../version"));
const Vec3 = require('vec3').Vec3;
function generation() {
function generateSimpleChunk(dx,dy,dz) {
const chunk = new Chunk();
for (let x = (dy*16)-16; x < (dx*16); x++) {
for (let z = (dz*16)-16; z < (dz*16); z++) {
chunk.setBlockType(new Vec3(x, 50, z), 2);
for (let y = (dy*16)-16; y < 256; y++) {
chunk.setSkyLight(new Vec3(x, y, z), 15);
}
}
}
return chunk;
}
return generateSimpleChunk;
}
module.exports=generation;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment