[] (https://circleci.com/gh/PrismarineJS/prismarine-chunk) [![Join the chat at https://gitter.im/PrismarineJS/prismarine-chunk] (https://img.shields.io/badge/gitter-join%20chat-brightgreen.svg)] (https://gitter.im/PrismarineJS/prismarine-chunk)
A class to hold chunk data for Minecraft PC 1.8 and PE 0.14
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(JSON.stringify(chunk.getBlock(new Vec3(3,50,3)),null,2));
Build a new chunk
Initialize a chunk.
iniFunc
is a function(x,y,z) returning a prismarine-block.
That function is faster than iterating and calling the setBlock* manually. It is useful to generate a whole chunk and load a whole chunk.
Get the block type at pos
Get the block data (metadata) at pos
Get the block light at pos
Get the block sky light at pos
Get the block biome id at pos
Get the block biome color at pos
. Does nothing for PC.
Set the block type id
at pos
Set the block data
(metadata) at pos
Set the block light
at pos
Set the block sky light
at pos
Set the block biome
id at pos
Set the block biomeColor
at pos
. Does nothing for PC.
Returns the chunk raw data
Load raw data
into the chunk
- support MCPE 0.14 chunks
- update to babel6
- bump dependencies
- simplify and fix initialize
- fix iniPos in initialize
- add Chunk.initialize, useful for fast generation
- fix the badge
- use vec3
- add an example + doc
- use prismarine-block
- First version, basic functionality