Search in sources :

Example 1 with SetEntityMotionPacket

use of org.dragonet.net.packet.minecraft.SetEntityMotionPacket in project Dragonet-Legacy by DragonetMC.

the class EntityVelocityMessageTranslator method handleSpecific.

@Override
public PEPacket[] handleSpecific(EntityVelocityMessage packet) {
    SetEntityMotionPacket pkMotion = new SetEntityMotionPacket();
    SetEntityMotionPacket.EntityMotionData data = new SetEntityMotionPacket.EntityMotionData();
    data.eid = packet.id;
    data.motionX = (float) packet.velocityX / 32;
    data.motionY = (float) packet.velocityY / 32;
    data.motionZ = (float) packet.velocityZ / 32;
    pkMotion.motions = new SetEntityMotionPacket.EntityMotionData[] { data };
    return new PEPacket[] { pkMotion };
}
Also used : SetEntityMotionPacket(org.dragonet.net.packet.minecraft.SetEntityMotionPacket) PEPacket(org.dragonet.net.packet.minecraft.PEPacket)

Aggregations

PEPacket (org.dragonet.net.packet.minecraft.PEPacket)1 SetEntityMotionPacket (org.dragonet.net.packet.minecraft.SetEntityMotionPacket)1