Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function (version) {
var Block = require('./block')(version);
var Item = require('prismarine-item')(version);
var itemsByName = require('minecraft-data')(version).itemsByName;
function container(self, raw) {
if (raw.CustomName) self.customName = raw.CustomName.value;
self.lockKey = raw.Lock.value;
self.items = [];
raw.Items.value.value.forEach(function (item) {
var data = itemsByName[item.id.value.split(':')[1]];
self.items.push(new Item(data ? data.id : 1,
item.Count.value, item.Damage.value, item.tag ? item.tag.value : {}));
});
}
function BlockEntity(schem, raw) {
Block.apply(this, schem._blockArgs(vec3(raw.x.value, raw.y.value, raw.z.value)));
this.raw = raw;