use of net.minecraft.server.v1_13_R1.PacketPlayOutAnimation in project Warlords by ebicep.
the class HolyRadianceCrusader method chain.
@Override
public void chain(WarlordsPlayer wp, Player player) {
for (WarlordsPlayer markTarget : PlayerFilter.entitiesAround(player, markRadius, markRadius, markRadius).aliveTeammatesOfExcludingSelf(wp).lookingAtFirst(wp).limit(1)) {
if (Utils.isLookingAtMark(player, markTarget.getEntity()) && Utils.hasLineOfSight(player, markTarget.getEntity())) {
wp.subtractEnergy(energyCost);
Utils.playGlobalSound(player.getLocation(), "paladin.consecrate.activation", 2, 0.65f);
PacketPlayOutAnimation playOutAnimation = new PacketPlayOutAnimation(((CraftPlayer) player).getHandle(), 0);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(playOutAnimation);
// chain particles
EffectUtils.playParticleLinkAnimation(player.getLocation(), markTarget.getLocation(), 255, 170, 0, 1);
EffectUtils.playChainAnimation(wp, markTarget, new ItemStack(Material.PUMPKIN), 20);
HolyRadianceCrusader tempMark = new HolyRadianceCrusader(minDamageHeal, maxDamageHeal, cooldown, energyCost, critChance, critMultiplier);
markTarget.getCooldownManager().addRegularCooldown(name, "CRUS MARK", HolyRadianceCrusader.class, tempMark, wp, CooldownTypes.BUFF, cooldownManager -> {
}, markDuration * 20);
markTarget.getSpeed().addSpeedModifier("Crusader Mark Speed", 25, 20 * markDuration, "BASE");
player.sendMessage(WarlordsPlayer.RECEIVE_ARROW + ChatColor.GRAY + " You have marked " + ChatColor.YELLOW + markTarget.getName() + ChatColor.GRAY + "!");
markTarget.sendMessage(WarlordsPlayer.RECEIVE_ARROW + ChatColor.GRAY + " You have been granted " + ChatColor.YELLOW + "Crusader's Mark" + ChatColor.GRAY + " by " + wp.getName() + "!");
new GameRunnable(wp.getGame()) {
@Override
public void run() {
if (markTarget.getCooldownManager().hasCooldown(tempMark)) {
Location playerLoc = markTarget.getLocation();
Location particleLoc = playerLoc.clone();
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 10; j++) {
double angle = j / 8D * Math.PI * 2;
double width = 1;
particleLoc.setX(playerLoc.getX() + Math.sin(angle) * width);
particleLoc.setY(playerLoc.getY() + i / 6D);
particleLoc.setZ(playerLoc.getZ() + Math.cos(angle) * width);
ParticleEffect.REDSTONE.display(new ParticleEffect.OrdinaryColor(255, 170, 0), particleLoc, 500);
}
}
} else {
this.cancel();
}
}
}.runTaskTimer(0, 10);
} else {
player.sendMessage("§cYour mark was out of range or you did not target a player!");
}
}
}
use of net.minecraft.server.v1_13_R1.PacketPlayOutAnimation in project Warlords by ebicep.
the class AbstractStrikeBase method onActivate.
@Override
public boolean onActivate(@Nonnull WarlordsPlayer wp, @Nonnull Player player) {
PlayerFilter.entitiesAround(wp, 4.8, 4.8, 4.8).aliveEnemiesOf(wp).closestFirst(wp).requireLineOfSight(wp).lookingAtFirst(wp).first((nearPlayer) -> {
if (Utils.isLookingAt(player, nearPlayer.getEntity()) && Utils.hasLineOfSight(player, nearPlayer.getEntity())) {
PacketPlayOutAnimation playOutAnimation = new PacketPlayOutAnimation(((CraftPlayer) player).getHandle(), 0);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(playOutAnimation);
Optional<HammerOfLight> optionalHammer = new CooldownFilter<>(wp, RegularCooldown.class).filterCooldownClassAndMapToObjectsOfClass(HammerOfLight.class).findAny();
if (optionalHammer.isPresent()) {
wp.subtractEnergy(energyCost - (optionalHammer.get().isCrownOfLight() ? 10 : 0));
} else {
wp.subtractEnergy(energyCost);
}
if (this instanceof AvengersStrike || this instanceof CrusadersStrike || this instanceof ProtectorsStrike) {
Utils.playGlobalSound(nearPlayer.getLocation(), "paladin.paladinstrike.activation", 2, 1);
randomHitEffect(nearPlayer, 5, 255, 0, 0);
ParticleEffect.SPELL.display((float) ((Math.random() * 2) - 1), (float) ((Math.random() * 2) - 1), (float) ((Math.random() * 2) - 1), 1, 4, nearPlayer.getLocation().clone().add(0, 1, 0), 500);
} else if (this instanceof WoundingStrikeBerserker || this instanceof WoundingStrikeDefender || this instanceof CripplingStrike) {
Utils.playGlobalSound(nearPlayer.getLocation(), "warrior.mortalstrike.impact", 2, 1);
randomHitEffect(nearPlayer, 7, 255, 0, 0);
} else if (this instanceof JudgementStrike) {
Utils.playGlobalSound(nearPlayer.getLocation(), "warrior.revenant.orbsoflife", 2, 1.7f);
Utils.playGlobalSound(nearPlayer.getLocation(), "mage.frostbolt.activation", 2, 2);
randomHitEffect(nearPlayer, 7, 255, 255, 255);
} else if (this instanceof RighteousStrike) {
Utils.playGlobalSound(nearPlayer.getLocation(), "rogue.vindicatorstrike.activation", 2, 0.7f);
Utils.playGlobalSound(nearPlayer.getLocation(), "shaman.earthenspike.impact", 2, 2);
randomHitEffect(nearPlayer, 7, 255, 255, 255);
} else if (this instanceof ImpalingStrike) {
Utils.playGlobalSound(nearPlayer.getLocation(), "rogue.apothecarystrike.activation", 2, 0.5f);
Utils.playGlobalSound(nearPlayer.getLocation(), "mage.fireball.activation", 2, 1.8f);
randomHitEffect(nearPlayer, 7, 100, 255, 100);
}
onHit(wp, player, nearPlayer);
}
});
return true;
}
use of net.minecraft.server.v1_13_R1.PacketPlayOutAnimation in project Warlords by ebicep.
the class AbstractPlayerClass method sendRightClickPacket.
private void sendRightClickPacket(Player player) {
PacketPlayOutAnimation playOutAnimation = new PacketPlayOutAnimation(((CraftPlayer) player).getHandle(), 0);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(playOutAnimation);
}
use of net.minecraft.server.v1_13_R1.PacketPlayOutAnimation in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_13_R1 method animate.
@Override
public void animate(Player player) {
EntityPlayer NMSPlayer = ((CraftPlayer) player).getHandle();
broadcastPacket(player, new PacketPlayOutAnimation(NMSPlayer, ThreadLocalRandom.current().nextInt(2) == 1 ? 0 : 3));
}
use of net.minecraft.server.v1_13_R1.PacketPlayOutAnimation in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_11_R1 method animate.
@Override
public void animate(Player player) {
EntityPlayer NMSPlayer = ((CraftPlayer) player).getHandle();
broadcastPacket(player, new PacketPlayOutAnimation(NMSPlayer, ThreadLocalRandom.current().nextInt(2) == 1 ? 0 : 3));
}
Aggregations