use of com.teamwizardry.wizardry.common.entity.EntitySpellProjectile in project Wizardry by TeamWizardry.
the class ModuleShapeProjectile method run.
@Override
public boolean run(@Nonnull SpellData spell, @Nonnull SpellRing spellRing) {
World world = spell.world;
if (world.isRemote)
return true;
Vec3d origin = spell.getOriginWithFallback();
if (origin == null)
return false;
double dist = spellRing.getAttributeValue(AttributeRegistry.RANGE, spell);
double speed = spellRing.getAttributeValue(AttributeRegistry.SPEED, spell);
EntitySpellProjectile proj = new EntitySpellProjectile(world, spellRing, spell, dist, speed, 0.1);
proj.setPosition(origin.x, origin.y, origin.z);
proj.velocityChanged = true;
if (!spellRing.taxCaster(spell))
return false;
boolean success = world.spawnEntity(proj);
if (success)
world.playSound(null, new BlockPos(origin), ModSounds.PROJECTILE_LAUNCH, SoundCategory.PLAYERS, 1f, (float) RandUtil.nextDouble(1, 1.5));
return success;
}
Aggregations