avocado-old/packages/entity/entity.packet.js
2019-04-28 22:33:41 -05:00

26 lines
396 B
JavaScript

import {Packet} from '@avocado/net';
export class EntityPacket extends Packet {
static get schema() {
return {
...super.schema,
data: [{
uuid: 'string',
}],
};
}
bundleWith(other) {
this.data.push(other.data[0]);
}
forEachData(fn) {
for (let i = 0; i < this.data.length; i++) {
const data = this.data[i];
fn(data);
}
}
}