123456789101112131415161718192021222324252627282930 |
- package me.km.effects.active;
- import java.util.Collection;
- import me.km.api.Utils;
- import me.km.effects.ActiveEffectBase;
- import me.km.effects.EffectUtils;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.math.BlockPos;
- public class Elevation extends ActiveEffectBase
- {
- @Override
- protected boolean executeEffect(EntityPlayerMP p, int power)
- {
- BlockPos target = Utils.getPlayerTarget(p, power + 3).up();
- EffectUtils.playSound(p, SoundEvents.ENTITY_FIREWORK_TWINKLE_FAR);
- EffectUtils.spawnSpell(p, power);
- Collection<EntityLivingBase> list = EffectUtils.getEntsOfNotGuild(p, p.world, target.getX(), target.getY(), target.getZ(), 3);
- EffectUtils.spawnParticleCircle(p.getServerWorld(), p, EnumParticleTypes.SPELL, 3, 30);
- double shootPower = 1 + power / 20d;
- list.stream().forEach((en) ->
- {
- Utils.setVelocity(en, 0, shootPower, 0);
- });
- return true;
- }
- }
|