Search in sources :

Example 1 with PacketVelocityDelta

use of io.xol.chunkstories.api.net.packets.PacketVelocityDelta in project chunkstories-api by Hugobros3.

the class EntityComponentVelocity method addVelocity.

public void addVelocity(Vector3dc delta) {
    this.velocity.add(delta);
    this.pushComponentEveryoneButController();
    // Notify the controller otherwise:
    if (entity instanceof EntityControllable) {
        Controller controller = ((EntityControllable) entity).getControllerComponent().getController();
        if (controller != null) {
            PacketVelocityDelta packet = new PacketVelocityDelta(entity.getWorld(), delta);
            controller.pushPacket(packet);
        }
    }
}
Also used : PacketVelocityDelta(io.xol.chunkstories.api.net.packets.PacketVelocityDelta) Controller(io.xol.chunkstories.api.entity.Controller) EntityControllable(io.xol.chunkstories.api.entity.interfaces.EntityControllable)

Aggregations

Controller (io.xol.chunkstories.api.entity.Controller)1 EntityControllable (io.xol.chunkstories.api.entity.interfaces.EntityControllable)1 PacketVelocityDelta (io.xol.chunkstories.api.net.packets.PacketVelocityDelta)1