26 lines
396 B
JavaScript
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);
|
|
}
|
|
}
|
|
|
|
}
|