package com.censoredsoftware.Demigods.Episodes.Demo.Deity.Donator;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;

import com.censoredsoftware.Demigods.Engine.Object.Ability.Ability;
import com.censoredsoftware.Demigods.Engine.Object.Ability.AbilityInfo;
import com.censoredsoftware.Demigods.Engine.Object.Ability.Devotion;
import com.censoredsoftware.Demigods.Engine.Object.Deity.Deity;
import com.censoredsoftware.Demigods.Engine.Object.Deity.DeityInfo;
import com.censoredsoftware.Demigods.Engine.Utility.MiscUtility;
import com.censoredsoftware.Demigods.Engine.Utility.UnicodeUtility;

public class Disco extends Deity
{
	private static String name = "Disco", alliance = "Donator";
	private static ChatColor color = ChatColor.STRIKETHROUGH;
	private static Set<Material> claimItems = new HashSet<Material>()
	{
		{
			add(Material.DIRT);
		}
	};
	private static List<String> lore = new ArrayList<String>()
	{
		{
			add(" ");
			add(ChatColor.AQUA + " Demigods > " + ChatColor.RESET + color + name);
			add(ChatColor.RESET + "-----------------------------------------------------");
			add(ChatColor.YELLOW + " Claim Items:");
			for(Material item : claimItems)
			{
				add(ChatColor.GRAY + " " + UnicodeUtility.rightwardArrow() + " " + ChatColor.WHITE + item.name());
			}
			add(ChatColor.YELLOW + " Abilities:");
		}
	};
	private static Type type = Type.DEMO;
	private static Set<Ability> abilities = new HashSet<Ability>()
	{
		{
			add(new RainbowWalking());
		}
	};

	public Disco()
	{
		super(new DeityInfo(name, alliance, color, claimItems, lore, type), abilities);
	}
}

class RainbowWalking extends Ability
{
	private static String deity = "Disco", name = "Rainbow Walking", command = null, permission = "demigods.donator.disco";
	private static int cost = 170, delay = 1500, cooldownMin = 0, cooldownMax = 0;
	private static AbilityInfo info;
	private static List<String> details = new ArrayList<String>()
	{
		{
			add(ChatColor.GRAY + " " + UnicodeUtility.rightwardArrow() + " " + ChatColor.WHITE + "Constantly shit rainbows.");
		}
	};
	private static Devotion.Type type = Devotion.Type.SUPPORT;

	protected RainbowWalking()
	{
		super(info = new AbilityInfo(deity, name, command, permission, cost, delay, cooldownMin, cooldownMax, details, type), new Listener()
		{
			@EventHandler(priority = EventPriority.HIGH)
			public void onPlayerMove(PlayerMoveEvent event)
			{
				Player player = event.getPlayer();
				if(!Deity.canUseDeitySilent(player, deity)) return;

				// PHELPS RAINBOW SHITTING
				if(player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType().isSolid())
				{
					for(Entity entity : player.getNearbyEntities(20, 20, 20))
					{
						if(entity instanceof Player) rainbow(player, (Player) entity);
					}
					rainbow(player, player);
				}
			}
		});
	}

	private static void rainbow(Player disco, Player player)
	{
		player.sendBlockChange(disco.getLocation().getBlock().getRelative(BlockFace.DOWN).getLocation(), Material.WOOL, (byte) MiscUtility.generateIntRange(0, 15));
	}
}

@@ -190,16 +190,42 @@
 tColor;%0A
+import org.bukkit.Effect;%0A
 import o
@@ -907,24 +907,91 @@
 iscUtility;%0A
+import com.censoredsoftware.Demigods.Engine.Utility.SpigotUtility;%0A
 import com.c
@@ -3485,13 +3485,143 @@
 , 15));%0A
+%09%09if(SpigotUtility.runningSpigot()) SpigotUtility.playParticle(disco.getLocation(), Effect.COLOURED_DUST, 0, 0, 0, 10F, 100, 10);%0A
 %09%7D%0A%7D%0A

Add disco colors in the air.