Gave Zanthr ArrowTrails

This commit is contained in:
alisolarflare 2016-10-20 23:41:51 -04:00
parent 49fa5fa407
commit 04ae633924
2 changed files with 23 additions and 7 deletions

View file

@ -24,15 +24,21 @@ public class AliArrowListener implements Listener {
return;
}
Projectile projectile = event.getEntity();
if (!(projectile.getShooter().equals(plugin.getServer().getPlayer("Ali")))){
return;
}
Arrow arrow = (Arrow) projectile;
if (!(arrow.isCritical())){
return;
}
AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow);
aliArrowTask.runTaskTimer(plugin, 2, 1);
if (projectile.getShooter().equals(plugin.getServer().getPlayer("alisolarflare"))){
AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"alisolarflare");
aliArrowTask.runTaskTimer(plugin, 2, 1);
return;
}else if (!(projectile.getShooter().equals(plugin.getServer().getPlayer("Zanthr")))){
AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"alisolarflare");
aliArrowTask.runTaskTimer(plugin, 2, 1);
return;
}
return;
}catch(Exception e){
return;
}

View file

@ -8,21 +8,31 @@ import buttondevteam.bucket.MainPlugin;
public class AliArrowTask extends BukkitRunnable{
MainPlugin plugin;
String name;
Arrow arrow;
public AliArrowTask(MainPlugin plugin, Arrow arrow){
public AliArrowTask(MainPlugin plugin, Arrow arrow, String name){
this.name = name;
this.plugin = plugin;
this.arrow = arrow;
}
@Override
public void run() {
arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1);
if (arrow.isOnGround() || arrow.isDead()){
this.cancel();
}
if (name.equalsIgnoreCase("alisolarflare")){
arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1);
}
if (name.equalsIgnoreCase("Zanthr")){
arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1);
arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1);
}
}