minecraft.js
Version:
Minecraft data serialization/deserialization and networking
13 lines (11 loc) • 380 B
JavaScript
/** @constructor */
var Block = module.exports = function(args) {
if(!args) args = {};
this.value = args.value || 0;
this.data = args.data || null;
this.skyLight = args.skyLight || 15;
this.blockLight = args.blockLight || 15;
};
Block.getId = function(x, y, z) {
return (((y & 0xff) << 8) | ((z & 0xf) << 4) | (x & 0xf));
};