package me.craftiii4.Rounds.PossibleRounds.Medium;

import java.util.List;
import java.util.Random;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;

import me.craftiii4.Rounds.GetBlockUnderneath;
import me.craftiii4.Rounds.PickRounds;
import me.craftiii4.Rounds.Rounds;

public class SetArena {
	
	private static int time = 95;
	static int example1;
	static int delay = 10;
	
	static String direction = null;
	static Location lastlocation = null;
	

	public static void startRoundOne45(final Rounds plugin) {

		int currentround = plugin.getDataConfig().getInt("Rounds.CurrentLevel");
		int newround = currentround + 1;

		int howmanyplayers = plugin.getDataConfig()
				.getStringList("PlayersPlaying").size();
		int togo = 0;

		while (howmanyplayers > togo) {
			String playername = plugin.getDataConfig()
					.getStringList("PlayersPlaying").get(togo);
			Player player1 = Bukkit.getPlayer(playername);

			if (!player1.equals(null)) {
				player1.sendMessage(ChatColor.GREEN + "Starting "
						+ ChatColor.GOLD + "Round " + ChatColor.DARK_PURPLE
						+ newround + ChatColor.GREEN + " - Random Front - Medium");

			}
			togo++;
		}

		direction = null;
		lastlocation = null;
		time = 95;
		plugin.getDataConfig().set("Rounds.CurrentLevel", 1);
		GetBlockUnderneath.started = true;
		example1 = plugin.getServer().getScheduler()
				.scheduleAsyncRepeatingTask(plugin, new Runnable() {

					public void run() {

						if (time == 95) {
							int howmanyplayers = plugin.getDataConfig()
									.getStringList("PlayersPlaying").size();
							int togo = 0;

							while (howmanyplayers > togo) {
								String playername = plugin.getDataConfig()
										.getStringList("PlayersPlaying")
										.get(togo);
								Player player1 = Bukkit.getPlayer(playername);

								if (!player1.equals(null)) {
									player1.sendMessage(ChatColor.GOLD
											+ "Better Look out");

								}
								togo++;
							}

							int blockx = plugin.getArenasConfig().getInt(
									"CenterBlock.X");
							int blocky = plugin.getArenasConfig().getInt(
									"CenterBlock.Y");
							int blockz = plugin.getArenasConfig().getInt(
									"CenterBlock.Z");

							String blockw = plugin.getArenasConfig().getString(
									"World");

							Location locationofblock = Bukkit.getWorld(blockw)
									.getBlockAt(blockx, blocky, blockz)
									.getLocation();

							int start1 = -15;
							int start2 = -11;

							while (start2 <= 11) {
								start1 = -15;

								while (start1 <= -8) {

									Location middle = locationofblock
											.getBlock().getLocation();

									Block wool = middle.add(start1, 0, start2)
											.getBlock();
									wool.setData((byte) 5);

									start1++;
								}

								start2++;
							}

							int start11 = 8;
							int start21 = -11;

							while (start21 <= 11) {
								start11 = 8;

								while (start11 <= 15) {

									Location middle = locationofblock
											.getBlock().getLocation();

									Block wool = middle
											.add(start11, 0, start21)
											.getBlock();
									wool.setData((byte) 5);

									start11++;
								}

								start21++;
							}

							int start111 = 8;
							int start211 = -15;

							while (start211 <= 15) {
								start111 = 8;

								while (start111 <= 11) {

									Location middle = locationofblock
											.getBlock().getLocation();

									Block wool = middle.add(start211, 0,
											start111).getBlock();
									wool.setData((byte) 5);

									start111++;
								}

								start211++;
							}

							int start1111 = -11;
							int start2111 = -15;

							while (start2111 <= 15) {
								start1111 = -11;

								while (start1111 <= -8) {

									Location middle = locationofblock
											.getBlock().getLocation();

									Block wool = middle.add(start2111, 0,
											start1111).getBlock();
									wool.setData((byte) 5);

									start1111++;
								}

								start2111++;
							}

						}

						if (time == 89) {
							int blockx = plugin.getArenasConfig().getInt(
									"CenterBlock.X");
							int blocky = plugin.getArenasConfig().getInt(
									"CenterBlock.Y");
							int blockz = plugin.getArenasConfig().getInt(
									"CenterBlock.Z");

							String blockw = plugin.getArenasConfig().getString(
									"World");

							Location locationofblock = Bukkit.getWorld(blockw)
									.getBlockAt(blockx, blocky, blockz)
									.getLocation();

							int start1 = -15;
							int start2 = -11;

							while (start2 <= 11) {
								start1 = -15;

								while (start1 <= -8) {

									Location middle = locationofblock
											.getBlock().getLocation();

									Block wool = middle.add(start1, 0, start2)
											.getBlock();
									wool.setData((byte) 1);

									start1++;
								}

								start2++;
							}

							int start11 = 8;
							int start21 = -11;

							while (start21 <= 11) {
								start11 = 8;

								while (start11 <= 15) {

									Location middle = locationofblock
											.getBlock().getLocation();

									Block wool = middle
											.add(start11, 0, start21)
											.getBlock();
									wool.setData((byte) 1);

									start11++;
								}

								start21++;
							}

							int start111 = 8;
							int start211 = -15;

							while (start211 <= 15) {
								start111 = 8;

								while (start111 <= 11) {

									Location middle = locationofblock
											.getBlock().getLocation();

									Block wool = middle.add(start211, 0,
											start111).getBlock();
									wool.setData((byte) 1);

									start111++;
								}

								start211++;
							}

							int start1111 = -11;
							int start2111 = -15;

							while (start2111 <= 15) {
								start1111 = -11;

								while (start1111 <= -8) {

									Location middle = locationofblock
											.getBlock().getLocation();

									Block wool = middle.add(start2111, 0,
											start1111).getBlock();
									wool.setData((byte) 1);

									start1111++;
								}

								start2111++;
							}

						}

						if (time == 87) {
							int blockx = plugin.getArenasConfig().getInt(
									"CenterBlock.X");
							int blocky = plugin.getArenasConfig().getInt(
									"CenterBlock.Y");
							int blockz = plugin.getArenasConfig().getInt(
									"CenterBlock.Z");

							String blockw = plugin.getArenasConfig().getString(
									"World");

							Location locationofblock = Bukkit.getWorld(blockw)
									.getBlockAt(blockx, blocky, blockz)
									.getLocation();

							int start1 = -15;
							int start2 = -11;

							while (start2 <= 11) {
								start1 = -15;

								while (start1 <= -8) {

									Location middle = locationofblock
											.getBlock().getLocation();

									Block wool = middle.add(start1, 0, start2)
											.getBlock();
									wool.setData((byte) 14);

									start1++;
								}

								start2++;
							}

							int start11 = 8;
							int start21 = -11;

							while (start21 <= 11) {
								start11 = 8;

								while (start11 <= 15) {

									Location middle = locationofblock
											.getBlock().getLocation();

									Block wool = middle
											.add(start11, 0, start21)
											.getBlock();
									wool.setData((byte) 14);

									start11++;
								}

								start21++;
							}

							int start111 = 8;
							int start211 = -15;

							while (start211 <= 15) {
								start111 = 8;

								while (start111 <= 11) {

									Location middle = locationofblock
											.getBlock().getLocation();

									Block wool = middle.add(start211, 0,
											start111).getBlock();
									wool.setData((byte) 14);

									start111++;
								}

								start211++;
							}

							int start1111 = -11;
							int start2111 = -15;

							while (start2111 <= 15) {
								start1111 = -11;

								while (start1111 <= -8) {

									Location middle = locationofblock
											.getBlock().getLocation();

									Block wool = middle.add(start2111, 0,
											start1111).getBlock();
									wool.setData((byte) 14);

									start1111++;
								}

								start2111++;
							}

						}

						if (time == 85) {

							int blockx = plugin.getArenasConfig().getInt(
									"CenterBlock.X");
							int blocky = plugin.getArenasConfig().getInt(
									"CenterBlock.Y");
							int blockz = plugin.getArenasConfig().getInt(
									"CenterBlock.Z");

							String blockw = plugin.getArenasConfig().getString(
									"World");

							Location locationofblock = Bukkit.getWorld(blockw)
									.getBlockAt(blockx, blocky, blockz)
									.getLocation();

							int start1111 = -6;
							while (start1111 <= 6) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(start1111, 0, 0)
										.getBlock();
								wool.setData((byte) 5);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(0, 0, start1111)
										.getBlock();
								wool1.setData((byte) 5);

								start1111++;
							}

							int repeate = 1;
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-1, 0, 4).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(1, 0, 4).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-1, 0, -4).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(1, 0, -4).getBlock();
								wool.setData((byte) 5);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(4, 0, -1).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(4, 0, 1).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-4, 0, -1).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-4, 0, 1).getBlock();
								wool.setData((byte) 5);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(2, 0, 2).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-2, 0, 2).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(2, 0, -2).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-2, 0, -2).getBlock();
								wool.setData((byte) 5);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(3, 0, 3).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-3, 0, 3).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(3, 0, -3).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-3, 0, -3).getBlock();
								wool.setData((byte) 5);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(5, 0, 5).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-5, 0, 5).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(5, 0, -5).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-5, 0, -5).getBlock();
								wool.setData((byte) 5);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(3, 0, 4).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(4, 0, 3).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-3, 0, 4).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-4, 0, 3).getBlock();
								wool.setData((byte) 5);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-3, 0, -4).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-4, 0, -3).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(3, 0, -4).getBlock();
								wool.setData((byte) 5);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(4, 0, -3).getBlock();
								wool.setData((byte) 5);
							}

							int start201 = 2;
							while (start201 <= 6) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(6, 0, start201)
										.getBlock();
								wool.setData((byte) 5);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(-6, 0, start201)
										.getBlock();
								wool1.setData((byte) 5);

								start201++;
							}
							int start2011 = -6;
							while (start2011 <= -2) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(6, 0, start2011)
										.getBlock();
								wool.setData((byte) 5);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(-6, 0, start2011)
										.getBlock();
								wool1.setData((byte) 5);

								start2011++;
							}

							int start202 = 2;
							while (start202 <= 5) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(start202, 0, 6)
										.getBlock();
								wool.setData((byte) 5);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(start202, 0, -6)
										.getBlock();
								wool1.setData((byte) 5);

								start202++;
							}
							int start2021 = -5;
							while (start2021 <= -2) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(start2021, 0, 6)
										.getBlock();
								wool.setData((byte) 5);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(start2021, 0, -6)
										.getBlock();
								wool1.setData((byte) 5);

								start2021++;
							}
						}

						if (time == 84) {

							int blockx = plugin.getArenasConfig().getInt(
									"CenterBlock.X");
							int blocky = plugin.getArenasConfig().getInt(
									"CenterBlock.Y");
							int blockz = plugin.getArenasConfig().getInt(
									"CenterBlock.Z");

							String blockw = plugin.getArenasConfig().getString(
									"World");

							Location locationofblock = Bukkit.getWorld(blockw)
									.getBlockAt(blockx, blocky, blockz)
									.getLocation();

							int start1111 = -6;
							while (start1111 <= 6) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(start1111, 0, 0)
										.getBlock();
								wool.setData((byte) 1);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(0, 0, start1111)
										.getBlock();
								wool1.setData((byte) 1);

								start1111++;
							}

							int repeate = 1;
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-1, 0, 4).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(1, 0, 4).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-1, 0, -4).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(1, 0, -4).getBlock();
								wool.setData((byte) 1);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(4, 0, -1).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(4, 0, 1).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-4, 0, -1).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-4, 0, 1).getBlock();
								wool.setData((byte) 1);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(2, 0, 2).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-2, 0, 2).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(2, 0, -2).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-2, 0, -2).getBlock();
								wool.setData((byte) 1);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(3, 0, 3).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-3, 0, 3).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(3, 0, -3).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-3, 0, -3).getBlock();
								wool.setData((byte) 1);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(5, 0, 5).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-5, 0, 5).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(5, 0, -5).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-5, 0, -5).getBlock();
								wool.setData((byte) 1);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(3, 0, 4).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(4, 0, 3).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-3, 0, 4).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-4, 0, 3).getBlock();
								wool.setData((byte) 1);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-3, 0, -4).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-4, 0, -3).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(3, 0, -4).getBlock();
								wool.setData((byte) 1);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(4, 0, -3).getBlock();
								wool.setData((byte) 1);
							}

							int start201 = 2;
							while (start201 <= 6) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(6, 0, start201)
										.getBlock();
								wool.setData((byte) 1);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(-6, 0, start201)
										.getBlock();
								wool1.setData((byte) 1);

								start201++;
							}
							int start2011 = -6;
							while (start2011 <= -2) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(6, 0, start2011)
										.getBlock();
								wool.setData((byte) 1);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(-6, 0, start2011)
										.getBlock();
								wool1.setData((byte) 1);

								start2011++;
							}

							int start202 = 2;
							while (start202 <= 5) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(start202, 0, 6)
										.getBlock();
								wool.setData((byte) 1);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(start202, 0, -6)
										.getBlock();
								wool1.setData((byte) 1);

								start202++;
							}
							int start2021 = -5;
							while (start2021 <= -2) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(start2021, 0, 6)
										.getBlock();
								wool.setData((byte) 1);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(start2021, 0, -6)
										.getBlock();
								wool1.setData((byte) 1);

								start2021++;
							}
						}

						if (time == 82) {

							int blockx = plugin.getArenasConfig().getInt(
									"CenterBlock.X");
							int blocky = plugin.getArenasConfig().getInt(
									"CenterBlock.Y");
							int blockz = plugin.getArenasConfig().getInt(
									"CenterBlock.Z");

							String blockw = plugin.getArenasConfig().getString(
									"World");

							Location locationofblock = Bukkit.getWorld(blockw)
									.getBlockAt(blockx, blocky, blockz)
									.getLocation();

							int start1111 = -6;
							while (start1111 <= 6) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(start1111, 0, 0)
										.getBlock();
								wool.setData((byte) 14);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(0, 0, start1111)
										.getBlock();
								wool1.setData((byte) 14);

								start1111++;
							}

							int repeate = 1;
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-1, 0, 4).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(1, 0, 4).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-1, 0, -4).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(1, 0, -4).getBlock();
								wool.setData((byte) 14);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(4, 0, -1).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(4, 0, 1).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-4, 0, -1).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-4, 0, 1).getBlock();
								wool.setData((byte) 14);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(2, 0, 2).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-2, 0, 2).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(2, 0, -2).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-2, 0, -2).getBlock();
								wool.setData((byte) 14);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(3, 0, 3).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-3, 0, 3).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(3, 0, -3).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-3, 0, -3).getBlock();
								wool.setData((byte) 14);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(5, 0, 5).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-5, 0, 5).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(5, 0, -5).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-5, 0, -5).getBlock();
								wool.setData((byte) 14);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(3, 0, 4).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(4, 0, 3).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-3, 0, 4).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-4, 0, 3).getBlock();
								wool.setData((byte) 14);
							}
							//
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-3, 0, -4).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(-4, 0, -3).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(3, 0, -4).getBlock();
								wool.setData((byte) 14);
							}
							if (repeate == 1) {
								Location middle = locationofblock.getBlock()
										.getLocation();
								Block wool = middle.add(4, 0, -3).getBlock();
								wool.setData((byte) 14);
							}

							int start201 = 2;
							while (start201 <= 6) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(6, 0, start201)
										.getBlock();
								wool.setData((byte) 14);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(-6, 0, start201)
										.getBlock();
								wool1.setData((byte) 14);

								start201++;
							}
							int start2011 = -6;
							while (start2011 <= -2) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(6, 0, start2011)
										.getBlock();
								wool.setData((byte) 14);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(-6, 0, start2011)
										.getBlock();
								wool1.setData((byte) 14);

								start2011++;
							}

							int start202 = 2;
							while (start202 <= 5) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(start202, 0, 6)
										.getBlock();
								wool.setData((byte) 14);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(start202, 0, -6)
										.getBlock();
								wool1.setData((byte) 14);

								start202++;
							}
							int start2021 = -5;
							while (start2021 <= -2) {

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(start2021, 0, 6)
										.getBlock();
								wool.setData((byte) 14);

								Location middle1 = locationofblock.getBlock()
										.getLocation();

								Block wool1 = middle1.add(start2021, 0, -6)
										.getBlock();
								wool1.setData((byte) 14);

								start2021++;
							}
						}

						if (time <= 75 && time > 0) {

							if (time == 75) {

								int blockx = plugin.getArenasConfig().getInt(
										"CenterBlock.X");
								int blocky = plugin.getArenasConfig().getInt(
										"CenterBlock.Y");
								int blockz = plugin.getArenasConfig().getInt(
										"CenterBlock.Z");

								String blockw = plugin.getArenasConfig()
										.getString("World");

								Location locationofblock = Bukkit
										.getWorld(blockw)
										.getBlockAt(blockx, blocky, blockz)
										.getLocation();

								Location middle = locationofblock.getBlock()
										.getLocation();

								Block wool = middle.add(0, 0, -7).getBlock();
								wool.setData((byte) 14);

								lastlocation = wool.getLocation();

								int START = 1;
								int END = 2;
								Random random = new Random();
								long range = (long) END - (long) START + 1;
								// compute a fraction of the range, 0 <= frac <
								// range
								long fraction = (long) (range * random
										.nextDouble());
								final int randomNumber = (int) (fraction + START);

								if (randomNumber == 1)
									direction = "dir2";

								if (randomNumber == 2)
									direction = "dir4";

							} else {
								String directionitsgoingin = direction;
								Location currentlocation = lastlocation;
								
								currentlocation.getBlock().setData(
										(byte) 0);
								
								if (directionitsgoingin
										.equalsIgnoreCase("dir1")) {

									boolean d1 = false;
									boolean d2 = false;
									//boolean d3 = false;
									boolean d4 = false;

									Block direction1block = currentlocation
											.add(0, 0, 1).getBlock();
									if (direction1block.getData() == 0) {
										d1 = true;
									}
									Block direction2block = currentlocation
											.add(1, 0, 0).getBlock();
									if (direction2block.getData() == 0) {
										d2 = true;
									}
									Block direction3block = currentlocation
											.add(0, 0, -1).getBlock();
									//if (direction3block.getData() == 0) {
									//	d3 = true;
									//}
									Block direction4block = currentlocation
											.add(-1, 0, 0).getBlock();
									if (direction4block.getData() == 0) {
										d4 = true;
									}

									if ((d1 == true) && (d2 == false)
											&& (d4 == false)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction1block.setData((byte) 14);
										lastlocation = direction1block
												.getLocation();
										direction = "dir1";
									}
									if ((d1 == false) && (d2 == true)
											&& (d4 == false)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction2block.setData((byte) 14);
										lastlocation = direction2block
												.getLocation();
										direction = "dir2";
									}
									if ((d1 == false) && (d2 == false)
											&& (d4 == true)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction4block.setData((byte) 14);
										lastlocation = direction4block
												.getLocation();
										direction = "dir4";
									}
									if ((d4 == false) && (d1 == false)
											&& (d2 == false)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction3block.setData((byte) 14);
										lastlocation = direction3block
												.getLocation();
										direction = "dir3";
									}

									if ((d1 == true) && (d2 == true)
											&& (d4 == false)) {
										int START = 1;
										int END = 2;
										Random random = new Random();
										long range = (long) END - (long) START
												+ 1;
										// compute a fraction of the range, 0 <=
										// frac <
										// range
										long fraction = (long) (range * random
												.nextDouble());
										final int randomNumber = (int) (fraction + START);
										
										
										if (randomNumber == 1) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction1block.setData((byte) 14);
										lastlocation = direction1block
												.getLocation();
										direction = "dir1";
										}

										if (randomNumber == 2) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction2block.setData((byte) 14);
										lastlocation = direction2block
												.getLocation();
										direction = "dir2";
										}
									}

									if ((d1 == true) && (d2 == false)
											&& (d4 == true)) {
										int START = 1;
										int END = 2;
										Random random = new Random();
										long range = (long) END - (long) START
												+ 1;
										// compute a fraction of the range, 0 <=
										// frac <
										// range
										long fraction = (long) (range * random
												.nextDouble());
										final int randomNumber = (int) (fraction + START);
										
										if (randomNumber == 1) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction1block.setData((byte) 14);
										lastlocation = direction1block
												.getLocation();
										direction = "dir1";
										}

										if (randomNumber == 2) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction1block.setData((byte) 14);
										lastlocation = direction1block
												.getLocation();
										direction = "dir1";
										}
									}
									if ((d1 == false) && (d2 == true)
											&& (d4 == true)) {
										int START = 1;
										int END = 2;
										Random random = new Random();
										long range = (long) END - (long) START
												+ 1;
										// compute a fraction of the range, 0 <=
										// frac <
										// range
										long fraction = (long) (range * random
												.nextDouble());
										final int randomNumber = (int) (fraction + START);
										
										if (randomNumber == 1) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction2block.setData((byte) 14);
										lastlocation = direction2block
												.getLocation();
										direction = "dir2";
										}

										if (randomNumber == 2) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction4block.setData((byte) 14);
										lastlocation = direction4block
												.getLocation();
										direction = "dir4";
										}
									}
								}

								if (directionitsgoingin
										.equalsIgnoreCase("dir2")) {

									boolean d1 = false;
									boolean d2 = false;
									boolean d3 = false;
									//boolean d4 = false;

									Block direction1block = currentlocation
											.add(0, 0, 1).getBlock();
									if (direction1block.getData() == 0) {
										d1 = true;
									}
									Block direction2block = currentlocation
											.add(1, 0, 0).getBlock();
									if (direction2block.getData() == 0) {
										d2 = true;
									}
									Block direction3block = currentlocation
											.add(0, 0, -1).getBlock();
									if (direction3block.getData() == 0) {
										d3 = true;
									}
									Block direction4block = currentlocation
											.add(-1, 0, 0).getBlock();
									//if (direction4block.getData() == 0) {
									//	d4 = true;
									//}

									if ((d2 == true) && (d3 == false)
											&& (d1 == false)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction2block.setData((byte) 14);
										lastlocation = direction2block
												.getLocation();
										direction = "dir2";
									}
									if ((d2 == false) && (d3 == true)
											&& (d1 == false)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction3block.setData((byte) 14);
										lastlocation = direction3block
												.getLocation();
										direction = "dir3";
									}
									if ((d2 == false) && (d3 == false)
											&& (d1 == true)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction1block.setData((byte) 14);
										lastlocation = direction1block
												.getLocation();
										direction = "dir1";
									}
									if ((d2 == false) && (d3 == false)
											&& (d1 == false)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction4block.setData((byte) 14);
										lastlocation = direction4block
												.getLocation();
										direction = "dir4";
									}

									if ((d2 == true) && (d3 == true)
											&& (d1 == false)) {
										int START = 1;
										int END = 2;
										Random random = new Random();
										long range = (long) END - (long) START
												+ 1;
										// compute a fraction of the range, 0 <=
										// frac <
										// range
										long fraction = (long) (range * random
												.nextDouble());
										final int randomNumber = (int) (fraction + START);
										
										if (randomNumber == 1) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction2block.setData((byte) 14);
										lastlocation = direction2block
												.getLocation();
										direction = "dir2";
										}

										if (randomNumber == 2) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction3block.setData((byte) 14);
										lastlocation = direction3block
												.getLocation();
										direction = "dir3";
										}
									}

									if ((d2 == true) && (d3 == false)
											&& (d1 == true)) {
										int START = 1;
										int END = 2;
										Random random = new Random();
										long range = (long) END - (long) START
												+ 1;
										// compute a fraction of the range, 0 <=
										// frac <
										// range
										long fraction = (long) (range * random
												.nextDouble());
										final int randomNumber = (int) (fraction + START);
										
										if (randomNumber == 1) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction2block.setData((byte) 14);
										lastlocation = direction2block
												.getLocation();
										direction = "dir2";
										}

										if (randomNumber == 2) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction1block.setData((byte) 14);
										lastlocation = direction1block
												.getLocation();
										direction = "dir1";
										}
									}
									if ((d2 == false) && (d3 == true)
											&& (d1 == true)) {
										int START = 1;
										int END = 2;
										Random random = new Random();
										long range = (long) END - (long) START
												+ 1;
										// compute a fraction of the range, 0 <=
										// frac <
										// range
										long fraction = (long) (range * random
												.nextDouble());
										final int randomNumber = (int) (fraction + START);
										
										if (randomNumber == 1) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction1block.setData((byte) 14);
										lastlocation = direction1block
												.getLocation();
										direction = "dir1";
										}

										if (randomNumber == 2) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction3block.setData((byte) 14);
										lastlocation = direction3block
												.getLocation();
										direction = "dir3";
										}
									}
								}
								if (directionitsgoingin
										.equalsIgnoreCase("dir3")) {

									//boolean d1 = false;
									boolean d2 = false;
									boolean d3 = false;
									boolean d4 = false;

									Block direction1block = currentlocation
											.add(0, 0, 1).getBlock();
									//if (direction1block.getData() == 0) {
									//	d1 = true;
									//}
									Block direction2block = currentlocation
											.add(1, 0, 0).getBlock();
									if (direction2block.getData() == 0) {
										d2 = true;
									}
									Block direction3block = currentlocation
											.add(0, 0, -1).getBlock();
									if (direction3block.getData() == 0) {
										d3 = true;
									}
									Block direction4block = currentlocation
											.add(-1, 0, 0).getBlock();
									if (direction4block.getData() == 0) {
										d4 = true;
									}

									if ((d3 == true) && (d4 == false)
											&& (d2 == false)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction3block.setData((byte) 14);
										lastlocation = direction3block
												.getLocation();
										direction = "dir3";
									}
									if ((d3 == false) && (d4 == true)
											&& (d2 == false)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction4block.setData((byte) 14);
										lastlocation = direction4block
												.getLocation();
										direction = "dir4";
									}
									if ((d3 == false) && (d4 == false)
											&& (d2 == true)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction2block.setData((byte) 14);
										lastlocation = direction2block
												.getLocation();
										direction = "dir2";
									}
									if ((d3 == false) && (d4 == false)
											&& (d2 == false)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction1block.setData((byte) 14);
										lastlocation = direction1block
												.getLocation();
										direction = "dir1";
									}

									if ((d3 == true) && (d2 == true)
											&& (d4 == false)) {
										int START = 1;
										int END = 2;
										Random random = new Random();
										long range = (long) END - (long) START
												+ 1;
										// compute a fraction of the range, 0 <=
										// frac <
										// range
										long fraction = (long) (range * random
												.nextDouble());
										final int randomNumber = (int) (fraction + START);
										
										if (randomNumber == 1) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction3block.setData((byte) 14);
										lastlocation = direction3block
												.getLocation();
										direction = "dir3";
										}

										if (randomNumber == 2) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction2block.setData((byte) 14);
										lastlocation = direction2block
												.getLocation();
										direction = "dir2";
										}
									}

									if ((d3 == true) && (d2 == false)
											&& (d4 == true)) {
										int START = 1;
										int END = 2;
										Random random = new Random();
										long range = (long) END - (long) START
												+ 1;
										// compute a fraction of the range, 0 <=
										// frac <
										// range
										long fraction = (long) (range * random
												.nextDouble());
										final int randomNumber = (int) (fraction + START);
										
										if (randomNumber == 1) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction3block.setData((byte) 14);
										lastlocation = direction3block
												.getLocation();
										direction = "dir3";
										}

										if (randomNumber == 2) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction4block.setData((byte) 14);
										lastlocation = direction4block
												.getLocation();
										direction = "dir4";
										}
									}
									if ((d3 == false) && (d2 == true)
											&& (d4 == true)) {
										int START = 1;
										int END = 2;
										Random random = new Random();
										long range = (long) END - (long) START
												+ 1;
										// compute a fraction of the range, 0 <=
										// frac <
										// range
										long fraction = (long) (range * random
												.nextDouble());
										final int randomNumber = (int) (fraction + START);
										
										if (randomNumber == 1) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction1block.setData((byte) 14);
										lastlocation = direction1block
												.getLocation();
										direction = "dir1";
										}

										if (randomNumber == 2) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction4block.setData((byte) 14);
										lastlocation = direction4block
												.getLocation();
										direction = "dir4";
										}
									}
								}
								if (directionitsgoingin
										.equalsIgnoreCase("dir4")) {

									boolean d1 = false;
									//boolean d2 = false;
									boolean d3 = false;
									boolean d4 = false;

									Block direction1block = currentlocation
											.add(0, 0, 1).getBlock();
									if (direction1block.getData() == 0) {
										d1 = true;
									}
									Block direction2block = currentlocation
											.add(1, 0, 0).getBlock();
									//if (direction2block.getData() == 0) {
									//	d2 = true;
									//}
									Block direction3block = currentlocation
											.add(0, 0, -1).getBlock();
									if (direction3block.getData() == 0) {
										d3 = true;
									}
									Block direction4block = currentlocation
											.add(-1, 0, 0).getBlock();
									if (direction4block.getData() == 0) {
										d4 = true;
									}

									if ((d4 == true) && (d1 == false)
											&& (d3 == false)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction4block.setData((byte) 14);
										lastlocation = direction4block
												.getLocation();
										direction = "dir4";
									}
									if ((d4 == false) && (d1 == true)
											&& (d3 == false)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction1block.setData((byte) 14);
										lastlocation = direction1block
												.getLocation();
										direction = "dir1";
									}
									if ((d4 == false) && (d1 == false)
											&& (d3 == true)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction3block.setData((byte) 14);
										lastlocation = direction3block
												.getLocation();
										direction = "dir3";
									}
									if ((d4 == false) && (d1 == false)
											&& (d3 == false)) {
										currentlocation.getBlock().setData(
												(byte) 0);
										direction2block.setData((byte) 14);
										lastlocation = direction2block
												.getLocation();
										direction = "dir2";
									}

									if ((d4 == true) && (d1 == true)
											&& (d3 == false)) {
										int START = 1;
										int END = 2;
										Random random = new Random();
										long range = (long) END - (long) START
												+ 1;
										// compute a fraction of the range, 0 <=
										// frac <
										// range
										long fraction = (long) (range * random
												.nextDouble());
										final int randomNumber = (int) (fraction + START);
										
										if (randomNumber == 1) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction4block.setData((byte) 14);
										lastlocation = direction4block
												.getLocation();
										direction = "dir4";
										}

										if (randomNumber == 2) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction1block.setData((byte) 14);
										lastlocation = direction1block
												.getLocation();
										direction = "dir1";
										}
									}

									if ((d4 == true) && (d1 == false)
											&& (d3 == true)) {
										int START = 1;
										int END = 2;
										Random random = new Random();
										long range = (long) END - (long) START
												+ 1;
										// compute a fraction of the range, 0 <=
										// frac <
										// range
										long fraction = (long) (range * random
												.nextDouble());
										final int randomNumber = (int) (fraction + START);
										
										if (randomNumber == 1) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction4block.setData((byte) 14);
										lastlocation = direction4block
												.getLocation();
										direction = "dir4";
										}

										if (randomNumber == 2) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction3block.setData((byte) 14);
										lastlocation = direction3block
												.getLocation();
										direction = "dir3";
										}
									}
									if ((d4 == false) && (d1 == true)
											&& (d3 == true)) {
										int START = 1;
										int END = 2;
										Random random = new Random();
										long range = (long) END - (long) START
												+ 1;
										// compute a fraction of the range, 0 <=
										// frac <
										// range
										long fraction = (long) (range * random
												.nextDouble());
										final int randomNumber = (int) (fraction + START);
										
										if (randomNumber == 1) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction1block.setData((byte) 14);
										lastlocation = direction1block
												.getLocation();
										direction = "dir1";
										}

										if (randomNumber == 2) {
											currentlocation.getBlock().setData(
													(byte) 0);
										direction3block.setData((byte) 14);
										lastlocation = direction3block
												.getLocation();
										direction = "dir3";
										}
									}
								}
							}

						}

						if (time == 0) {
							stopexample1(plugin);
						}
						time--;
						if (time < -10) {
							time = 0;
						}
						if (Rounds.stop.equals("ForceStop")) {
							stopexample2(plugin);
						}
						if (Rounds.alldead == true) {
							stopexample3(plugin);
						}

					}

				}, 10L, 10L);

	}
	
	
			
	public static void stopexample1(final Rounds plugin) {
		plugin.getServer().getScheduler().cancelTask(example1);
		Bukkit.getScheduler().cancelTask(example1);
		time = 95;
		plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {

		    public void run() {
		    	
				int howmanyplayers = plugin.getDataConfig().getStringList("PlayersPlaying").size();
				int togo = 0;
				int currentround = plugin.getDataConfig().getInt("Rounds.CurrentLevel");
				while (howmanyplayers > togo) {
					String playername = plugin.getDataConfig().getStringList("PlayersPlaying").get(togo);
					Player player = Bukkit.getPlayer(playername);
					
					if (!player.equals(null)) {
						if (player.isOnline()) {
						int newround = currentround + 1;
						player.sendMessage(ChatColor.GOLD + "Weldone at completeing Round " + ChatColor.DARK_PURPLE + currentround +  ChatColor.GOLD + ", get ready for round " + ChatColor.DARK_PURPLE + newround);
					
						int howmanytodo = 0;
						int howmanydone = 0;
						
						while (howmanydone < howmanytodo) {
						int START = -7;
						int END = 7;
						Random random = new Random();
						long range = (long) END - (long) START + 1;
						// compute a fraction of the range, 0 <= frac < range
						long fraction = (long) (range * random.nextDouble());
						final int randomx = (int) (fraction + START);
						
						int START1 = -5;
						int END1 = 5;
						Random random1 = new Random();
						long range1 = (long) END1 - (long) START1 + 1;
						// compute a fraction of the range, 0 <= frac < range
						long fraction1 = (long) (range1 * random1.nextDouble());
						final int randomz = (int) (fraction1 + START1);
						
						final int centerx = plugin.getArenasConfig().getInt("CenterBlock.X") + randomx;
						final int centery = plugin.getArenasConfig().getInt("CenterBlock.Y");
						final int centerz = plugin.getArenasConfig().getInt("CenterBlock.Z") + randomz;
					
						final String world = plugin.getArenasConfig().getString("World");
						
						Block block1 = Bukkit.getWorld(world)
								.getBlockAt(centerx, centery,
										centerz);
						block1.setData((byte) 6);
						howmanydone++;
						}
						
						}
						}
					togo++;
				}
				
				//
				
				

		    	
		    }
		}, 115L);
		
		plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {

		    public void run() {
		    	
				int howmanyplayers = plugin.getDataConfig().getStringList("PlayersPlaying").size();
				int togo = 0;
				//int currentround = plugin.getDataConfig().getInt("Rounds.CurrentLevel");
		    	
				while (howmanyplayers > togo) {
					
					String playername = plugin.getDataConfig().getStringList("PlayersPlaying").get(togo);
					Player player = Bukkit.getPlayer(playername);
					
					if (!player.equals(null)) {
						if (player.isOnline()) {
						//int newround = currentround + 1;
						player.sendMessage(ChatColor.AQUA + "------------" + ChatColor.GOLD + " [" + ChatColor.LIGHT_PURPLE + " Rounds " + ChatColor.GOLD + "] " + ChatColor.AQUA + "----------");
						}
						}
					togo++;
				}
				
				int currentround = plugin.getDataConfig().getInt("Rounds.CurrentLevel");
				int newround = currentround + 1;
				PickRounds.PickRound(plugin, newround);
				
		    }
		    	
		}, 200L);
		
		
	}
	public static void stopexample3(Rounds plugin) {
		plugin.getServer().getScheduler().cancelTask(example1);
		Bukkit.getScheduler().cancelTask(example1);
		time = 60;
		GetBlockUnderneath.running = false;
		Rounds.stop = "Run";
		GetBlockUnderneath.running = false;
		
		//
		
		int howmanyplayers = plugin.getDataConfig().getStringList("PlayersPlaying").size();
		int togo = 0;
		int currentround = plugin.getDataConfig().getInt("Rounds.CurrentLevel");
		
		while (howmanyplayers > togo) {
			String playername = plugin.getDataConfig().getStringList("PlayersPlaying").get(togo);
			Player player = Bukkit.getPlayer(playername);
			
			if (!player.equals(null)) {
				if (player.isOnline()) {
				player.sendMessage(ChatColor.GOLD + "All players are dead! Got to round " + ChatColor.DARK_PURPLE + currentround);
			}
			}
			togo++;
		}
		
		//
		
		
		//
		
		List<String> playing = plugin.getDataConfig()
				.getStringList("PlayersPlaying");
		playing.clear();
		plugin.getDataConfig().set("PlayersPlaying", playing);
		
		
		Rounds.gamerunning.clear();
		Rounds.blockplayer.clear();
		
		plugin.saveDataConfig();
		
	}
	public static void stopexample2(Rounds plugin) {
		plugin.getServer().getScheduler().cancelTask(example1);
		Bukkit.getScheduler().cancelTask(example1);
		time = 60;
		Rounds.stop = "Run";
		GetBlockUnderneath.running = false;

		
		//check online for everything tommorow
		
	}

}
