Search in sources :

Example 11 with ModuleOverride

use of com.teamwizardry.wizardry.api.spell.annotation.ModuleOverride 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)11 Vec3d (net.minecraft.util.math.Vec3d)10 Entity (net.minecraft.entity.Entity)9 EntityLivingBase (net.minecraft.entity.EntityLivingBase)5 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)5 RandUtilSeed (com.teamwizardry.wizardry.api.util.RandUtilSeed)4 RayTrace (com.teamwizardry.wizardry.api.util.RayTrace)2 EntityLightningProjectile (com.teamwizardry.wizardry.common.entity.projectile.EntityLightningProjectile)2 RayTraceResult (net.minecraft.util.math.RayTraceResult)2 PacketHandler (com.teamwizardry.librarianlib.features.network.PacketHandler)1 LightningGenerator (com.teamwizardry.wizardry.api.LightningGenerator)1 SpellData (com.teamwizardry.wizardry.api.spell.SpellData)1 LOOK (com.teamwizardry.wizardry.api.spell.SpellData.DefaultKeys.LOOK)1 SpellRing (com.teamwizardry.wizardry.api.spell.SpellRing)1 ContextRing (com.teamwizardry.wizardry.api.spell.annotation.ContextRing)1 ContextSuper (com.teamwizardry.wizardry.api.spell.annotation.ContextSuper)1 RegisterModule (com.teamwizardry.wizardry.api.spell.annotation.RegisterModule)1 AttributeRegistry (com.teamwizardry.wizardry.api.spell.attribute.AttributeRegistry)1 IModuleEffect (com.teamwizardry.wizardry.api.spell.module.IModuleEffect)1 ModuleInstanceEffect (com.teamwizardry.wizardry.api.spell.module.ModuleInstanceEffect)1