From 04ae633924a7333dc6307767e4e3700dd427b81b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 20 Oct 2016 23:41:51 -0400 Subject: [PATCH] Gave Zanthr ArrowTrails --- .../alisolarflare/aliarrow/AliArrowListener.java | 16 +++++++++++----- .../alisolarflare/aliarrow/AliArrowTask.java | 14 ++++++++++++-- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowListener.java b/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowListener.java index c384269..82e2299 100644 --- a/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowListener.java +++ b/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowListener.java @@ -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; } diff --git a/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowTask.java b/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowTask.java index e3d104a..a5d430e 100644 --- a/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowTask.java +++ b/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowTask.java @@ -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); + + } + }