Search in sources :

Example 1 with EyeLocationProperty

use of org.spongepowered.api.data.property.entity.EyeLocationProperty in project Skree by Skelril.

the class VelocityEntitySpawner method sendRadial.

public static List<Entity> sendRadial(EntityType type, Living living, int amt, float speed, Cause cause) {
    Location<World> livingLocation = living.getLocation();
    Optional<EyeLocationProperty> optEyeLoc = living.getProperty(EyeLocationProperty.class);
    if (optEyeLoc.isPresent()) {
        Vector3d eyePosition = optEyeLoc.get().getValue();
        livingLocation = livingLocation.setPosition(eyePosition);
    }
    return sendRadial(type, livingLocation, amt, speed, cause);
}
Also used : Vector3d(com.flowpowered.math.vector.Vector3d) World(org.spongepowered.api.world.World) EyeLocationProperty(org.spongepowered.api.data.property.entity.EyeLocationProperty)

Aggregations

Vector3d (com.flowpowered.math.vector.Vector3d)1 EyeLocationProperty (org.spongepowered.api.data.property.entity.EyeLocationProperty)1 World (org.spongepowered.api.world.World)1