Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loadNBT(structure).then((rawNbt) => {
NBT.parse(rawNbt, (err, data) => {
if (err) {
console.warn("Error while parsing NBT data");
console.warn(err);
return;
}
if (!PRODUCTION) {
console.log("NBT Data:")
console.log(data);
}
parseStructureData(data).then((data) => {
cb(data);
})
})
})
Schematic.parse = function (data, callback) {
if (!callback) callback = function (err) {
if (err) throw err;
};
nbt.parse(data, function (err, data) {
callback(err, err ? null : new Schematic(data));
});
};