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; return;
} }
Projectile projectile = event.getEntity(); Projectile projectile = event.getEntity();
if (!(projectile.getShooter().equals(plugin.getServer().getPlayer("Ali")))){
return;
}
Arrow arrow = (Arrow) projectile; Arrow arrow = (Arrow) projectile;
if (!(arrow.isCritical())){ if (!(arrow.isCritical())){
return; return;
} }
AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow); if (projectile.getShooter().equals(plugin.getServer().getPlayer("alisolarflare"))){
AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"alisolarflare");
aliArrowTask.runTaskTimer(plugin, 2, 1); 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){ }catch(Exception e){
return; return;
} }

View file

@ -8,21 +8,31 @@ import buttondevteam.bucket.MainPlugin;
public class AliArrowTask extends BukkitRunnable{ public class AliArrowTask extends BukkitRunnable{
MainPlugin plugin; MainPlugin plugin;
String name;
Arrow arrow; Arrow arrow;
public AliArrowTask(MainPlugin plugin, Arrow arrow){ public AliArrowTask(MainPlugin plugin, Arrow arrow, String name){
this.name = name;
this.plugin = plugin; this.plugin = plugin;
this.arrow = arrow; this.arrow = arrow;
} }
@Override @Override
public void run() { public void run() {
arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1);
if (arrow.isOnGround() || arrow.isDead()){ if (arrow.isOnGround() || arrow.isDead()){
this.cancel(); 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);
}
} }