Search in sources :

Example 1 with EntityLightningProjectile

use of com.teamwizardry.wizardry.common.entity.projectile.EntityLightningProjectile in project Wizardry by TeamWizardry.

the class ModuleEffectLightning method onRunProjectile.

@ModuleOverride("shape_projectile_run")
public boolean onRunProjectile(@ContextSuper ModuleOverrideSuper ovdSuper, World world, SpellData data, SpellRing shape, @ContextRing SpellRing childRing) {
    if (ovdSuper.hasSuper())
        ovdSuper.invoke(true, world, data, shape);
    if (world.isRemote)
        return true;
    Vec3d origin = data.getOriginWithFallback(world);
    if (origin == null)
        return true;
    if (!childRing.taxCaster(world, data, true))
        return true;
    double dist = shape.getAttributeValue(world, AttributeRegistry.RANGE, data);
    double speed = shape.getAttributeValue(world, AttributeRegistry.SPEED, data);
    EntityLightningProjectile proj = new EntityLightningProjectile(world, shape, childRing, data, (float) dist, (float) speed, (float) 0.1);
    proj.setPosition(origin.x, origin.y, origin.z);
    world.spawnEntity(proj);
    return true;
}
Also used : EntityLightningProjectile(com.teamwizardry.wizardry.common.entity.projectile.EntityLightningProjectile) Vec3d(net.minecraft.util.math.Vec3d) ModuleOverride(com.teamwizardry.wizardry.api.spell.annotation.ModuleOverride)

Aggregations

ModuleOverride (com.teamwizardry.wizardry.api.spell.annotation.ModuleOverride)1 EntityLightningProjectile (com.teamwizardry.wizardry.common.entity.projectile.EntityLightningProjectile)1 Vec3d (net.minecraft.util.math.Vec3d)1