Search in sources :

Example 1 with ModuleOverrideSuper

use of com.teamwizardry.wizardry.api.spell.module.ModuleOverrideSuper in project Wizardry by TeamWizardry.

the class ModuleEffectLightning method onRunTouch.

@ModuleOverride("shape_touch_run")
public void onRunTouch(@ContextSuper ModuleOverrideSuper ovdSuper, World world, SpellData data, SpellRing shape, @ContextRing SpellRing childRing) {
    if (ovdSuper.hasSuper())
        ovdSuper.invoke(true, world, data, shape);
    Vec3d look = data.getData(LOOK);
    Entity caster = data.getCaster(world);
    Vec3d origin = data.getOriginWithFallback(world);
    if (look == null || caster == null || origin == null)
        return;
    if (!childRing.taxCaster(world, data, true))
        return;
    double range = childRing.getAttributeValue(world, AttributeRegistry.RANGE, data);
    double potency = childRing.getAttributeValue(world, AttributeRegistry.POTENCY, data);
    double duration = childRing.getAttributeValue(world, AttributeRegistry.DURATION, data);
    RayTraceResult trace = new RayTrace(world, look, origin, caster instanceof EntityLivingBase ? ((EntityLivingBase) caster).getEntityAttribute(EntityPlayer.REACH_DISTANCE).getAttributeValue() : 5).setEntityFilter(input -> input != caster).setReturnLastUncollidableBlock(true).setIgnoreBlocksWithoutBoundingBoxes(true).trace();
    doLightning(RandUtil.nextLong(100, 100000), world, caster, origin, trace.hitVec, range, potency, duration);
}
Also used : AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) ModuleInstanceEffect(com.teamwizardry.wizardry.api.spell.module.ModuleInstanceEffect) ModuleOverrideSuper(com.teamwizardry.wizardry.api.spell.module.ModuleOverrideSuper) ModuleOverride(com.teamwizardry.wizardry.api.spell.annotation.ModuleOverride) PosUtils(com.teamwizardry.wizardry.api.util.PosUtils) PacketRenderLightningBolt(com.teamwizardry.wizardry.common.network.PacketRenderLightningBolt) SpellRing(com.teamwizardry.wizardry.api.spell.SpellRing) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) RayTraceResult(net.minecraft.util.math.RayTraceResult) Vec3d(net.minecraft.util.math.Vec3d) Side(net.minecraftforge.fml.relauncher.Side) RandUtilSeed(com.teamwizardry.wizardry.api.util.RandUtilSeed) ModSounds(com.teamwizardry.wizardry.init.ModSounds) SpellData(com.teamwizardry.wizardry.api.spell.SpellData) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) IModuleEffect(com.teamwizardry.wizardry.api.spell.module.IModuleEffect) SoundCategory(net.minecraft.util.SoundCategory) Nonnull(javax.annotation.Nonnull) LightningGenerator(com.teamwizardry.wizardry.api.LightningGenerator) ContextRing(com.teamwizardry.wizardry.api.spell.annotation.ContextRing) Entity(net.minecraft.entity.Entity) PacketHandler(com.teamwizardry.librarianlib.features.network.PacketHandler) World(net.minecraft.world.World) ContextSuper(com.teamwizardry.wizardry.api.spell.annotation.ContextSuper) LOOK(com.teamwizardry.wizardry.api.spell.SpellData.DefaultKeys.LOOK) RayTrace(com.teamwizardry.wizardry.api.util.RayTrace) BlockPos(net.minecraft.util.math.BlockPos) AttributeRegistry(com.teamwizardry.wizardry.api.spell.attribute.AttributeRegistry) NetworkRegistry(net.minecraftforge.fml.common.network.NetworkRegistry) LightningTracker(com.teamwizardry.wizardry.common.core.LightningTracker) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) RegisterModule(com.teamwizardry.wizardry.api.spell.annotation.RegisterModule) EntityLightningProjectile(com.teamwizardry.wizardry.common.entity.projectile.EntityLightningProjectile) RandUtil(com.teamwizardry.wizardry.api.util.RandUtil) NotNull(org.jetbrains.annotations.NotNull) Entity(net.minecraft.entity.Entity) RayTrace(com.teamwizardry.wizardry.api.util.RayTrace) RayTraceResult(net.minecraft.util.math.RayTraceResult) EntityLivingBase(net.minecraft.entity.EntityLivingBase) Vec3d(net.minecraft.util.math.Vec3d) ModuleOverride(com.teamwizardry.wizardry.api.spell.annotation.ModuleOverride)

Aggregations

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 ModuleOverride (com.teamwizardry.wizardry.api.spell.annotation.ModuleOverride)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 ModuleOverrideSuper (com.teamwizardry.wizardry.api.spell.module.ModuleOverrideSuper)1 PosUtils (com.teamwizardry.wizardry.api.util.PosUtils)1 RandUtil (com.teamwizardry.wizardry.api.util.RandUtil)1 RandUtilSeed (com.teamwizardry.wizardry.api.util.RandUtilSeed)1 RayTrace (com.teamwizardry.wizardry.api.util.RayTrace)1 LightningTracker (com.teamwizardry.wizardry.common.core.LightningTracker)1 EntityLightningProjectile (com.teamwizardry.wizardry.common.entity.projectile.EntityLightningProjectile)1 PacketRenderLightningBolt (com.teamwizardry.wizardry.common.network.PacketRenderLightningBolt)1