2019-05-13 21:07:51 -05:00
|
|
|
import {Packet} from '@avocado/net';
|
|
|
|
|
|
|
|
export class EntityPacket extends Packet {
|
|
|
|
|
|
|
|
constructor(data, entity) {
|
|
|
|
if ('undefined' !== typeof entity) {
|
2019-05-16 17:44:45 -05:00
|
|
|
data.uuid = entity.numericUid;
|
2019-05-13 21:07:51 -05:00
|
|
|
}
|
|
|
|
super(data);
|
|
|
|
this.entity = entity;
|
|
|
|
}
|
|
|
|
|
|
|
|
static get schema() {
|
|
|
|
return {
|
|
|
|
...super.schema,
|
|
|
|
data: {
|
2019-05-16 17:44:45 -05:00
|
|
|
uuid: 'uint32',
|
2019-05-13 21:07:51 -05:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|