Search in sources :

Example 1 with Vector3FMeta

use of org.dragonet.common.data.entity.meta.type.Vector3FMeta in project DragonProxy by DragonetMC.

the class PCEntitySetPassengerPacketTranslator method setRiding.

// if offset is null, it's a dismount action
private void setRiding(UpstreamSession session, CachedEntity rider, Vector3F offset) {
    EntityMetaData peMeta = EntityMetaTranslator.translateToPE(session, rider.pcMeta, rider.peType);
    peMeta.setGenericFlag(EntityMetaData.Constants.DATA_FLAG_RIDING, offset != null);
    if (offset != null) {
        peMeta.set(EntityMetaData.Constants.DATA_RIDER_SEAT_POSITION, new Vector3FMeta(offset));
    }
    SetEntityDataPacket pk = new SetEntityDataPacket();
    pk.rtid = rider.proxyEid;
    pk.meta = peMeta;
    session.putCachePacket(pk);
}
Also used : SetEntityDataPacket(org.dragonet.protocol.packets.SetEntityDataPacket) EntityMetaData(org.dragonet.common.data.entity.meta.EntityMetaData) Vector3FMeta(org.dragonet.common.data.entity.meta.type.Vector3FMeta)

Aggregations

EntityMetaData (org.dragonet.common.data.entity.meta.EntityMetaData)1 Vector3FMeta (org.dragonet.common.data.entity.meta.type.Vector3FMeta)1 SetEntityDataPacket (org.dragonet.protocol.packets.SetEntityDataPacket)1