package com.censoredsoftware.demigods.item.weapon;

import com.censoredsoftware.demigods.util.Items;
import com.censoredsoftware.demigods.util.Zones;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;
import org.bukkit.inventory.ShapedRecipe;

import java.util.ArrayList;

public class DeathBow
{
	public final static ItemStack deathBow = Items.create(Material.BOW, ChatColor.DARK_RED + "" + ChatColor.BOLD + "The Bow of Five Arrows", new ArrayList<String>()
	{
		{
			add(ChatColor.DARK_PURPLE + "" + ChatColor.ITALIC + "Take your target out 5 times faster!");
		}
	}, null);
	public final static Recipe recipe = new ShapedRecipe(deathBow)
	{
		{
			shape("A  ", " A ", "  A");
			setIngredient('A', Material.BOW);
		}
	};
	public final static Listener listener = new Listener()
	{
		@EventHandler(priority = EventPriority.HIGH)
		private void onEntityShootBow(EntityShootBowEvent event)
		{
			// Return for disabled world
			if(Zones.inNoDemigodsZone(event.getEntity().getLocation())) return;

			// If they right clicked a block with the item in hand, do stuff
			if(Items.areEqual(event.getBow(), deathBow))
			{
				Arrow startArrow = (Arrow) event.getProjectile();
				startArrow.setVelocity(startArrow.getVelocity().multiply(.8));
				for(int i = 1; i < 5; i++)
				{
					Arrow spawnedArrow = (Arrow) event.getEntity().getWorld().spawnEntity(startArrow.getLocation(), EntityType.ARROW);
					spawnedArrow.setVelocity(startArrow.getVelocity().multiply(.9 / i));
				}
			}
		}
	};
}

@@ -56,98 +56,29 @@
 ort 
-com.censoredsoftware.demigods.util.Items;%0Aimport com.censoredsoftware.demigods.util.Zones;
+java.util.ArrayList;%0A
 %0Aimp
@@ -488,35 +488,105 @@
 %0Aimport 
-java.util.ArrayList
+com.censoredsoftware.demigods.util.Items;%0Aimport com.censoredsoftware.demigods.util.Zones
 ;%0A%0Apubli
@@ -1542,24 +1542,103 @@
 tiply(.8));%0A
+%09%09%09%09startArrow.setPassenger(event.getEntity()); // TODO: For shits and giggles%0A
 %09%09%09%09for(int 
@@ -1782,16 +1782,65 @@
 ARROW);%0A
+%09%09%09%09%09spawnedArrow.setShooter(event.getEntity());%0A
 %09%09%09%09%09spa

Set the shooter of the spawned arrows for the Bow of 5 Arrows. Also set passenger for shits and giggles.