Massive code clean up/refactor + Compile with 1.7.9 API + Fix scoreboard (I hope). This still update not good enough, since the main task loop still updates signs/scoreboards every second. This needs to be fixed so do not use this build.
This commit is contained in:
		
							
								
								
									
										4
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								pom.xml
									
									
									
									
									
								
							@@ -38,14 +38,14 @@
 | 
				
			|||||||
    <dependency>
 | 
					    <dependency>
 | 
				
			||||||
      <groupId>org.bukkit</groupId>
 | 
					      <groupId>org.bukkit</groupId>
 | 
				
			||||||
      <artifactId>bukkit</artifactId>
 | 
					      <artifactId>bukkit</artifactId>
 | 
				
			||||||
      <version>1.6.4-R0.1-SNAPSHOT</version>
 | 
					      <version>1.7.9-R0.1-SNAPSHOT</version>
 | 
				
			||||||
    </dependency>
 | 
					    </dependency>
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    <!-- CraftBukkit Dependency for experimental features
 | 
					    <!-- CraftBukkit Dependency for experimental features
 | 
				
			||||||
    <dependency>
 | 
					    <dependency>
 | 
				
			||||||
      <groupId>org.bukkit</groupId>
 | 
					      <groupId>org.bukkit</groupId>
 | 
				
			||||||
      <artifactId>craftbukkit</artifactId>
 | 
					      <artifactId>craftbukkit</artifactId>
 | 
				
			||||||
      <version>1.6.2-R0.1-SNAPSHOT</version>
 | 
					      <version>1.7.9-R0.1-SNAPSHOT</version>
 | 
				
			||||||
    </dependency>-->        
 | 
					    </dependency>-->        
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    <!-- LibsDiguises is required for hiding -->
 | 
					    <!-- LibsDiguises is required for hiding -->
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,18 +45,11 @@ public class Arena implements ConfigurationSerializable {
 | 
				
			|||||||
	public List<Player> seekers;
 | 
						public List<Player> seekers;
 | 
				
			||||||
	public Scoreboard scoreboard;
 | 
						public Scoreboard scoreboard;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public Arena (String arenaName, LocationSerializable pos1,
 | 
						public Arena(String arenaName, LocationSerializable pos1, LocationSerializable pos2, int maxPlayers, int minPlayers, int amountSeekersOnStart,
 | 
				
			||||||
			LocationSerializable pos2, int maxPlayers, int minPlayers,
 | 
								int timeInLobbyUntilStart, int waitingTimeSeeker, int gameTime, int timeUntilHidersSword, ArrayList<ItemStack> disguiseBlocks,
 | 
				
			||||||
			int amountSeekersOnStart, int timeInLobbyUntilStart,
 | 
								LocationSerializable lobbyWarp, LocationSerializable hidersWarp, LocationSerializable seekersWarp, LocationSerializable spawnWarp,
 | 
				
			||||||
			int waitingTimeSeeker, int gameTime, int timeUntilHidersSword,
 | 
								List<String> seekersWinCommands, List<String> hidersWinCommands, List<String> allowedCommands, int seekersTokenWin, int hidersTokenWin, int killTokens,
 | 
				
			||||||
			ArrayList<ItemStack> disguiseBlocks,
 | 
								List<Player> playersInArena, ArenaState gameState, int timer, List<Player> seekers, Scoreboard scoreboard) {
 | 
				
			||||||
			LocationSerializable lobbyWarp, LocationSerializable hidersWarp,
 | 
					 | 
				
			||||||
			LocationSerializable seekersWarp, LocationSerializable spawnWarp,
 | 
					 | 
				
			||||||
			List<String> seekersWinCommands, List<String> hidersWinCommands,
 | 
					 | 
				
			||||||
			List<String> allowedCommands, int seekersTokenWin,
 | 
					 | 
				
			||||||
			int hidersTokenWin, int killTokens, List<Player> playersInArena,
 | 
					 | 
				
			||||||
			ArenaState gameState, int timer, List<Player> seekers,
 | 
					 | 
				
			||||||
			Scoreboard scoreboard) {
 | 
					 | 
				
			||||||
		this.arenaName = arenaName;
 | 
							this.arenaName = arenaName;
 | 
				
			||||||
		this.pos1 = pos1;
 | 
							this.pos1 = pos1;
 | 
				
			||||||
		this.pos2 = pos2;
 | 
							this.pos2 = pos2;
 | 
				
			||||||
@@ -100,7 +93,11 @@ public class Arena implements ConfigurationSerializable {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public enum ArenaState {
 | 
						public enum ArenaState {
 | 
				
			||||||
		WAITING, STARTING, INGAME, RESTARTING, DISABLED;
 | 
							WAITING,
 | 
				
			||||||
 | 
							STARTING,
 | 
				
			||||||
 | 
							INGAME,
 | 
				
			||||||
 | 
							RESTARTING,
 | 
				
			||||||
 | 
							DISABLED;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
@@ -132,33 +129,15 @@ public class Arena implements ConfigurationSerializable {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	@SuppressWarnings("unchecked")
 | 
						@SuppressWarnings("unchecked")
 | 
				
			||||||
	public static Arena deserialize(Map<String, Object> map) {
 | 
						public static Arena deserialize(Map<String, Object> map) {
 | 
				
			||||||
		LocationSerializable loc = new LocationSerializable(
 | 
							LocationSerializable loc = new LocationSerializable(Bukkit.getWorld("world"), 0, 0, 0, 0, 0);
 | 
				
			||||||
				Bukkit.getWorld("world"), 0, 0, 0, 0, 0);
 | 
							return new Arena((String) M.g(map, "arenaName", "UNKNOWN_NAME"), (LocationSerializable) M.g(map, "pos1", loc), (LocationSerializable) M.g(map, "pos2", loc),
 | 
				
			||||||
		return new Arena((String) M.g(map, "arenaName", "UNKNOWN_NAME"),
 | 
									(Integer) M.g(map, "maxPlayers", 12), (Integer) M.g(map, "minPlayers", 3), (Integer) M.g(map, "amountSeekersOnStart", 1), (Integer) M.g(map,
 | 
				
			||||||
				(LocationSerializable) M.g(map, "pos1", loc),
 | 
											"timeInLobbyUntilStart", 90), (Integer) M.g(map, "waitingTimeSeeker", 20), (Integer) M.g(map, "gameTime", 200), (Integer) M.g(map,
 | 
				
			||||||
				(LocationSerializable) M.g(map, "pos2", loc), (Integer) M.g(
 | 
											"timeUntilHidersSword", 30), (ArrayList<ItemStack>) M.g(map, "disguiseBlocks", new ArrayList<ItemStack>()), (LocationSerializable) M.g(map,
 | 
				
			||||||
						map, "maxPlayers", 12), (Integer) M.g(map,
 | 
											"lobbyWarp", loc), (LocationSerializable) M.g(map, "hidersWarp", loc), (LocationSerializable) M.g(map, "seekersWarp", loc),
 | 
				
			||||||
						"minPlayers", 3), (Integer) M.g(map,
 | 
									(LocationSerializable) M.g(map, "spawnWarp", loc), (ArrayList<String>) M.g(map, "seekersWinCommands", new ArrayList<String>()), (ArrayList<String>) M.g(
 | 
				
			||||||
						"amountSeekersOnStart", 1), (Integer) M.g(map,
 | 
											map, "hidersWinCommands", new ArrayList<String>()), (ArrayList<String>) M.g(map, "allowedCommands", new ArrayList<String>()), (Integer) M.g(map,
 | 
				
			||||||
						"timeInLobbyUntilStart", 90), (Integer) M.g(map,
 | 
											"seekersTokenWin", 10), (Integer) M.g(map, "hidersTokenWin", 50), (Integer) M.g(map, "killTokens", 8), new ArrayList<Player>(),
 | 
				
			||||||
						"waitingTimeSeeker", 20), (Integer) M.g(map,
 | 
									ArenaState.WAITING, 0, new ArrayList<Player>(), Bukkit.getScoreboardManager().getNewScoreboard());
 | 
				
			||||||
						"gameTime", 200), (Integer) M.g(map,
 | 
					 | 
				
			||||||
						"timeUntilHidersSword", 30),
 | 
					 | 
				
			||||||
				(ArrayList<ItemStack>) M.g(map, "disguiseBlocks",
 | 
					 | 
				
			||||||
						new ArrayList<ItemStack>()),
 | 
					 | 
				
			||||||
				(LocationSerializable) M.g(map, "lobbyWarp", loc),
 | 
					 | 
				
			||||||
				(LocationSerializable) M.g(map, "hidersWarp", loc),
 | 
					 | 
				
			||||||
				(LocationSerializable) M.g(map, "seekersWarp", loc),
 | 
					 | 
				
			||||||
				(LocationSerializable) M.g(map, "spawnWarp", loc),
 | 
					 | 
				
			||||||
				(ArrayList<String>) M.g(map, "seekersWinCommands",
 | 
					 | 
				
			||||||
						new ArrayList<String>()), (ArrayList<String>) M.g(map,
 | 
					 | 
				
			||||||
						"hidersWinCommands", new ArrayList<String>()),
 | 
					 | 
				
			||||||
				(ArrayList<String>) M.g(map, "allowedCommands",
 | 
					 | 
				
			||||||
						new ArrayList<String>()), (Integer) M.g(map,
 | 
					 | 
				
			||||||
						"seekersTokenWin", 10), (Integer) M.g(map,
 | 
					 | 
				
			||||||
						"hidersTokenWin", 50), (Integer) M.g(map, "killTokens",
 | 
					 | 
				
			||||||
						8), new ArrayList<Player>(), ArenaState.WAITING, 0,
 | 
					 | 
				
			||||||
				new ArrayList<Player>(), Bukkit.getScoreboardManager()
 | 
					 | 
				
			||||||
						.getNewScoreboard());
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -40,11 +40,9 @@ public class ArenaHandler {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public static void sendFMessage(Arena arena, ConfigC location,
 | 
						public static void sendFMessage(Arena arena, ConfigC location, String... vars) {
 | 
				
			||||||
			String... vars) {
 | 
					 | 
				
			||||||
		for (Player player : arena.playersInArena) {
 | 
							for (Player player : arena.playersInArena) {
 | 
				
			||||||
			String pMessage = location.config.getFile().get(location.location)
 | 
								String pMessage = location.config.getFile().get(location.location).toString().replaceAll("%player%", player.getName());
 | 
				
			||||||
					.toString().replaceAll("%player%", player.getName());
 | 
					 | 
				
			||||||
			player.sendMessage(MessageM.replaceAll(pMessage, vars));
 | 
								player.sendMessage(MessageM.replaceAll(pMessage, vars));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -66,8 +64,7 @@ public class ArenaHandler {
 | 
				
			|||||||
				if (arena.arenaName.equalsIgnoreCase(arenaname)) {
 | 
									if (arena.arenaName.equalsIgnoreCase(arenaname)) {
 | 
				
			||||||
					found = true;
 | 
										found = true;
 | 
				
			||||||
					if (arena.disguiseBlocks.isEmpty()) {
 | 
										if (arena.disguiseBlocks.isEmpty()) {
 | 
				
			||||||
						MessageM.sendFMessage(player,
 | 
											MessageM.sendFMessage(player, ConfigC.error_joinNoBlocksSet);
 | 
				
			||||||
								ConfigC.error_joinNoBlocksSet);
 | 
					 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
						boolean inventoryempty = true;
 | 
											boolean inventoryempty = true;
 | 
				
			||||||
						for (ItemStack invitem : player.getInventory()) {
 | 
											for (ItemStack invitem : player.getInventory()) {
 | 
				
			||||||
@@ -78,62 +75,38 @@ public class ArenaHandler {
 | 
				
			|||||||
							}
 | 
												}
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						for (ItemStack invitem : player.getInventory()
 | 
											for (ItemStack invitem : player.getInventory().getArmorContents()) {
 | 
				
			||||||
								.getArmorContents()) {
 | 
					 | 
				
			||||||
							if (invitem.getType() != Material.AIR) {
 | 
												if (invitem.getType() != Material.AIR) {
 | 
				
			||||||
								inventoryempty = false;
 | 
													inventoryempty = false;
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						if ((Boolean) W.config
 | 
											if ((Boolean) W.config.get(ConfigC.requireInventoryClearOnJoin) && !inventoryempty) {
 | 
				
			||||||
								.get(ConfigC.requireInventoryClearOnJoin)
 | 
												MessageM.sendFMessage(player, ConfigC.error_joinInventoryNotEmpty);
 | 
				
			||||||
								&& !inventoryempty) {
 | 
					 | 
				
			||||||
							MessageM.sendFMessage(player,
 | 
					 | 
				
			||||||
									ConfigC.error_joinInventoryNotEmpty);
 | 
					 | 
				
			||||||
							return;
 | 
												return;
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						LocationSerializable zero = new LocationSerializable(
 | 
											LocationSerializable zero = new LocationSerializable(Bukkit.getWorld(player.getWorld().getName().toString()), 0, 0, 0, 0, 0);
 | 
				
			||||||
								Bukkit.getWorld(player.getWorld().getName()
 | 
											if (arena.lobbyWarp != null && arena.hidersWarp != null && arena.seekersWarp != null && arena.spawnWarp != null) {
 | 
				
			||||||
										.toString()), 0, 0, 0, 0, 0);
 | 
												if (!arena.lobbyWarp.equals(zero) && !arena.hidersWarp.equals(zero) && !arena.seekersWarp.equals(zero) && !arena.spawnWarp.equals(zero)) {
 | 
				
			||||||
						if (arena.lobbyWarp != null && arena.hidersWarp != null
 | 
													if (arena.gameState == ArenaState.WAITING || arena.gameState == ArenaState.STARTING) {
 | 
				
			||||||
								&& arena.seekersWarp != null
 | 
					 | 
				
			||||||
								&& arena.spawnWarp != null) {
 | 
					 | 
				
			||||||
							if (!arena.lobbyWarp.equals(zero)
 | 
					 | 
				
			||||||
									&& !arena.hidersWarp.equals(zero)
 | 
					 | 
				
			||||||
									&& !arena.seekersWarp.equals(zero)
 | 
					 | 
				
			||||||
									&& !arena.spawnWarp.equals(zero)) {
 | 
					 | 
				
			||||||
								if (arena.gameState == ArenaState.WAITING
 | 
					 | 
				
			||||||
										|| arena.gameState == ArenaState.STARTING) {
 | 
					 | 
				
			||||||
									if (arena.playersInArena.size() >= arena.maxPlayers) {
 | 
														if (arena.playersInArena.size() >= arena.maxPlayers) {
 | 
				
			||||||
										if (!PermissionsM.hasPerm(player,
 | 
															if (!PermissionsM.hasPerm(player, Permissions.joinfull, false)) {
 | 
				
			||||||
												Permissions.joinfull, false)) {
 | 
																MessageM.sendFMessage(player, ConfigC.error_joinFull);
 | 
				
			||||||
											MessageM.sendFMessage(player,
 | 
					 | 
				
			||||||
													ConfigC.error_joinFull);
 | 
					 | 
				
			||||||
											return;
 | 
																return;
 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
									arena.playersInArena.add(player);
 | 
														arena.playersInArena.add(player);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									PlayerArenaData pad = new PlayerArenaData(
 | 
														PlayerArenaData pad = new PlayerArenaData(player.getLocation(), player.getGameMode(), player.getInventory().getContents(), player
 | 
				
			||||||
											player.getLocation(),
 | 
																.getInventory().getArmorContents(), player.getExp(), player.getLevel(), player.getHealth(), player.getFoodLevel(),
 | 
				
			||||||
											player.getGameMode(), player
 | 
																player.getActivePotionEffects(), player.getAllowFlight());
 | 
				
			||||||
													.getInventory()
 | 
					 | 
				
			||||||
													.getContents(), player
 | 
					 | 
				
			||||||
													.getInventory()
 | 
					 | 
				
			||||||
													.getArmorContents(),
 | 
					 | 
				
			||||||
											player.getExp(), player.getLevel(),
 | 
					 | 
				
			||||||
											player.getHealth(),
 | 
					 | 
				
			||||||
											player.getFoodLevel(),
 | 
					 | 
				
			||||||
											player.getActivePotionEffects(),
 | 
					 | 
				
			||||||
											player.getAllowFlight());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
									W.pData.put(player, pad);
 | 
														W.pData.put(player, pad);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									player.teleport(arena.lobbyWarp);
 | 
														player.teleport(arena.lobbyWarp);
 | 
				
			||||||
									player.setGameMode(GameMode.SURVIVAL);
 | 
														player.setGameMode(GameMode.SURVIVAL);
 | 
				
			||||||
									for (PotionEffect pe : player
 | 
														for (PotionEffect pe : player.getActivePotionEffects()) {
 | 
				
			||||||
											.getActivePotionEffects()) {
 | 
					 | 
				
			||||||
										player.removePotionEffect(pe.getType());
 | 
															player.removePotionEffect(pe.getType());
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
									player.setFoodLevel(20);
 | 
														player.setFoodLevel(20);
 | 
				
			||||||
@@ -141,129 +114,88 @@ public class ArenaHandler {
 | 
				
			|||||||
									player.setLevel(arena.timer);
 | 
														player.setLevel(arena.timer);
 | 
				
			||||||
									player.setExp(0);
 | 
														player.setExp(0);
 | 
				
			||||||
									player.getInventory().clear();
 | 
														player.getInventory().clear();
 | 
				
			||||||
									player.getInventory().setHelmet(
 | 
														player.getInventory().setHelmet(new ItemStack(Material.AIR));
 | 
				
			||||||
											new ItemStack(Material.AIR));
 | 
														player.getInventory().setChestplate(new ItemStack(Material.AIR));
 | 
				
			||||||
									player.getInventory().setChestplate(
 | 
														player.getInventory().setLeggings(new ItemStack(Material.AIR));
 | 
				
			||||||
											new ItemStack(Material.AIR));
 | 
														player.getInventory().setBoots(new ItemStack(Material.AIR));
 | 
				
			||||||
									player.getInventory().setLeggings(
 | 
					 | 
				
			||||||
											new ItemStack(Material.AIR));
 | 
					 | 
				
			||||||
									player.getInventory().setBoots(
 | 
					 | 
				
			||||||
											new ItemStack(Material.AIR));
 | 
					 | 
				
			||||||
									player.setFlying(false);
 | 
														player.setFlying(false);
 | 
				
			||||||
									player.setAllowFlight(false);
 | 
														player.setAllowFlight(false);
 | 
				
			||||||
									player.setWalkSpeed(0.25F);
 | 
														player.setWalkSpeed(0.25F);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									// Fix for client not showing players after they join
 | 
														// Fix for client not showing players after
 | 
				
			||||||
 | 
														// they join
 | 
				
			||||||
									for (Player otherplayer : arena.playersInArena) {
 | 
														for (Player otherplayer : arena.playersInArena) {
 | 
				
			||||||
										if (otherplayer.canSee(player)) otherplayer.showPlayer(player);       // Make new player visible to others
 | 
															if (otherplayer.canSee(player))
 | 
				
			||||||
										if (player.canSee(otherplayer)) player.showPlayer(otherplayer);       // Make other players visible to new player
 | 
																otherplayer.showPlayer(player); // Make
 | 
				
			||||||
 | 
																								// new
 | 
				
			||||||
 | 
																								// player
 | 
				
			||||||
 | 
																								// visible
 | 
				
			||||||
 | 
																								// to
 | 
				
			||||||
 | 
																								// others
 | 
				
			||||||
 | 
															if (player.canSee(otherplayer))
 | 
				
			||||||
 | 
																player.showPlayer(otherplayer); // Make
 | 
				
			||||||
 | 
																								// other
 | 
				
			||||||
 | 
																								// players
 | 
				
			||||||
 | 
																								// visible
 | 
				
			||||||
 | 
																								// to
 | 
				
			||||||
 | 
																								// new
 | 
				
			||||||
 | 
																								// player
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									if ((Boolean) W.config
 | 
														if ((Boolean) W.config.get(ConfigC.shop_blockChooserv1Enabled) == true) {
 | 
				
			||||||
											.get(ConfigC.shop_blockChooserv1Enabled) == true) {
 | 
															if (W.shop.getFile().get(player.getName() + ".blockchooser") != null
 | 
				
			||||||
										if (W.shop.getFile().get(
 | 
																	|| PermissionsM.hasPerm(player, Permissions.shopblockchooser, false)) {
 | 
				
			||||||
												player.getName()
 | 
																ItemStack shopBlockChooser = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.shop_blockChooserv1IDname)), 1);
 | 
				
			||||||
														+ ".blockchooser") != null
 | 
																ItemMeta shopBlockChooser_IM = shopBlockChooser.getItemMeta();
 | 
				
			||||||
												|| PermissionsM
 | 
																shopBlockChooser_IM.setDisplayName(MessageM.replaceAll((String) W.config.get(ConfigC.shop_blockChooserv1Name)));
 | 
				
			||||||
														.hasPerm(
 | 
																List<String> lores = W.config.getFile().getStringList(ConfigC.shop_blockChooserv1Description.location);
 | 
				
			||||||
																player,
 | 
					 | 
				
			||||||
																Permissions.shopblockchooser,
 | 
					 | 
				
			||||||
																false)) {
 | 
					 | 
				
			||||||
											ItemStack shopBlockChooser = new ItemStack(
 | 
					 | 
				
			||||||
													Material.getMaterial((String) W.config
 | 
					 | 
				
			||||||
															.get(ConfigC.shop_blockChooserv1IDname)),
 | 
					 | 
				
			||||||
													1);
 | 
					 | 
				
			||||||
											ItemMeta shopBlockChooser_IM = shopBlockChooser
 | 
					 | 
				
			||||||
													.getItemMeta();
 | 
					 | 
				
			||||||
											shopBlockChooser_IM
 | 
					 | 
				
			||||||
													.setDisplayName(MessageM
 | 
					 | 
				
			||||||
															.replaceAll((String) W.config
 | 
					 | 
				
			||||||
																	.get(ConfigC.shop_blockChooserv1Name)));
 | 
					 | 
				
			||||||
											List<String> lores = W.config
 | 
					 | 
				
			||||||
													.getFile()
 | 
					 | 
				
			||||||
													.getStringList(
 | 
					 | 
				
			||||||
															ConfigC.shop_blockChooserv1Description.location);
 | 
					 | 
				
			||||||
											List<String> lores2 = new ArrayList<String>();
 | 
																List<String> lores2 = new ArrayList<String>();
 | 
				
			||||||
											for (String lore : lores) {
 | 
																for (String lore : lores) {
 | 
				
			||||||
												lores2.add(MessageM
 | 
																	lores2.add(MessageM.replaceAll(lore));
 | 
				
			||||||
														.replaceAll(lore));
 | 
					 | 
				
			||||||
											}
 | 
																}
 | 
				
			||||||
											shopBlockChooser_IM.setLore(lores2);
 | 
																shopBlockChooser_IM.setLore(lores2);
 | 
				
			||||||
											shopBlockChooser
 | 
																shopBlockChooser.setItemMeta(shopBlockChooser_IM);
 | 
				
			||||||
													.setItemMeta(shopBlockChooser_IM);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
											player.getInventory().addItem(
 | 
																player.getInventory().addItem(shopBlockChooser);
 | 
				
			||||||
													shopBlockChooser);
 | 
					 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									if ((Boolean) W.config
 | 
														if ((Boolean) W.config.get(ConfigC.shop_BlockHuntPassv2Enabled) == true) {
 | 
				
			||||||
											.get(ConfigC.shop_BlockHuntPassv2Enabled) == true) {
 | 
															if (W.shop.getFile().getInt(player.getName() + ".blockhuntpass") != 0) {
 | 
				
			||||||
										if (W.shop.getFile().getInt(
 | 
																ItemStack shopBlockHuntPass = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.shop_BlockHuntPassv2IDName)),
 | 
				
			||||||
												player.getName()
 | 
					 | 
				
			||||||
														+ ".blockhuntpass") != 0) {
 | 
					 | 
				
			||||||
											ItemStack shopBlockHuntPass = new ItemStack(
 | 
					 | 
				
			||||||
													Material.getMaterial((String) W.config
 | 
					 | 
				
			||||||
															.get(ConfigC.shop_BlockHuntPassv2IDName)),
 | 
					 | 
				
			||||||
													1);
 | 
																		1);
 | 
				
			||||||
											ItemMeta shopBlockHuntPass_IM = shopBlockHuntPass
 | 
																ItemMeta shopBlockHuntPass_IM = shopBlockHuntPass.getItemMeta();
 | 
				
			||||||
													.getItemMeta();
 | 
																shopBlockHuntPass_IM.setDisplayName(MessageM.replaceAll((String) W.config.get(ConfigC.shop_BlockHuntPassv2Name)));
 | 
				
			||||||
											shopBlockHuntPass_IM
 | 
																List<String> lores = W.config.getFile().getStringList(ConfigC.shop_BlockHuntPassv2Description.location);
 | 
				
			||||||
													.setDisplayName(MessageM
 | 
					 | 
				
			||||||
															.replaceAll((String) W.config
 | 
					 | 
				
			||||||
																	.get(ConfigC.shop_BlockHuntPassv2Name)));
 | 
					 | 
				
			||||||
											List<String> lores = W.config
 | 
					 | 
				
			||||||
													.getFile()
 | 
					 | 
				
			||||||
													.getStringList(
 | 
					 | 
				
			||||||
															ConfigC.shop_BlockHuntPassv2Description.location);
 | 
					 | 
				
			||||||
											List<String> lores2 = new ArrayList<String>();
 | 
																List<String> lores2 = new ArrayList<String>();
 | 
				
			||||||
											for (String lore : lores) {
 | 
																for (String lore : lores) {
 | 
				
			||||||
												lores2.add(MessageM
 | 
																	lores2.add(MessageM.replaceAll(lore));
 | 
				
			||||||
														.replaceAll(lore));
 | 
					 | 
				
			||||||
											}
 | 
																}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
											shopBlockHuntPass_IM
 | 
																shopBlockHuntPass_IM.setLore(lores2);
 | 
				
			||||||
													.setLore(lores2);
 | 
																shopBlockHuntPass.setItemMeta(shopBlockHuntPass_IM);
 | 
				
			||||||
											shopBlockHuntPass
 | 
																shopBlockHuntPass.setAmount(W.shop.getFile().getInt(player.getName() + ".blockhuntpass"));
 | 
				
			||||||
													.setItemMeta(shopBlockHuntPass_IM);
 | 
					 | 
				
			||||||
											shopBlockHuntPass
 | 
					 | 
				
			||||||
													.setAmount(W.shop
 | 
					 | 
				
			||||||
															.getFile()
 | 
					 | 
				
			||||||
															.getInt(player
 | 
					 | 
				
			||||||
																	.getName()
 | 
					 | 
				
			||||||
																	+ ".blockhuntpass"));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
											player.getInventory().addItem(
 | 
																player.getInventory().addItem(shopBlockHuntPass);
 | 
				
			||||||
													shopBlockHuntPass);
 | 
					 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
									player.updateInventory();
 | 
														player.updateInventory();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									DisguiseAPI.undisguiseToAll(player);
 | 
														DisguiseAPI.undisguiseToAll(player);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									ArenaHandler.sendFMessage(arena,
 | 
														ArenaHandler.sendFMessage(arena, ConfigC.normal_joinJoinedArena, "playername-" + player.getName(),
 | 
				
			||||||
											ConfigC.normal_joinJoinedArena,
 | 
																"1-" + arena.playersInArena.size(), "2-" + arena.maxPlayers);
 | 
				
			||||||
											"playername-" + player.getName(),
 | 
					 | 
				
			||||||
											"1-" + arena.playersInArena.size(),
 | 
					 | 
				
			||||||
											"2-" + arena.maxPlayers);
 | 
					 | 
				
			||||||
									if (arena.playersInArena.size() < arena.minPlayers) {
 | 
														if (arena.playersInArena.size() < arena.minPlayers) {
 | 
				
			||||||
										ArenaHandler
 | 
															ArenaHandler.sendFMessage(arena, ConfigC.warning_lobbyNeedAtleast, "1-" + arena.minPlayers);
 | 
				
			||||||
												.sendFMessage(
 | 
					 | 
				
			||||||
														arena,
 | 
					 | 
				
			||||||
														ConfigC.warning_lobbyNeedAtleast,
 | 
					 | 
				
			||||||
														"1-" + arena.minPlayers);
 | 
					 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
								} else {
 | 
													} else {
 | 
				
			||||||
									MessageM.sendFMessage(player,
 | 
														MessageM.sendFMessage(player, ConfigC.error_joinArenaIngame);
 | 
				
			||||||
											ConfigC.error_joinArenaIngame);
 | 
					 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
							} else {
 | 
												} else {
 | 
				
			||||||
								MessageM.sendFMessage(player,
 | 
													MessageM.sendFMessage(player, ConfigC.error_joinWarpsNotSet);
 | 
				
			||||||
										ConfigC.error_joinWarpsNotSet);
 | 
					 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						} else {
 | 
											} else {
 | 
				
			||||||
							MessageM.sendFMessage(player,
 | 
												MessageM.sendFMessage(player, ConfigC.error_joinWarpsNotSet);
 | 
				
			||||||
									ConfigC.error_joinWarpsNotSet);
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
@@ -274,15 +206,13 @@ public class ArenaHandler {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (!found) {
 | 
							if (!found) {
 | 
				
			||||||
			MessageM.sendFMessage(player, ConfigC.error_noArena, "name-"
 | 
								MessageM.sendFMessage(player, ConfigC.error_noArena, "name-" + arenaname);
 | 
				
			||||||
					+ arenaname);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		SignsHandler.updateSigns();
 | 
							SignsHandler.updateSigns();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public static void playerLeaveArena(Player player, boolean message,
 | 
						public static void playerLeaveArena(Player player, boolean message, boolean cleanup) {
 | 
				
			||||||
			boolean cleanup) {
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Arena arena = null;
 | 
							Arena arena = null;
 | 
				
			||||||
		for (Arena arena2 : W.arenaList) {
 | 
							for (Arena arena2 : W.arenaList) {
 | 
				
			||||||
@@ -302,18 +232,14 @@ public class ArenaHandler {
 | 
				
			|||||||
					arena.seekers.remove(player);
 | 
										arena.seekers.remove(player);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (arena.playersInArena.size() < arena.minPlayers
 | 
									if (arena.playersInArena.size() < arena.minPlayers && arena.gameState.equals(ArenaState.STARTING)) {
 | 
				
			||||||
						&& arena.gameState.equals(ArenaState.STARTING)) {
 | 
					 | 
				
			||||||
					arena.gameState = ArenaState.WAITING;
 | 
										arena.gameState = ArenaState.WAITING;
 | 
				
			||||||
					arena.timer = 0;
 | 
										arena.timer = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					ArenaHandler.sendFMessage(arena,
 | 
										ArenaHandler.sendFMessage(arena, ConfigC.warning_lobbyNeedAtleast, "1-" + arena.minPlayers);
 | 
				
			||||||
							ConfigC.warning_lobbyNeedAtleast, "1-"
 | 
					 | 
				
			||||||
									+ arena.minPlayers);
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (arena.playersInArena.size() <= 1
 | 
									if (arena.playersInArena.size() <= 1 && arena.gameState == ArenaState.INGAME) {
 | 
				
			||||||
						&& arena.gameState == ArenaState.INGAME) {
 | 
					 | 
				
			||||||
					if (arena.seekers.size() >= arena.playersInArena.size()) {
 | 
										if (arena.seekers.size() >= arena.playersInArena.size()) {
 | 
				
			||||||
						ArenaHandler.seekersWin(arena);
 | 
											ArenaHandler.seekersWin(arena);
 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
@@ -325,16 +251,10 @@ public class ArenaHandler {
 | 
				
			|||||||
					ArenaHandler.seekersWin(arena);
 | 
										ArenaHandler.seekersWin(arena);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (arena.seekers.size() <= 0
 | 
									if (arena.seekers.size() <= 0 && arena.gameState == ArenaState.INGAME) {
 | 
				
			||||||
						&& arena.gameState == ArenaState.INGAME) {
 | 
										Player seeker = arena.playersInArena.get(W.random.nextInt(arena.playersInArena.size()));
 | 
				
			||||||
					Player seeker = arena.playersInArena.get(W.random
 | 
										ArenaHandler.sendFMessage(arena, ConfigC.warning_ingameNEWSeekerChoosen, "seeker-" + seeker.getName());
 | 
				
			||||||
							.nextInt(arena.playersInArena.size()));
 | 
										ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameSeekerChoosen, "seeker-" + seeker.getName());
 | 
				
			||||||
					ArenaHandler.sendFMessage(arena,
 | 
					 | 
				
			||||||
							ConfigC.warning_ingameNEWSeekerChoosen, "seeker-"
 | 
					 | 
				
			||||||
									+ seeker.getName());
 | 
					 | 
				
			||||||
					ArenaHandler.sendFMessage(arena,
 | 
					 | 
				
			||||||
							ConfigC.normal_ingameSeekerChoosen, "seeker-"
 | 
					 | 
				
			||||||
									+ seeker.getName());
 | 
					 | 
				
			||||||
					DisguiseAPI.undisguiseToAll(seeker);
 | 
										DisguiseAPI.undisguiseToAll(seeker);
 | 
				
			||||||
					for (Player pl : Bukkit.getOnlinePlayers()) {
 | 
										for (Player pl : Bukkit.getOnlinePlayers()) {
 | 
				
			||||||
						pl.showPlayer(seeker);
 | 
											pl.showPlayer(seeker);
 | 
				
			||||||
@@ -347,14 +267,18 @@ public class ArenaHandler {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
					// Fix for client not showing players after they join
 | 
										// Fix for client not showing players after they join
 | 
				
			||||||
					for (Player otherplayer : arena.playersInArena) {
 | 
										for (Player otherplayer : arena.playersInArena) {
 | 
				
			||||||
						if (otherplayer.canSee(player)) otherplayer.showPlayer(player);       // Make new player visible to others
 | 
											if (otherplayer.canSee(player))
 | 
				
			||||||
						if (player.canSee(otherplayer)) player.showPlayer(otherplayer);       // Make other players visible to new player
 | 
												otherplayer.showPlayer(player); // Make new player
 | 
				
			||||||
 | 
																				// visible to others
 | 
				
			||||||
 | 
											if (player.canSee(otherplayer))
 | 
				
			||||||
 | 
												player.showPlayer(otherplayer); // Make other
 | 
				
			||||||
 | 
																				// players visible
 | 
				
			||||||
 | 
																				// to new player
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			PlayerArenaData pad = new PlayerArenaData(null, null, null, null,
 | 
								PlayerArenaData pad = new PlayerArenaData(null, null, null, null, null, null, null, null, null, false);
 | 
				
			||||||
					null, null, null, null, null, false);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (W.pData.get(player) != null) {
 | 
								if (W.pData.get(player) != null) {
 | 
				
			||||||
				pad = W.pData.get(player);
 | 
									pad = W.pData.get(player);
 | 
				
			||||||
@@ -385,11 +309,9 @@ public class ArenaHandler {
 | 
				
			|||||||
					if (W.hiddenLocWater.get(player) != null) {
 | 
										if (W.hiddenLocWater.get(player) != null) {
 | 
				
			||||||
						Block pBlock = W.hiddenLoc.get(player).getBlock();
 | 
											Block pBlock = W.hiddenLoc.get(player).getBlock();
 | 
				
			||||||
						if (W.hiddenLocWater.get(player)) {
 | 
											if (W.hiddenLocWater.get(player)) {
 | 
				
			||||||
							pl.sendBlockChange(pBlock.getLocation(),
 | 
												pl.sendBlockChange(pBlock.getLocation(), Material.STATIONARY_WATER, (byte) 0);
 | 
				
			||||||
									Material.STATIONARY_WATER, (byte) 0);
 | 
					 | 
				
			||||||
						} else {
 | 
											} else {
 | 
				
			||||||
							pl.sendBlockChange(pBlock.getLocation(),
 | 
												pl.sendBlockChange(pBlock.getLocation(), Material.AIR, (byte) 0);
 | 
				
			||||||
									Material.AIR, (byte) 0);
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
@@ -401,9 +323,7 @@ public class ArenaHandler {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			MessageM.sendFMessage(player, ConfigC.normal_leaveYouLeft);
 | 
								MessageM.sendFMessage(player, ConfigC.normal_leaveYouLeft);
 | 
				
			||||||
			if (message) {
 | 
								if (message) {
 | 
				
			||||||
				ArenaHandler.sendFMessage(arena, ConfigC.normal_leaveLeftArena,
 | 
									ArenaHandler.sendFMessage(arena, ConfigC.normal_leaveLeftArena, "playername-" + player.getName(), "1-" + arena.playersInArena.size(), "2-"
 | 
				
			||||||
						"playername-" + player.getName(), "1-"
 | 
					 | 
				
			||||||
								+ arena.playersInArena.size(), "2-"
 | 
					 | 
				
			||||||
						+ arena.maxPlayers);
 | 
											+ arena.maxPlayers);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
@@ -422,22 +342,18 @@ public class ArenaHandler {
 | 
				
			|||||||
		for (Player player : arena.playersInArena) {
 | 
							for (Player player : arena.playersInArena) {
 | 
				
			||||||
			if (arena.seekersWinCommands != null) {
 | 
								if (arena.seekersWinCommands != null) {
 | 
				
			||||||
				for (String command : arena.seekersWinCommands) {
 | 
									for (String command : arena.seekersWinCommands) {
 | 
				
			||||||
					Bukkit.dispatchCommand(Bukkit.getConsoleSender(),
 | 
										Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command.replaceAll("%player%", player.getName()));
 | 
				
			||||||
							command.replaceAll("%player%", player.getName()));
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (W.shop.getFile().get(player.getName() + ".tokens") == null) {
 | 
									if (W.shop.getFile().get(player.getName() + ".tokens") == null) {
 | 
				
			||||||
					W.shop.getFile().set(player.getName() + ".tokens", 0);
 | 
										W.shop.getFile().set(player.getName() + ".tokens", 0);
 | 
				
			||||||
					W.shop.save();
 | 
										W.shop.save();
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				int playerTokens = W.shop.getFile().getInt(
 | 
									int playerTokens = W.shop.getFile().getInt(player.getName() + ".tokens");
 | 
				
			||||||
						player.getName() + ".tokens");
 | 
									W.shop.getFile().set(player.getName() + ".tokens", playerTokens + arena.seekersTokenWin);
 | 
				
			||||||
				W.shop.getFile().set(player.getName() + ".tokens",
 | 
					 | 
				
			||||||
						playerTokens + arena.seekersTokenWin);
 | 
					 | 
				
			||||||
				W.shop.save();
 | 
									W.shop.save();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.normal_addedToken,
 | 
									MessageM.sendFMessage(player, ConfigC.normal_addedToken, "amount-" + arena.seekersTokenWin);
 | 
				
			||||||
						"amount-" + arena.seekersTokenWin);
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -460,23 +376,18 @@ public class ArenaHandler {
 | 
				
			|||||||
			if (!arena.seekers.contains(player)) {
 | 
								if (!arena.seekers.contains(player)) {
 | 
				
			||||||
				if (arena.hidersWinCommands != null) {
 | 
									if (arena.hidersWinCommands != null) {
 | 
				
			||||||
					for (String command : arena.hidersWinCommands) {
 | 
										for (String command : arena.hidersWinCommands) {
 | 
				
			||||||
						Bukkit.dispatchCommand(
 | 
											Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command.replaceAll("%player%", player.getName()));
 | 
				
			||||||
								Bukkit.getConsoleSender(),
 | 
					 | 
				
			||||||
								command.replaceAll("%player%", player.getName()));
 | 
					 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					if (W.shop.getFile().get(player.getName() + ".tokens") == null) {
 | 
										if (W.shop.getFile().get(player.getName() + ".tokens") == null) {
 | 
				
			||||||
						W.shop.getFile().set(player.getName() + ".tokens", 0);
 | 
											W.shop.getFile().set(player.getName() + ".tokens", 0);
 | 
				
			||||||
						W.shop.save();
 | 
											W.shop.save();
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
					int playerTokens = W.shop.getFile().getInt(
 | 
										int playerTokens = W.shop.getFile().getInt(player.getName() + ".tokens");
 | 
				
			||||||
							player.getName() + ".tokens");
 | 
										W.shop.getFile().set(player.getName() + ".tokens", playerTokens + arena.hidersTokenWin);
 | 
				
			||||||
					W.shop.getFile().set(player.getName() + ".tokens",
 | 
					 | 
				
			||||||
							playerTokens + arena.hidersTokenWin);
 | 
					 | 
				
			||||||
					W.shop.save();
 | 
										W.shop.save();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					MessageM.sendFMessage(player, ConfigC.normal_addedToken,
 | 
										MessageM.sendFMessage(player, ConfigC.normal_addedToken, "amount-" + arena.hidersTokenWin);
 | 
				
			||||||
							"amount-" + arena.hidersTokenWin);
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,5 @@
 | 
				
			|||||||
package nl.Steffion.BlockHunt;
 | 
					package nl.Steffion.BlockHunt;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.io.IOException;
 | 
					 | 
				
			||||||
import java.util.ArrayList;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -31,7 +30,6 @@ import nl.Steffion.BlockHunt.Listeners.OnEntityDamageEvent;
 | 
				
			|||||||
import nl.Steffion.BlockHunt.Listeners.OnFoodLevelChangeEvent;
 | 
					import nl.Steffion.BlockHunt.Listeners.OnFoodLevelChangeEvent;
 | 
				
			||||||
import nl.Steffion.BlockHunt.Listeners.OnInventoryClickEvent;
 | 
					import nl.Steffion.BlockHunt.Listeners.OnInventoryClickEvent;
 | 
				
			||||||
import nl.Steffion.BlockHunt.Listeners.OnInventoryCloseEvent;
 | 
					import nl.Steffion.BlockHunt.Listeners.OnInventoryCloseEvent;
 | 
				
			||||||
import nl.Steffion.BlockHunt.Listeners.OnPlayerCommandPreprocessEvent;
 | 
					 | 
				
			||||||
import nl.Steffion.BlockHunt.Listeners.OnPlayerDropItemEvent;
 | 
					import nl.Steffion.BlockHunt.Listeners.OnPlayerDropItemEvent;
 | 
				
			||||||
import nl.Steffion.BlockHunt.Listeners.OnPlayerInteractEvent;
 | 
					import nl.Steffion.BlockHunt.Listeners.OnPlayerInteractEvent;
 | 
				
			||||||
import nl.Steffion.BlockHunt.Listeners.OnPlayerMoveEvent;
 | 
					import nl.Steffion.BlockHunt.Listeners.OnPlayerMoveEvent;
 | 
				
			||||||
@@ -42,8 +40,6 @@ import nl.Steffion.BlockHunt.Managers.ConfigM;
 | 
				
			|||||||
import nl.Steffion.BlockHunt.Managers.MessageM;
 | 
					import nl.Steffion.BlockHunt.Managers.MessageM;
 | 
				
			||||||
import nl.Steffion.BlockHunt.Managers.PermissionsM;
 | 
					import nl.Steffion.BlockHunt.Managers.PermissionsM;
 | 
				
			||||||
import nl.Steffion.BlockHunt.Serializables.LocationSerializable;
 | 
					import nl.Steffion.BlockHunt.Serializables.LocationSerializable;
 | 
				
			||||||
import nl.Steffion.BlockHunt.mcstats.Metrics;
 | 
					 | 
				
			||||||
import nl.Steffion.BlockHunt.mcstats.Metrics.Graph;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.bukkit.Bukkit;
 | 
					import org.bukkit.Bukkit;
 | 
				
			||||||
import org.bukkit.GameMode;
 | 
					import org.bukkit.GameMode;
 | 
				
			||||||
@@ -53,9 +49,6 @@ import org.bukkit.Sound;
 | 
				
			|||||||
import org.bukkit.block.Block;
 | 
					import org.bukkit.block.Block;
 | 
				
			||||||
import org.bukkit.command.Command;
 | 
					import org.bukkit.command.Command;
 | 
				
			||||||
import org.bukkit.command.CommandSender;
 | 
					import org.bukkit.command.CommandSender;
 | 
				
			||||||
import org.bukkit.configuration.InvalidConfigurationException;
 | 
					 | 
				
			||||||
import org.bukkit.configuration.file.FileConfiguration;
 | 
					 | 
				
			||||||
import org.bukkit.configuration.file.YamlConfiguration;
 | 
					 | 
				
			||||||
import org.bukkit.configuration.serialization.ConfigurationSerialization;
 | 
					import org.bukkit.configuration.serialization.ConfigurationSerialization;
 | 
				
			||||||
import org.bukkit.enchantments.Enchantment;
 | 
					import org.bukkit.enchantments.Enchantment;
 | 
				
			||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
@@ -119,38 +112,25 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
	public void onEnable() {
 | 
						public void onEnable() {
 | 
				
			||||||
		getServer().getPluginManager().registerEvents(this, this);
 | 
							getServer().getPluginManager().registerEvents(this, this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		getServer().getPluginManager().registerEvents(new OnBlockBreakEvent(),
 | 
							getServer().getPluginManager().registerEvents(new OnBlockBreakEvent(), this);
 | 
				
			||||||
				this);
 | 
							getServer().getPluginManager().registerEvents(new OnBlockPlaceEvent(), this);
 | 
				
			||||||
		getServer().getPluginManager().registerEvents(new OnBlockPlaceEvent(),
 | 
							getServer().getPluginManager().registerEvents(new OnEntityDamageByEntityEvent(), this);
 | 
				
			||||||
				this);
 | 
							getServer().getPluginManager().registerEvents(new OnEntityDamageEvent(), this);
 | 
				
			||||||
		getServer().getPluginManager().registerEvents(
 | 
							getServer().getPluginManager().registerEvents(new OnFoodLevelChangeEvent(), this);
 | 
				
			||||||
				new OnEntityDamageByEntityEvent(), this);
 | 
							getServer().getPluginManager().registerEvents(new OnInventoryClickEvent(), this);
 | 
				
			||||||
		getServer().getPluginManager().registerEvents(
 | 
							getServer().getPluginManager().registerEvents(new OnInventoryCloseEvent(), this);
 | 
				
			||||||
				new OnEntityDamageEvent(), this);
 | 
					 | 
				
			||||||
		getServer().getPluginManager().registerEvents(
 | 
					 | 
				
			||||||
				new OnFoodLevelChangeEvent(), this);
 | 
					 | 
				
			||||||
		getServer().getPluginManager().registerEvents(
 | 
					 | 
				
			||||||
				new OnInventoryClickEvent(), this);
 | 
					 | 
				
			||||||
		getServer().getPluginManager().registerEvents(
 | 
					 | 
				
			||||||
				new OnInventoryCloseEvent(), this);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Removed - This is handled by WorldGuard now.
 | 
							// Removed - This is handled by WorldGuard now.
 | 
				
			||||||
//		getServer().getPluginManager().registerEvents(
 | 
							// getServer().getPluginManager().registerEvents(
 | 
				
			||||||
//				new OnPlayerCommandPreprocessEvent(), this);
 | 
							// new OnPlayerCommandPreprocessEvent(), this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		getServer().getPluginManager().registerEvents(
 | 
							getServer().getPluginManager().registerEvents(new OnPlayerDropItemEvent(), this);
 | 
				
			||||||
				new OnPlayerDropItemEvent(), this);
 | 
							getServer().getPluginManager().registerEvents(new OnPlayerInteractEvent(), this);
 | 
				
			||||||
		getServer().getPluginManager().registerEvents(
 | 
							getServer().getPluginManager().registerEvents(new OnPlayerMoveEvent(), this);
 | 
				
			||||||
				new OnPlayerInteractEvent(), this);
 | 
							getServer().getPluginManager().registerEvents(new OnPlayerQuitEvent(), this);
 | 
				
			||||||
		getServer().getPluginManager().registerEvents(new OnPlayerMoveEvent(),
 | 
							getServer().getPluginManager().registerEvents(new OnSignChangeEvent(), this);
 | 
				
			||||||
				this);
 | 
					 | 
				
			||||||
		getServer().getPluginManager().registerEvents(new OnPlayerQuitEvent(),
 | 
					 | 
				
			||||||
				this);
 | 
					 | 
				
			||||||
		getServer().getPluginManager().registerEvents(new OnSignChangeEvent(),
 | 
					 | 
				
			||||||
				this);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ConfigurationSerialization.registerClass(LocationSerializable.class,
 | 
							ConfigurationSerialization.registerClass(LocationSerializable.class, "BlockHuntLocation");
 | 
				
			||||||
				"BlockHuntLocation");
 | 
					 | 
				
			||||||
		ConfigurationSerialization.registerClass(Arena.class, "BlockHuntArena");
 | 
							ConfigurationSerialization.registerClass(Arena.class, "BlockHuntArena");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		pdfFile = getDescription();
 | 
							pdfFile = getDescription();
 | 
				
			||||||
@@ -158,72 +138,37 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		ConfigM.newFiles();
 | 
							ConfigM.newFiles();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		CMD = new CommandM("BlockHunt", "BlockHunt", null, null,
 | 
							CMD = new CommandM("BlockHunt", "BlockHunt", null, null, Permissions.info, ConfigC.help_info, (Boolean) W.config.get(ConfigC.commandEnabled_info), BlockHuntCMD,
 | 
				
			||||||
				Permissions.info, ConfigC.help_info,
 | 
									new CMDinfo(), null);
 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_info),
 | 
							CMDinfo = new CommandM("BlockHunt INFO", "BlockHunt", "info", "i", Permissions.info, ConfigC.help_info, (Boolean) W.config.get(ConfigC.commandEnabled_info),
 | 
				
			||||||
				BlockHuntCMD, new CMDinfo(), null);
 | 
					 | 
				
			||||||
		CMDinfo = new CommandM("BlockHunt INFO", "BlockHunt", "info", "i",
 | 
					 | 
				
			||||||
				Permissions.info, ConfigC.help_info,
 | 
					 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_info),
 | 
					 | 
				
			||||||
				BlockHuntCMD, new CMDinfo(), "/BlockHunt [info|i]");
 | 
									BlockHuntCMD, new CMDinfo(), "/BlockHunt [info|i]");
 | 
				
			||||||
		CMDhelp = new CommandM("BlockHunt HELP", "BlockHunt", "help", "h",
 | 
							CMDhelp = new CommandM("BlockHunt HELP", "BlockHunt", "help", "h", Permissions.help, ConfigC.help_help, (Boolean) W.config.get(ConfigC.commandEnabled_help),
 | 
				
			||||||
				Permissions.help, ConfigC.help_help,
 | 
									BlockHuntCMD, new CMDhelp(), "/BlockHunt <help|h> [page number]");
 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_help),
 | 
							CMDreload = new CommandM("BlockHunt RELOAD", "BlockHunt", "reload", "r", Permissions.reload, ConfigC.help_reload,
 | 
				
			||||||
				BlockHuntCMD, new CMDhelp(),
 | 
									(Boolean) W.config.get(ConfigC.commandEnabled_reload), BlockHuntCMD, new CMDreload(), "/BlockHunt <reload|r>");
 | 
				
			||||||
				"/BlockHunt <help|h> [page number]");
 | 
							CMDjoin = new CommandM("BlockHunt JOIN", "BlockHunt", "join", "j", Permissions.join, ConfigC.help_join, (Boolean) W.config.get(ConfigC.commandEnabled_join),
 | 
				
			||||||
		CMDreload = new CommandM("BlockHunt RELOAD", "BlockHunt", "reload",
 | 
					 | 
				
			||||||
				"r", Permissions.reload, ConfigC.help_reload,
 | 
					 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_reload),
 | 
					 | 
				
			||||||
				BlockHuntCMD, new CMDreload(), "/BlockHunt <reload|r>");
 | 
					 | 
				
			||||||
		CMDjoin = new CommandM("BlockHunt JOIN", "BlockHunt", "join", "j",
 | 
					 | 
				
			||||||
				Permissions.join, ConfigC.help_join,
 | 
					 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_join),
 | 
					 | 
				
			||||||
				BlockHuntCMD, new CMDjoin(), "/BlockHunt <join|j> <arenaname>");
 | 
									BlockHuntCMD, new CMDjoin(), "/BlockHunt <join|j> <arenaname>");
 | 
				
			||||||
		CMDleave = new CommandM("BlockHunt LEAVE", "BlockHunt", "leave", "l",
 | 
							CMDleave = new CommandM("BlockHunt LEAVE", "BlockHunt", "leave", "l", Permissions.leave, ConfigC.help_leave,
 | 
				
			||||||
				Permissions.leave, ConfigC.help_leave,
 | 
									(Boolean) W.config.get(ConfigC.commandEnabled_leave), BlockHuntCMD, new CMDleave(), "/BlockHunt <leave|l>");
 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_leave),
 | 
							CMDlist = new CommandM("BlockHunt LIST", "BlockHunt", "list", "li", Permissions.list, ConfigC.help_list, (Boolean) W.config.get(ConfigC.commandEnabled_list),
 | 
				
			||||||
				BlockHuntCMD, new CMDleave(), "/BlockHunt <leave|l>");
 | 
					 | 
				
			||||||
		CMDlist = new CommandM("BlockHunt LIST", "BlockHunt", "list", "li",
 | 
					 | 
				
			||||||
				Permissions.list, ConfigC.help_list,
 | 
					 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_list),
 | 
					 | 
				
			||||||
				BlockHuntCMD, new CMDlist(), "/BlockHunt <list|li>");
 | 
									BlockHuntCMD, new CMDlist(), "/BlockHunt <list|li>");
 | 
				
			||||||
		CMDshop = new CommandM("BlockHunt SHOP", "BlockHunt", "shop", "sh",
 | 
							CMDshop = new CommandM("BlockHunt SHOP", "BlockHunt", "shop", "sh", Permissions.shop, ConfigC.help_shop, (Boolean) W.config.get(ConfigC.commandEnabled_shop),
 | 
				
			||||||
				Permissions.shop, ConfigC.help_shop,
 | 
					 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_shop),
 | 
					 | 
				
			||||||
				BlockHuntCMD, new CMDshop(), "/BlockHunt <shop|sh>");
 | 
									BlockHuntCMD, new CMDshop(), "/BlockHunt <shop|sh>");
 | 
				
			||||||
		CMDstart = new CommandM("BlockHunt START", "BlockHunt", "start", "go",
 | 
							CMDstart = new CommandM("BlockHunt START", "BlockHunt", "start", "go", Permissions.start, ConfigC.help_start,
 | 
				
			||||||
				Permissions.start, ConfigC.help_start,
 | 
									(Boolean) W.config.get(ConfigC.commandEnabled_start), BlockHuntCMD, new CMDstart(), "/BlockHunt <start|go> <arenaname>");
 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_start),
 | 
							CMDwand = new CommandM("BlockHunt WAND", "BlockHunt", "wand", "w", Permissions.create, ConfigC.help_wand, (Boolean) W.config.get(ConfigC.commandEnabled_wand),
 | 
				
			||||||
				BlockHuntCMD, new CMDstart(),
 | 
					 | 
				
			||||||
				"/BlockHunt <start|go> <arenaname>");
 | 
					 | 
				
			||||||
		CMDwand = new CommandM("BlockHunt WAND", "BlockHunt", "wand", "w",
 | 
					 | 
				
			||||||
				Permissions.create, ConfigC.help_wand,
 | 
					 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_wand),
 | 
					 | 
				
			||||||
				BlockHuntCMD, new CMDwand(), "/BlockHunt <wand|w>");
 | 
									BlockHuntCMD, new CMDwand(), "/BlockHunt <wand|w>");
 | 
				
			||||||
		CMDcreate = new CommandM("BlockHunt CREATE", "BlockHunt", "create",
 | 
							CMDcreate = new CommandM("BlockHunt CREATE", "BlockHunt", "create", "c", Permissions.create, ConfigC.help_create,
 | 
				
			||||||
				"c", Permissions.create, ConfigC.help_create,
 | 
									(Boolean) W.config.get(ConfigC.commandEnabled_create), BlockHuntCMD, new CMDcreate(), "/BlockHunt <create|c> <arenaname>");
 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_create),
 | 
							CMDset = new CommandM("BlockHunt SET", "BlockHunt", "set", "s", Permissions.set, ConfigC.help_set, (Boolean) W.config.get(ConfigC.commandEnabled_set),
 | 
				
			||||||
				BlockHuntCMD, new CMDcreate(),
 | 
					 | 
				
			||||||
				"/BlockHunt <create|c> <arenaname>");
 | 
					 | 
				
			||||||
		CMDset = new CommandM("BlockHunt SET", "BlockHunt", "set", "s",
 | 
					 | 
				
			||||||
				Permissions.set, ConfigC.help_set,
 | 
					 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_set),
 | 
					 | 
				
			||||||
				BlockHuntCMD, new CMDset(), "/BlockHunt <set|s> <arenaname>");
 | 
									BlockHuntCMD, new CMDset(), "/BlockHunt <set|s> <arenaname>");
 | 
				
			||||||
		CMDsetwarp = new CommandM("BlockHunt SETWARP", "BlockHunt", "setwarp",
 | 
							CMDsetwarp = new CommandM("BlockHunt SETWARP", "BlockHunt", "setwarp", "sw", Permissions.setwarp, ConfigC.help_setwarp,
 | 
				
			||||||
				"sw", Permissions.setwarp, ConfigC.help_setwarp,
 | 
									(Boolean) W.config.get(ConfigC.commandEnabled_setwarp), BlockHuntCMD, new CMDsetwarp(),
 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_setwarp),
 | 
					 | 
				
			||||||
				BlockHuntCMD, new CMDsetwarp(),
 | 
					 | 
				
			||||||
				"/BlockHunt <setwarp|sw> <lobby|hiders|seekers|spawn> <arenaname>");
 | 
									"/BlockHunt <setwarp|sw> <lobby|hiders|seekers|spawn> <arenaname>");
 | 
				
			||||||
		CMDremove = new CommandM("BlockHunt REMOVE", "BlockHunt", "remove",
 | 
							CMDremove = new CommandM("BlockHunt REMOVE", "BlockHunt", "remove", "delete", Permissions.remove, ConfigC.help_remove,
 | 
				
			||||||
				"delete", Permissions.remove, ConfigC.help_remove,
 | 
									(Boolean) W.config.get(ConfigC.commandEnabled_remove), BlockHuntCMD, new CMDremove(), "/BlockHunt <remove|delete> <arenaname>");
 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_remove),
 | 
							CMDtokens = new CommandM("BlockHunt TOKENS", "BlockHunt", "tokens", "t", Permissions.tokens, ConfigC.help_tokens,
 | 
				
			||||||
				BlockHuntCMD, new CMDremove(),
 | 
									(Boolean) W.config.get(ConfigC.commandEnabled_tokens), BlockHuntCMD, new CMDtokens(), "/BlockHunt <tokens|t> <set|add|take> <playername> <amount>");
 | 
				
			||||||
				"/BlockHunt <remove|delete> <arenaname>");
 | 
					 | 
				
			||||||
		CMDtokens = new CommandM("BlockHunt TOKENS", "BlockHunt", "tokens",
 | 
					 | 
				
			||||||
				"t", Permissions.tokens, ConfigC.help_tokens,
 | 
					 | 
				
			||||||
				(Boolean) W.config.get(ConfigC.commandEnabled_tokens),
 | 
					 | 
				
			||||||
				BlockHuntCMD, new CMDtokens(),
 | 
					 | 
				
			||||||
				"/BlockHunt <tokens|t> <set|add|take> <playername> <amount>");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (!getServer().getPluginManager().isPluginEnabled("LibsDisguises")) {
 | 
							if (!getServer().getPluginManager().isPluginEnabled("LibsDisguises")) {
 | 
				
			||||||
			MessageM.broadcastFMessage(ConfigC.error_libsDisguisesNotInstalled);
 | 
								MessageM.broadcastFMessage(ConfigC.error_libsDisguisesNotInstalled);
 | 
				
			||||||
@@ -235,84 +180,13 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		ArenaHandler.loadArenas();
 | 
							ArenaHandler.loadArenas();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Bukkit.getScheduler().runTaskTimer(this, new Runnable() {
 | 
							MessageM.sendFMessage(null, ConfigC.log_enabledPlugin, "name-" + BlockHunt.pdfFile.getName(), "version-" + BlockHunt.pdfFile.getVersion(), "autors-"
 | 
				
			||||||
 | 
					 | 
				
			||||||
			@Override
 | 
					 | 
				
			||||||
			public void run() {
 | 
					 | 
				
			||||||
				try {
 | 
					 | 
				
			||||||
					Metrics metrics = new Metrics(plugin);
 | 
					 | 
				
			||||||
					if (metrics.isOptOut()) { return; }
 | 
					 | 
				
			||||||
					Graph playersPlayingBlockHunt = metrics
 | 
					 | 
				
			||||||
							.createGraph("Players playing BlockHunt");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					playersPlayingBlockHunt.addPlotter(new Metrics.Plotter(
 | 
					 | 
				
			||||||
							"Playing") {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
						@Override
 | 
					 | 
				
			||||||
						public int getValue() {
 | 
					 | 
				
			||||||
							int playersPlaying = 0;
 | 
					 | 
				
			||||||
							for (Arena arena : W.arenaList) {
 | 
					 | 
				
			||||||
								playersPlaying = playersPlaying
 | 
					 | 
				
			||||||
										+ arena.playersInArena.size();
 | 
					 | 
				
			||||||
							}
 | 
					 | 
				
			||||||
							return playersPlaying;
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					playersPlayingBlockHunt.addPlotter(new Metrics.Plotter(
 | 
					 | 
				
			||||||
							"Not playing") {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
						@Override
 | 
					 | 
				
			||||||
						public int getValue() {
 | 
					 | 
				
			||||||
							int playersPlaying = 0;
 | 
					 | 
				
			||||||
							for (Arena arena : W.arenaList) {
 | 
					 | 
				
			||||||
								playersPlaying = playersPlaying
 | 
					 | 
				
			||||||
										+ arena.playersInArena.size();
 | 
					 | 
				
			||||||
							}
 | 
					 | 
				
			||||||
							return Bukkit.getOnlinePlayers().length
 | 
					 | 
				
			||||||
									- playersPlaying;
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					metrics.start();
 | 
					 | 
				
			||||||
					FileConfiguration metrics_fc = new YamlConfiguration();
 | 
					 | 
				
			||||||
					metrics_fc.load(metrics.getConfigFile());
 | 
					 | 
				
			||||||
					/*if (!metrics_fc.getBoolean("opt-out", false)) {
 | 
					 | 
				
			||||||
						MessageM.sendMessage(null,
 | 
					 | 
				
			||||||
								"%TAG%NSending %AMCStats%N to the server...");
 | 
					 | 
				
			||||||
					} else {
 | 
					 | 
				
			||||||
						MessageM.sendMessage(null,
 | 
					 | 
				
			||||||
								"%TAG%EUnable to send %AMCStats %Eto the server. %AMCStats%E is disabled?");
 | 
					 | 
				
			||||||
					}*/
 | 
					 | 
				
			||||||
				} catch (IOException e) {
 | 
					 | 
				
			||||||
					MessageM.sendMessage(null,
 | 
					 | 
				
			||||||
							"%TAG%EUnable to send %AMCStats %Eto the server. Something went wrong ;(!");
 | 
					 | 
				
			||||||
				} catch (InvalidConfigurationException e) {
 | 
					 | 
				
			||||||
					MessageM.sendMessage(null,
 | 
					 | 
				
			||||||
							"%TAG%EUnable to send %AMCStats %Eto the server. Something went wrong ;(!");
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}, 0, 6000);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if ((Boolean) W.config.get(ConfigC.autoUpdateCheck)) {
 | 
					 | 
				
			||||||
			if ((Boolean) W.config.get(ConfigC.autoDownloadUpdate)) {
 | 
					 | 
				
			||||||
				new Updater(this, pdfFile.getName(), this.getFile(),
 | 
					 | 
				
			||||||
						Updater.UpdateType.DEFAULT, true);
 | 
					 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				new Updater(this, pdfFile.getName(), this.getFile(),
 | 
					 | 
				
			||||||
						Updater.UpdateType.NO_DOWNLOAD, true);
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		MessageM.sendFMessage(null, ConfigC.log_enabledPlugin, "name-"
 | 
					 | 
				
			||||||
				+ BlockHunt.pdfFile.getName(),
 | 
					 | 
				
			||||||
				"version-" + BlockHunt.pdfFile.getVersion(), "autors-"
 | 
					 | 
				
			||||||
				+ BlockHunt.pdfFile.getAuthors().get(0));
 | 
									+ BlockHunt.pdfFile.getAuthors().get(0));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Welcome to the massive game loop!!
 | 
				
			||||||
		getServer().getScheduler().runTaskTimer(this, new Runnable() {
 | 
							getServer().getScheduler().runTaskTimer(this, new Runnable() {
 | 
				
			||||||
			@SuppressWarnings("deprecation")
 | 
								@SuppressWarnings("deprecation")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			@Override
 | 
								@Override
 | 
				
			||||||
			public void run() {
 | 
								public void run() {
 | 
				
			||||||
				for (Arena arena : W.arenaList) {
 | 
									for (Arena arena : W.arenaList) {
 | 
				
			||||||
@@ -320,74 +194,41 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
						if (arena.playersInArena.size() >= arena.minPlayers) {
 | 
											if (arena.playersInArena.size() >= arena.minPlayers) {
 | 
				
			||||||
							arena.gameState = ArenaState.STARTING;
 | 
												arena.gameState = ArenaState.STARTING;
 | 
				
			||||||
							arena.timer = arena.timeInLobbyUntilStart;
 | 
												arena.timer = arena.timeInLobbyUntilStart;
 | 
				
			||||||
							ArenaHandler.sendFMessage(arena,
 | 
												ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-" + arena.timeInLobbyUntilStart);
 | 
				
			||||||
									ConfigC.normal_lobbyArenaIsStarting, "1-"
 | 
					 | 
				
			||||||
											+ arena.timeInLobbyUntilStart);
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					} else if (arena.gameState == ArenaState.STARTING) {
 | 
										} else if (arena.gameState == ArenaState.STARTING) {
 | 
				
			||||||
						arena.timer = arena.timer - 1;
 | 
											arena.timer = arena.timer - 1;
 | 
				
			||||||
						if (arena.timer > 0) {
 | 
											if (arena.timer > 0) {
 | 
				
			||||||
							if (arena.timer == 60) {
 | 
												if (arena.timer == 60) {
 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-60");
 | 
				
			||||||
										ConfigC.normal_lobbyArenaIsStarting,
 | 
					 | 
				
			||||||
										"1-60");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 30) {
 | 
												} else if (arena.timer == 30) {
 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-30");
 | 
				
			||||||
										ConfigC.normal_lobbyArenaIsStarting,
 | 
					 | 
				
			||||||
										"1-30");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 10) {
 | 
												} else if (arena.timer == 10) {
 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-10");
 | 
				
			||||||
										ConfigC.normal_lobbyArenaIsStarting,
 | 
					 | 
				
			||||||
										"1-10");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 5) {
 | 
												} else if (arena.timer == 5) {
 | 
				
			||||||
								arena.lobbyWarp.getWorld()
 | 
													arena.lobbyWarp.getWorld().playSound(arena.lobbyWarp, Sound.ORB_PICKUP, 1, 0);
 | 
				
			||||||
										.playSound(arena.lobbyWarp,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-5");
 | 
				
			||||||
												Sound.ORB_PICKUP, 1, 0);
 | 
					 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
					 | 
				
			||||||
										ConfigC.normal_lobbyArenaIsStarting,
 | 
					 | 
				
			||||||
										"1-5");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 4) {
 | 
												} else if (arena.timer == 4) {
 | 
				
			||||||
								arena.lobbyWarp.getWorld()
 | 
													arena.lobbyWarp.getWorld().playSound(arena.lobbyWarp, Sound.ORB_PICKUP, 1, 0);
 | 
				
			||||||
										.playSound(arena.lobbyWarp,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-4");
 | 
				
			||||||
												Sound.ORB_PICKUP, 1, 0);
 | 
					 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
					 | 
				
			||||||
										ConfigC.normal_lobbyArenaIsStarting,
 | 
					 | 
				
			||||||
										"1-4");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 3) {
 | 
												} else if (arena.timer == 3) {
 | 
				
			||||||
								arena.lobbyWarp.getWorld()
 | 
													arena.lobbyWarp.getWorld().playSound(arena.lobbyWarp, Sound.ORB_PICKUP, 1, 1);
 | 
				
			||||||
										.playSound(arena.lobbyWarp,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-3");
 | 
				
			||||||
												Sound.ORB_PICKUP, 1, 1);
 | 
					 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
					 | 
				
			||||||
										ConfigC.normal_lobbyArenaIsStarting,
 | 
					 | 
				
			||||||
										"1-3");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 2) {
 | 
												} else if (arena.timer == 2) {
 | 
				
			||||||
								arena.lobbyWarp.getWorld()
 | 
													arena.lobbyWarp.getWorld().playSound(arena.lobbyWarp, Sound.ORB_PICKUP, 1, 1);
 | 
				
			||||||
										.playSound(arena.lobbyWarp,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-2");
 | 
				
			||||||
												Sound.ORB_PICKUP, 1, 1);
 | 
					 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
					 | 
				
			||||||
										ConfigC.normal_lobbyArenaIsStarting,
 | 
					 | 
				
			||||||
										"1-2");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 1) {
 | 
												} else if (arena.timer == 1) {
 | 
				
			||||||
								arena.lobbyWarp.getWorld()
 | 
													arena.lobbyWarp.getWorld().playSound(arena.lobbyWarp, Sound.ORB_PICKUP, 1, 2);
 | 
				
			||||||
										.playSound(arena.lobbyWarp,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-1");
 | 
				
			||||||
												Sound.ORB_PICKUP, 1, 2);
 | 
					 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
					 | 
				
			||||||
										ConfigC.normal_lobbyArenaIsStarting,
 | 
					 | 
				
			||||||
										"1-1");
 | 
					 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						} else {
 | 
											} else {
 | 
				
			||||||
							arena.gameState = ArenaState.INGAME;
 | 
												arena.gameState = ArenaState.INGAME;
 | 
				
			||||||
							arena.timer = arena.gameTime;
 | 
												arena.timer = arena.gameTime;
 | 
				
			||||||
							ArenaHandler.sendFMessage(arena,
 | 
												ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaStarted, "secs-" + arena.waitingTimeSeeker);
 | 
				
			||||||
									ConfigC.normal_lobbyArenaStarted, "secs-"
 | 
					 | 
				
			||||||
											+ arena.waitingTimeSeeker);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
							for (int i = arena.amountSeekersOnStart; i > 0; i = i - 1) {
 | 
												for (int i = arena.amountSeekersOnStart; i > 0; i = i - 1) {
 | 
				
			||||||
								boolean loop = true;
 | 
													boolean loop = true;
 | 
				
			||||||
								Player seeker = arena.playersInArena
 | 
													Player seeker = arena.playersInArena.get(W.random.nextInt(arena.playersInArena.size()));
 | 
				
			||||||
										.get(W.random
 | 
					 | 
				
			||||||
												.nextInt(arena.playersInArena
 | 
					 | 
				
			||||||
														.size()));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
								for (Player playerCheck : arena.playersInArena) {
 | 
													for (Player playerCheck : arena.playersInArena) {
 | 
				
			||||||
									if (W.choosenSeeker.get(playerCheck) != null) {
 | 
														if (W.choosenSeeker.get(playerCheck) != null) {
 | 
				
			||||||
@@ -405,18 +246,12 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
								if (loop) {
 | 
													if (loop) {
 | 
				
			||||||
									if (!arena.seekers.contains(seeker)) {
 | 
														if (!arena.seekers.contains(seeker)) {
 | 
				
			||||||
										ArenaHandler
 | 
															ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameSeekerChoosen, "seeker-" + seeker.getName());
 | 
				
			||||||
												.sendFMessage(
 | 
					 | 
				
			||||||
														arena,
 | 
					 | 
				
			||||||
														ConfigC.normal_ingameSeekerChoosen,
 | 
					 | 
				
			||||||
														"seeker-"
 | 
					 | 
				
			||||||
																+ seeker.getName());
 | 
					 | 
				
			||||||
										arena.seekers.add(seeker);
 | 
															arena.seekers.add(seeker);
 | 
				
			||||||
										seeker.teleport(arena.seekersWarp);
 | 
															seeker.teleport(arena.seekersWarp);
 | 
				
			||||||
										seeker.getInventory().clear();
 | 
															seeker.getInventory().clear();
 | 
				
			||||||
										seeker.updateInventory();
 | 
															seeker.updateInventory();
 | 
				
			||||||
										W.seekertime.put(seeker,
 | 
															W.seekertime.put(seeker, arena.waitingTimeSeeker);
 | 
				
			||||||
												arena.waitingTimeSeeker);
 | 
					 | 
				
			||||||
									} else {
 | 
														} else {
 | 
				
			||||||
										i = i + 1;
 | 
															i = i + 1;
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
@@ -427,62 +262,30 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
								if (!arena.seekers.contains(arenaPlayer)) {
 | 
													if (!arena.seekers.contains(arenaPlayer)) {
 | 
				
			||||||
									arenaPlayer.getInventory().clear();
 | 
														arenaPlayer.getInventory().clear();
 | 
				
			||||||
									arenaPlayer.updateInventory();
 | 
														arenaPlayer.updateInventory();
 | 
				
			||||||
									ItemStack block = arena.disguiseBlocks.get(W.random
 | 
														ItemStack block = arena.disguiseBlocks.get(W.random.nextInt(arena.disguiseBlocks.size()));
 | 
				
			||||||
											.nextInt(arena.disguiseBlocks
 | 
					 | 
				
			||||||
													.size()));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
									if (W.choosenBlock.get(arenaPlayer) != null) {
 | 
														if (W.choosenBlock.get(arenaPlayer) != null) {
 | 
				
			||||||
										block = W.choosenBlock.get(arenaPlayer);
 | 
															block = W.choosenBlock.get(arenaPlayer);
 | 
				
			||||||
										W.choosenBlock.remove(arenaPlayer);
 | 
															W.choosenBlock.remove(arenaPlayer);
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									MiscDisguise disguise = new MiscDisguise(
 | 
														MiscDisguise disguise = new MiscDisguise(DisguiseType.FALLING_BLOCK, block.getTypeId(), block.getDurability());
 | 
				
			||||||
											DisguiseType.FALLING_BLOCK, block
 | 
														DisguiseAPI.disguiseToAll(arenaPlayer, disguise);
 | 
				
			||||||
													.getTypeId(), block
 | 
					 | 
				
			||||||
													.getDurability());
 | 
					 | 
				
			||||||
									DisguiseAPI.disguiseToAll(arenaPlayer,
 | 
					 | 
				
			||||||
											disguise);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
									arenaPlayer.teleport(arena.hidersWarp);
 | 
														arenaPlayer.teleport(arena.hidersWarp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									ItemStack blockCount = new ItemStack(block
 | 
														ItemStack blockCount = new ItemStack(block.getType(), 5);
 | 
				
			||||||
											.getType(), 5);
 | 
														blockCount.setDurability(block.getDurability());
 | 
				
			||||||
									blockCount.setDurability(block
 | 
														arenaPlayer.getInventory().setItem(8, blockCount);
 | 
				
			||||||
											.getDurability());
 | 
														arenaPlayer.getInventory().setHelmet(new ItemStack(block));
 | 
				
			||||||
									arenaPlayer.getInventory().setItem(8,
 | 
					 | 
				
			||||||
											blockCount);
 | 
					 | 
				
			||||||
									arenaPlayer.getInventory().setHelmet(
 | 
					 | 
				
			||||||
											new ItemStack(block));
 | 
					 | 
				
			||||||
									W.pBlock.put(arenaPlayer, block);
 | 
														W.pBlock.put(arenaPlayer, block);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									if (block.getDurability() != 0) {
 | 
														if (block.getDurability() != 0) {
 | 
				
			||||||
										MessageM.sendFMessage(
 | 
															MessageM.sendFMessage(arenaPlayer, ConfigC.normal_ingameBlock,
 | 
				
			||||||
												arenaPlayer,
 | 
																	"block-" + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase() + ":" + block.getDurability());
 | 
				
			||||||
												ConfigC.normal_ingameBlock,
 | 
					 | 
				
			||||||
												"block-"
 | 
					 | 
				
			||||||
														+ block.getType()
 | 
					 | 
				
			||||||
																.name()
 | 
					 | 
				
			||||||
																.replaceAll(
 | 
					 | 
				
			||||||
																		"_", "")
 | 
					 | 
				
			||||||
																.replaceAll(
 | 
					 | 
				
			||||||
																		"BLOCK",
 | 
					 | 
				
			||||||
																		"")
 | 
					 | 
				
			||||||
																.toLowerCase()
 | 
					 | 
				
			||||||
														+ ":"
 | 
					 | 
				
			||||||
														+ block.getDurability());
 | 
					 | 
				
			||||||
									} else {
 | 
														} else {
 | 
				
			||||||
										MessageM.sendFMessage(
 | 
															MessageM.sendFMessage(arenaPlayer, ConfigC.normal_ingameBlock,
 | 
				
			||||||
												arenaPlayer,
 | 
																	"block-" + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase());
 | 
				
			||||||
												ConfigC.normal_ingameBlock,
 | 
					 | 
				
			||||||
												"block-"
 | 
					 | 
				
			||||||
														+ block.getType()
 | 
					 | 
				
			||||||
																.name()
 | 
					 | 
				
			||||||
																.replaceAll(
 | 
					 | 
				
			||||||
																		"_", "")
 | 
					 | 
				
			||||||
																.replaceAll(
 | 
					 | 
				
			||||||
																		"BLOCK",
 | 
					 | 
				
			||||||
																		"")
 | 
					 | 
				
			||||||
																.toLowerCase());
 | 
					 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
@@ -490,31 +293,21 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
					}
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					for (Player player : arena.seekers) {
 | 
										for (Player player : arena.seekers) {
 | 
				
			||||||
						if (player.getInventory().getItem(0) == null
 | 
											if (player.getInventory().getItem(0) == null || player.getInventory().getItem(0).getType() != Material.DIAMOND_SWORD) {
 | 
				
			||||||
								|| player.getInventory().getItem(0).getType() != Material.DIAMOND_SWORD) {
 | 
												player.getInventory().setItem(0, new ItemStack(Material.DIAMOND_SWORD, 1));
 | 
				
			||||||
							player.getInventory().setItem(0,
 | 
												player.getInventory().setHelmet(new ItemStack(Material.IRON_HELMET, 1));
 | 
				
			||||||
									new ItemStack(Material.DIAMOND_SWORD, 1));
 | 
												player.getInventory().setChestplate(new ItemStack(Material.IRON_CHESTPLATE, 1));
 | 
				
			||||||
							player.getInventory().setHelmet(
 | 
												player.getInventory().setLeggings(new ItemStack(Material.IRON_LEGGINGS, 1));
 | 
				
			||||||
									new ItemStack(Material.IRON_HELMET, 1));
 | 
												player.getInventory().setBoots(new ItemStack(Material.IRON_BOOTS, 1));
 | 
				
			||||||
							player.getInventory().setChestplate(
 | 
												player.playSound(player.getLocation(), Sound.ANVIL_USE, 1, 1);
 | 
				
			||||||
									new ItemStack(Material.IRON_CHESTPLATE, 1));
 | 
					 | 
				
			||||||
							player.getInventory().setLeggings(
 | 
					 | 
				
			||||||
									new ItemStack(Material.IRON_LEGGINGS, 1));
 | 
					 | 
				
			||||||
							player.getInventory().setBoots(
 | 
					 | 
				
			||||||
									new ItemStack(Material.IRON_BOOTS, 1));
 | 
					 | 
				
			||||||
							player.playSound(player.getLocation(),
 | 
					 | 
				
			||||||
									Sound.ANVIL_USE, 1, 1);
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						if (W.seekertime.get(player) != null) {
 | 
											if (W.seekertime.get(player) != null) {
 | 
				
			||||||
							W.seekertime.put(player,
 | 
												W.seekertime.put(player, W.seekertime.get(player) - 1);
 | 
				
			||||||
									W.seekertime.get(player) - 1);
 | 
					 | 
				
			||||||
							if (W.seekertime.get(player) <= 0) {
 | 
												if (W.seekertime.get(player) <= 0) {
 | 
				
			||||||
								player.teleport(arena.hidersWarp);
 | 
													player.teleport(arena.hidersWarp);
 | 
				
			||||||
								W.seekertime.remove(player);
 | 
													W.seekertime.remove(player);
 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameSeekerSpawned, "playername-" + player.getName());
 | 
				
			||||||
										ConfigC.normal_ingameSeekerSpawned,
 | 
					 | 
				
			||||||
										"playername-" + player.getName());
 | 
					 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
@@ -522,63 +315,39 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
					if (arena.gameState == ArenaState.INGAME) {
 | 
										if (arena.gameState == ArenaState.INGAME) {
 | 
				
			||||||
						arena.timer = arena.timer - 1;
 | 
											arena.timer = arena.timer - 1;
 | 
				
			||||||
						if (arena.timer > 0) {
 | 
											if (arena.timer > 0) {
 | 
				
			||||||
							if (arena.timer == arena.gameTime
 | 
												if (arena.timer == arena.gameTime - arena.timeUntilHidersSword) {
 | 
				
			||||||
									- arena.timeUntilHidersSword) {
 | 
													ItemStack sword = new ItemStack(Material.WOOD_SWORD, 1);
 | 
				
			||||||
								ItemStack sword = new ItemStack(
 | 
													sword.addUnsafeEnchantment(Enchantment.KNOCKBACK, 1);
 | 
				
			||||||
										Material.WOOD_SWORD, 1);
 | 
					 | 
				
			||||||
								sword.addUnsafeEnchantment(
 | 
					 | 
				
			||||||
										Enchantment.KNOCKBACK, 1);
 | 
					 | 
				
			||||||
								for (Player arenaPlayer : arena.playersInArena) {
 | 
													for (Player arenaPlayer : arena.playersInArena) {
 | 
				
			||||||
									if (!arena.seekers.contains(arenaPlayer)) {
 | 
														if (!arena.seekers.contains(arenaPlayer)) {
 | 
				
			||||||
										arenaPlayer.getInventory().addItem(
 | 
															arenaPlayer.getInventory().addItem(sword);
 | 
				
			||||||
												sword);
 | 
															MessageM.sendFMessage(arenaPlayer, ConfigC.normal_ingameGivenSword);
 | 
				
			||||||
										MessageM.sendFMessage(arenaPlayer,
 | 
					 | 
				
			||||||
												ConfigC.normal_ingameGivenSword);
 | 
					 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
							if (arena.timer == 190) {
 | 
												if (arena.timer == 190) {
 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameArenaEnd, "1-190");
 | 
				
			||||||
										ConfigC.normal_ingameArenaEnd, "1-190");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 60) {
 | 
												} else if (arena.timer == 60) {
 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameArenaEnd, "1-60");
 | 
				
			||||||
										ConfigC.normal_ingameArenaEnd, "1-60");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 30) {
 | 
												} else if (arena.timer == 30) {
 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameArenaEnd, "1-30");
 | 
				
			||||||
										ConfigC.normal_ingameArenaEnd, "1-30");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 10) {
 | 
												} else if (arena.timer == 10) {
 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameArenaEnd, "1-10");
 | 
				
			||||||
										ConfigC.normal_ingameArenaEnd, "1-10");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 5) {
 | 
												} else if (arena.timer == 5) {
 | 
				
			||||||
								arena.lobbyWarp.getWorld()
 | 
													arena.lobbyWarp.getWorld().playSound(arena.lobbyWarp, Sound.ORB_PICKUP, 1, 0);
 | 
				
			||||||
										.playSound(arena.lobbyWarp,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameArenaEnd, "1-5");
 | 
				
			||||||
												Sound.ORB_PICKUP, 1, 0);
 | 
					 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
					 | 
				
			||||||
										ConfigC.normal_ingameArenaEnd, "1-5");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 4) {
 | 
												} else if (arena.timer == 4) {
 | 
				
			||||||
								arena.lobbyWarp.getWorld()
 | 
													arena.lobbyWarp.getWorld().playSound(arena.lobbyWarp, Sound.ORB_PICKUP, 1, 0);
 | 
				
			||||||
										.playSound(arena.lobbyWarp,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameArenaEnd, "1-4");
 | 
				
			||||||
												Sound.ORB_PICKUP, 1, 0);
 | 
					 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
					 | 
				
			||||||
										ConfigC.normal_ingameArenaEnd, "1-4");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 3) {
 | 
												} else if (arena.timer == 3) {
 | 
				
			||||||
								arena.lobbyWarp.getWorld()
 | 
													arena.lobbyWarp.getWorld().playSound(arena.lobbyWarp, Sound.ORB_PICKUP, 1, 1);
 | 
				
			||||||
										.playSound(arena.lobbyWarp,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameArenaEnd, "1-3");
 | 
				
			||||||
												Sound.ORB_PICKUP, 1, 1);
 | 
					 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
					 | 
				
			||||||
										ConfigC.normal_ingameArenaEnd, "1-3");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 2) {
 | 
												} else if (arena.timer == 2) {
 | 
				
			||||||
								arena.lobbyWarp.getWorld()
 | 
													arena.lobbyWarp.getWorld().playSound(arena.lobbyWarp, Sound.ORB_PICKUP, 1, 1);
 | 
				
			||||||
										.playSound(arena.lobbyWarp,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameArenaEnd, "1-2");
 | 
				
			||||||
												Sound.ORB_PICKUP, 1, 1);
 | 
					 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
					 | 
				
			||||||
										ConfigC.normal_ingameArenaEnd, "1-2");
 | 
					 | 
				
			||||||
							} else if (arena.timer == 1) {
 | 
												} else if (arena.timer == 1) {
 | 
				
			||||||
								arena.lobbyWarp.getWorld()
 | 
													arena.lobbyWarp.getWorld().playSound(arena.lobbyWarp, Sound.ORB_PICKUP, 1, 2);
 | 
				
			||||||
										.playSound(arena.lobbyWarp,
 | 
													ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameArenaEnd, "1-1");
 | 
				
			||||||
												Sound.ORB_PICKUP, 1, 2);
 | 
					 | 
				
			||||||
								ArenaHandler.sendFMessage(arena,
 | 
					 | 
				
			||||||
										ConfigC.normal_ingameArenaEnd, "1-1");
 | 
					 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						} else {
 | 
											} else {
 | 
				
			||||||
							ArenaHandler.hidersWin(arena);
 | 
												ArenaHandler.hidersWin(arena);
 | 
				
			||||||
@@ -589,8 +358,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
							if (!arena.seekers.contains(player)) {
 | 
												if (!arena.seekers.contains(player)) {
 | 
				
			||||||
								Location pLoc = player.getLocation();
 | 
													Location pLoc = player.getLocation();
 | 
				
			||||||
								Location moveLoc = W.moveLoc.get(player);
 | 
													Location moveLoc = W.moveLoc.get(player);
 | 
				
			||||||
								ItemStack block = player.getInventory()
 | 
													ItemStack block = player.getInventory().getItem(8);
 | 
				
			||||||
										.getItem(8);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
								if (block == null) {
 | 
													if (block == null) {
 | 
				
			||||||
									if (W.pBlock.get(player) != null) {
 | 
														if (W.pBlock.get(player) != null) {
 | 
				
			||||||
@@ -601,126 +369,69 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
								}
 | 
													}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
								if (moveLoc != null) {
 | 
													if (moveLoc != null) {
 | 
				
			||||||
									if (moveLoc.getX() == pLoc.getX()
 | 
														if (moveLoc.getX() == pLoc.getX() && moveLoc.getY() == pLoc.getY() && moveLoc.getZ() == pLoc.getZ()) {
 | 
				
			||||||
											&& moveLoc.getY() == pLoc.getY()
 | 
					 | 
				
			||||||
											&& moveLoc.getZ() == pLoc.getZ()) {
 | 
					 | 
				
			||||||
										if (block.getAmount() > 1) {
 | 
															if (block.getAmount() > 1) {
 | 
				
			||||||
											block.setAmount(block.getAmount() - 1);
 | 
																block.setAmount(block.getAmount() - 1);
 | 
				
			||||||
										} else {
 | 
															} else {
 | 
				
			||||||
											Block pBlock = player.getLocation()
 | 
																Block pBlock = player.getLocation().getBlock();
 | 
				
			||||||
													.getBlock();
 | 
																if (pBlock.getType().equals(Material.AIR) || pBlock.getType().equals(Material.WATER)
 | 
				
			||||||
											if (pBlock.getType().equals(
 | 
																		|| pBlock.getType().equals(Material.STATIONARY_WATER)) {
 | 
				
			||||||
													Material.AIR)
 | 
																	if (pBlock.getType().equals(Material.WATER) || pBlock.getType().equals(Material.STATIONARY_WATER)) {
 | 
				
			||||||
													|| pBlock.getType().equals(
 | 
																		W.hiddenLocWater.put(player, true);
 | 
				
			||||||
															Material.WATER)
 | 
					 | 
				
			||||||
													|| pBlock
 | 
					 | 
				
			||||||
															.getType()
 | 
					 | 
				
			||||||
															.equals(Material.STATIONARY_WATER)) {
 | 
					 | 
				
			||||||
												if (pBlock.getType().equals(
 | 
					 | 
				
			||||||
														Material.WATER)
 | 
					 | 
				
			||||||
														|| pBlock
 | 
					 | 
				
			||||||
																.getType()
 | 
					 | 
				
			||||||
																.equals(Material.STATIONARY_WATER)) {
 | 
					 | 
				
			||||||
													W.hiddenLocWater.put(
 | 
					 | 
				
			||||||
															player, true);
 | 
					 | 
				
			||||||
												} else {
 | 
																	} else {
 | 
				
			||||||
													W.hiddenLocWater.put(
 | 
																		W.hiddenLocWater.put(player, false);
 | 
				
			||||||
															player, false);
 | 
					 | 
				
			||||||
												}
 | 
																	}
 | 
				
			||||||
												if (DisguiseAPI
 | 
																	if (DisguiseAPI.isDisguised(player)) {
 | 
				
			||||||
														.isDisguised(player)) {
 | 
																		DisguiseAPI.undisguiseToAll(player);
 | 
				
			||||||
													DisguiseAPI
 | 
																		for (Player pl : Bukkit.getOnlinePlayers()) {
 | 
				
			||||||
															.undisguiseToAll(player);
 | 
					 | 
				
			||||||
													for (Player pl : Bukkit
 | 
					 | 
				
			||||||
															.getOnlinePlayers()) {
 | 
					 | 
				
			||||||
														if (!pl.equals(player)) {
 | 
																			if (!pl.equals(player)) {
 | 
				
			||||||
															pl.hidePlayer(player);
 | 
																				pl.hidePlayer(player);
 | 
				
			||||||
															pl.sendBlockChange(
 | 
																				pl.sendBlockChange(pBlock.getLocation(), block.getType(), (byte) block.getDurability());
 | 
				
			||||||
																	pBlock.getLocation(),
 | 
					 | 
				
			||||||
																	block.getType(),
 | 
					 | 
				
			||||||
																	(byte) block
 | 
					 | 
				
			||||||
																			.getDurability());
 | 
					 | 
				
			||||||
														}
 | 
																			}
 | 
				
			||||||
													}
 | 
																		}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
													block.addUnsafeEnchantment(
 | 
																		block.addUnsafeEnchantment(Enchantment.DURABILITY, 10);
 | 
				
			||||||
															Enchantment.DURABILITY,
 | 
																		player.playSound(pLoc, Sound.ORB_PICKUP, 1, 1);
 | 
				
			||||||
															10);
 | 
																		W.hiddenLoc.put(player, moveLoc);
 | 
				
			||||||
													player.playSound(pLoc,
 | 
					 | 
				
			||||||
															Sound.ORB_PICKUP,
 | 
					 | 
				
			||||||
															1, 1);
 | 
					 | 
				
			||||||
													W.hiddenLoc.put(player,
 | 
					 | 
				
			||||||
															moveLoc);
 | 
					 | 
				
			||||||
													if (block.getDurability() != 0) {
 | 
																		if (block.getDurability() != 0) {
 | 
				
			||||||
														MessageM.sendFMessage(
 | 
																			MessageM.sendFMessage(
 | 
				
			||||||
																player,
 | 
																					player,
 | 
				
			||||||
																ConfigC.normal_ingameNowSolid,
 | 
																					ConfigC.normal_ingameNowSolid,
 | 
				
			||||||
																"block-"
 | 
																					"block-" + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase() + ":"
 | 
				
			||||||
																		+ block.getType()
 | 
					 | 
				
			||||||
																				.name()
 | 
					 | 
				
			||||||
																				.replaceAll(
 | 
					 | 
				
			||||||
																						"_",
 | 
					 | 
				
			||||||
																						"")
 | 
					 | 
				
			||||||
																				.replaceAll(
 | 
					 | 
				
			||||||
																						"BLOCK",
 | 
					 | 
				
			||||||
																						"")
 | 
					 | 
				
			||||||
																				.toLowerCase()
 | 
					 | 
				
			||||||
																		+ ":"
 | 
					 | 
				
			||||||
																		+ block.getDurability());
 | 
																							+ block.getDurability());
 | 
				
			||||||
													} else {
 | 
																		} else {
 | 
				
			||||||
														MessageM.sendFMessage(
 | 
																			MessageM.sendFMessage(player, ConfigC.normal_ingameNowSolid, "block-"
 | 
				
			||||||
																player,
 | 
																					+ block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase());
 | 
				
			||||||
																ConfigC.normal_ingameNowSolid,
 | 
					 | 
				
			||||||
																"block-"
 | 
					 | 
				
			||||||
																		+ block.getType()
 | 
					 | 
				
			||||||
																				.name()
 | 
					 | 
				
			||||||
																				.replaceAll(
 | 
					 | 
				
			||||||
																						"_",
 | 
					 | 
				
			||||||
																						"")
 | 
					 | 
				
			||||||
																				.replaceAll(
 | 
					 | 
				
			||||||
																						"BLOCK",
 | 
					 | 
				
			||||||
																						"")
 | 
					 | 
				
			||||||
																				.toLowerCase());
 | 
					 | 
				
			||||||
													}
 | 
																		}
 | 
				
			||||||
												}
 | 
																	}
 | 
				
			||||||
												for (Player pl : Bukkit
 | 
																	for (Player pl : Bukkit.getOnlinePlayers()) {
 | 
				
			||||||
														.getOnlinePlayers()) {
 | 
					 | 
				
			||||||
													if (!pl.equals(player)) {
 | 
																		if (!pl.equals(player)) {
 | 
				
			||||||
														pl.hidePlayer(player);
 | 
																			pl.hidePlayer(player);
 | 
				
			||||||
														pl.sendBlockChange(
 | 
																			pl.sendBlockChange(pBlock.getLocation(), block.getType(), (byte) block.getDurability());
 | 
				
			||||||
																pBlock.getLocation(),
 | 
					 | 
				
			||||||
																block.getType(),
 | 
					 | 
				
			||||||
																(byte) block
 | 
					 | 
				
			||||||
																		.getDurability());
 | 
					 | 
				
			||||||
													}
 | 
																		}
 | 
				
			||||||
												}
 | 
																	}
 | 
				
			||||||
											} else {
 | 
																} else {
 | 
				
			||||||
												MessageM.sendFMessage(
 | 
																	MessageM.sendFMessage(player, ConfigC.warning_ingameNoSolidPlace);
 | 
				
			||||||
														player,
 | 
					 | 
				
			||||||
														ConfigC.warning_ingameNoSolidPlace);
 | 
					 | 
				
			||||||
											}
 | 
																}
 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
									} else {
 | 
														} else {
 | 
				
			||||||
										block.setAmount(5);
 | 
															block.setAmount(5);
 | 
				
			||||||
										if (!DisguiseAPI.isDisguised(player)) {
 | 
															if (!DisguiseAPI.isDisguised(player)) {
 | 
				
			||||||
											SolidBlockHandler
 | 
																SolidBlockHandler.makePlayerUnsolid(player);
 | 
				
			||||||
													.makePlayerUnsolid(player);
 | 
					 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
											ScoreboardHandler.updateScoreboard(arena); // TODO Only do this when needed (player added/removed) 
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					for (Player pl : arena.playersInArena) {
 | 
										for (Player pl : arena.playersInArena) {
 | 
				
			||||||
						pl.setLevel(arena.timer);
 | 
											pl.setLevel(arena.timer);
 | 
				
			||||||
						pl.setGameMode(GameMode.SURVIVAL);
 | 
											pl.setGameMode(GameMode.SURVIVAL);
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
					 | 
				
			||||||
					ScoreboardHandler.updateScoreboard(arena);
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
									SignsHandler.updateSigns(); //TODO Only do this when needed (gamestate change or player count change)
 | 
				
			||||||
				SignsHandler.updateSigns();
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}, 0, 20);
 | 
							}, 0, 20);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -730,9 +441,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
			ArenaHandler.stopArena(arena);
 | 
								ArenaHandler.stopArena(arena);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		MessageM.sendFMessage(null, ConfigC.log_disabledPlugin, "name-"
 | 
							MessageM.sendFMessage(null, ConfigC.log_disabledPlugin, "name-" + BlockHunt.pdfFile.getName(), "version-" + BlockHunt.pdfFile.getVersion(), "autors-"
 | 
				
			||||||
				+ BlockHunt.pdfFile.getName(),
 | 
					 | 
				
			||||||
				"version-" + BlockHunt.pdfFile.getVersion(), "autors-"
 | 
					 | 
				
			||||||
				+ BlockHunt.pdfFile.getAuthors().get(0));
 | 
									+ BlockHunt.pdfFile.getAuthors().get(0));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -758,8 +467,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean onCommand(CommandSender sender, Command cmd, String label,
 | 
						public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		Player player = null;
 | 
							Player player = null;
 | 
				
			||||||
		if (sender instanceof Player) {
 | 
							if (sender instanceof Player) {
 | 
				
			||||||
			player = (Player) sender;
 | 
								player = (Player) sender;
 | 
				
			||||||
@@ -787,9 +495,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
					if (args.length >= argsSplit.length) {
 | 
										if (args.length >= argsSplit.length) {
 | 
				
			||||||
						for (int i2 = argsSplit.length - 1; i2 >= 0; i2 = i2 - 1) {
 | 
											for (int i2 = argsSplit.length - 1; i2 >= 0; i2 = i2 - 1) {
 | 
				
			||||||
							int loc = argsSplit.length - i2 - 1;
 | 
												int loc = argsSplit.length - i2 - 1;
 | 
				
			||||||
							if (!argsSplit[loc].equalsIgnoreCase(args[loc])
 | 
												if (!argsSplit[loc].equalsIgnoreCase(args[loc]) && !argsSplitAlias[loc].equalsIgnoreCase(args[loc])) {
 | 
				
			||||||
									&& !argsSplitAlias[loc]
 | 
					 | 
				
			||||||
											.equalsIgnoreCase(args[loc])) {
 | 
					 | 
				
			||||||
								equals = false;
 | 
													equals = false;
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
@@ -803,8 +509,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
						if (command.enabled) {
 | 
											if (command.enabled) {
 | 
				
			||||||
							command.CMD.exectue(player, cmd, label, args);
 | 
												command.CMD.exectue(player, cmd, label, args);
 | 
				
			||||||
						} else {
 | 
											} else {
 | 
				
			||||||
							MessageM.sendFMessage(player,
 | 
												MessageM.sendFMessage(player, ConfigC.error_commandNotEnabled);
 | 
				
			||||||
									ConfigC.error_commandNotEnabled);
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -818,8 +523,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public List<String> onTabComplete(CommandSender sender, Command cmd,
 | 
						public List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String label, String[] args) {
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (CommandM command : W.commands) {
 | 
							for (CommandM command : W.commands) {
 | 
				
			||||||
			if (cmd.getName().equalsIgnoreCase(command.label)) {
 | 
								if (cmd.getName().equalsIgnoreCase(command.label)) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,26 +18,16 @@ import org.bukkit.inventory.ItemStack;
 | 
				
			|||||||
public class CMDcreate extends DefaultCMD {
 | 
					public class CMDcreate extends DefaultCMD {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		if (player != null) {
 | 
							if (player != null) {
 | 
				
			||||||
			if (args.length <= 1) {
 | 
								if (args.length <= 1) {
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments,
 | 
									MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDcreate.usage);
 | 
				
			||||||
						"syntax-" + BlockHunt.CMDcreate.usage);
 | 
					 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				if (W.pos1.get(player) != null && W.pos2.get(player) != null) {
 | 
									if (W.pos1.get(player) != null && W.pos2.get(player) != null) {
 | 
				
			||||||
					if (W.pos1.get(player).getWorld()
 | 
										if (W.pos1.get(player).getWorld().equals(W.pos2.get(player).getWorld())) {
 | 
				
			||||||
							.equals(W.pos2.get(player).getWorld())) {
 | 
											Arena arena = new Arena(args[1], W.pos1.get(player), W.pos2.get(player), 12, 3, 1, 50, 20, 300, 30, new ArrayList<ItemStack>(), null, null, null,
 | 
				
			||||||
						Arena arena = new Arena(args[1], W.pos1.get(player),
 | 
													null, new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), 10, 50, 8, new ArrayList<Player>(), ArenaState.WAITING,
 | 
				
			||||||
								W.pos2.get(player), 12, 3, 1, 50, 20, 300, 30,
 | 
													0, new ArrayList<Player>(), Bukkit.getScoreboardManager().getNewScoreboard());
 | 
				
			||||||
								new ArrayList<ItemStack>(), null, null, null,
 | 
					 | 
				
			||||||
								null, new ArrayList<String>(),
 | 
					 | 
				
			||||||
								new ArrayList<String>(),
 | 
					 | 
				
			||||||
								new ArrayList<String>(), 10, 50, 8,
 | 
					 | 
				
			||||||
								new ArrayList<Player>(), ArenaState.WAITING, 0,
 | 
					 | 
				
			||||||
								new ArrayList<Player>(), Bukkit
 | 
					 | 
				
			||||||
										.getScoreboardManager()
 | 
					 | 
				
			||||||
										.getNewScoreboard());
 | 
					 | 
				
			||||||
						W.arenas.getFile().set(args[1], arena);
 | 
											W.arenas.getFile().set(args[1], arena);
 | 
				
			||||||
						W.arenas.save();
 | 
											W.arenas.save();
 | 
				
			||||||
						W.signs.load();
 | 
											W.signs.load();
 | 
				
			||||||
@@ -45,16 +35,12 @@ public class CMDcreate extends DefaultCMD {
 | 
				
			|||||||
						W.arenaList.add(arena);
 | 
											W.arenaList.add(arena);
 | 
				
			||||||
						ScoreboardHandler.createScoreboard(arena);
 | 
											ScoreboardHandler.createScoreboard(arena);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						MessageM.sendFMessage(player,
 | 
											MessageM.sendFMessage(player, ConfigC.normal_createCreatedArena, "name-" + args[1]);
 | 
				
			||||||
								ConfigC.normal_createCreatedArena, "name-"
 | 
					 | 
				
			||||||
										+ args[1]);
 | 
					 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
						MessageM.sendFMessage(player,
 | 
											MessageM.sendFMessage(player, ConfigC.error_createNotSameWorld);
 | 
				
			||||||
								ConfigC.error_createNotSameWorld);
 | 
					 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					MessageM.sendFMessage(player,
 | 
										MessageM.sendFMessage(player, ConfigC.error_createSelectionFirst);
 | 
				
			||||||
							ConfigC.error_createSelectionFirst);
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,8 +24,7 @@ public class CMDhelp extends DefaultCMD {
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		int amountCommands = 0;
 | 
							int amountCommands = 0;
 | 
				
			||||||
		for (CommandM command : W.commands) {
 | 
							for (CommandM command : W.commands) {
 | 
				
			||||||
			if (command.usage != null) {
 | 
								if (command.usage != null) {
 | 
				
			||||||
@@ -40,38 +39,22 @@ public class CMDhelp extends DefaultCMD {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		if (args.length == 1) {
 | 
							if (args.length == 1) {
 | 
				
			||||||
			int page = 1;
 | 
								int page = 1;
 | 
				
			||||||
			MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-"
 | 
								MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName() + " %Nhelp page %A" + page + "%N/%A" + maxPages);
 | 
				
			||||||
					+ BlockHunt.pdfFile.getName() + " %Nhelp page %A"
 | 
					 | 
				
			||||||
					+ page + "%N/%A" + maxPages);
 | 
					 | 
				
			||||||
			int i = 1;
 | 
								int i = 1;
 | 
				
			||||||
			for (CommandM command : W.commands) {
 | 
								for (CommandM command : W.commands) {
 | 
				
			||||||
				if (i <= 4) {
 | 
									if (i <= 4) {
 | 
				
			||||||
					if (command.usage != null) {
 | 
										if (command.usage != null) {
 | 
				
			||||||
						if (PermissionsM.hasPerm(player, command.permission,
 | 
											if (PermissionsM.hasPerm(player, command.permission, false)) {
 | 
				
			||||||
								false)) {
 | 
												MessageM.sendMessage(player, "%A" + command.usage + "%N - " + W.messages.getFile().get(command.help.location));
 | 
				
			||||||
							MessageM.sendMessage(
 | 
					 | 
				
			||||||
									player,
 | 
					 | 
				
			||||||
									"%A"
 | 
					 | 
				
			||||||
											+ command.usage
 | 
					 | 
				
			||||||
											+ "%N - "
 | 
					 | 
				
			||||||
											+ W.messages.getFile().get(
 | 
					 | 
				
			||||||
													command.help.location));
 | 
					 | 
				
			||||||
						} else {
 | 
											} else {
 | 
				
			||||||
							MessageM.sendMessage(
 | 
												MessageM.sendMessage(player, "%W" + command.usage + "%N - " + W.messages.getFile().get(command.help.location));
 | 
				
			||||||
									player,
 | 
					 | 
				
			||||||
									"%W"
 | 
					 | 
				
			||||||
											+ command.usage
 | 
					 | 
				
			||||||
											+ "%N - "
 | 
					 | 
				
			||||||
											+ W.messages.getFile().get(
 | 
					 | 
				
			||||||
													command.help.location));
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
						i = i + 1;
 | 
											i = i + 1;
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			MessageM.sendFMessage(player, ConfigC.chat_headerhigh,
 | 
								MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oHelp Page");
 | 
				
			||||||
					"header-&oHelp Page");
 | 
					 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			int page = 1;
 | 
								int page = 1;
 | 
				
			||||||
			try {
 | 
								try {
 | 
				
			||||||
@@ -84,41 +67,24 @@ public class CMDhelp extends DefaultCMD {
 | 
				
			|||||||
				maxPages = page;
 | 
									maxPages = page;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-"
 | 
								MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName() + " %Nhelp page %A" + page + "%N/%A" + maxPages);
 | 
				
			||||||
					+ BlockHunt.pdfFile.getName() + " %Nhelp page %A"
 | 
					 | 
				
			||||||
					+ page + "%N/%A" + maxPages);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			int i = 1;
 | 
								int i = 1;
 | 
				
			||||||
			for (CommandM command : W.commands) {
 | 
								for (CommandM command : W.commands) {
 | 
				
			||||||
				if (i <= (page * 4) + 4) {
 | 
									if (i <= (page * 4) + 4) {
 | 
				
			||||||
					if (command.usage != null) {
 | 
										if (command.usage != null) {
 | 
				
			||||||
						if (i >= ((page - 1) * 4) + 1
 | 
											if (i >= ((page - 1) * 4) + 1 && i <= ((page - 1) * 4) + 4) {
 | 
				
			||||||
								&& i <= ((page - 1) * 4) + 4) {
 | 
												if (PermissionsM.hasPerm(player, command.permission, false)) {
 | 
				
			||||||
							if (PermissionsM.hasPerm(player,
 | 
													MessageM.sendMessage(player, "%A" + command.usage + "%N - " + W.messages.getFile().get(command.help.location));
 | 
				
			||||||
									command.permission, false)) {
 | 
					 | 
				
			||||||
								MessageM.sendMessage(
 | 
					 | 
				
			||||||
										player,
 | 
					 | 
				
			||||||
										"%A"
 | 
					 | 
				
			||||||
												+ command.usage
 | 
					 | 
				
			||||||
												+ "%N - "
 | 
					 | 
				
			||||||
												+ W.messages.getFile().get(
 | 
					 | 
				
			||||||
														command.help.location));
 | 
					 | 
				
			||||||
							} else {
 | 
												} else {
 | 
				
			||||||
								MessageM.sendMessage(
 | 
													MessageM.sendMessage(player, "%W" + command.usage + "%N - " + W.messages.getFile().get(command.help.location));
 | 
				
			||||||
										player,
 | 
					 | 
				
			||||||
										"%W"
 | 
					 | 
				
			||||||
												+ command.usage
 | 
					 | 
				
			||||||
												+ "%N - "
 | 
					 | 
				
			||||||
												+ W.messages.getFile().get(
 | 
					 | 
				
			||||||
														command.help.location));
 | 
					 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
						i = i + 1;
 | 
											i = i + 1;
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			MessageM.sendFMessage(player, ConfigC.chat_headerhigh,
 | 
								MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oHelp Page");
 | 
				
			||||||
					"header-&oHelp Page");
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,23 +21,15 @@ public class CMDinfo extends DefaultCMD {
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
							MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName());
 | 
				
			||||||
		MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-"
 | 
							MessageM.sendMessage(player, "%A%name%%N made by %A%autors%%N.", "name-" + BlockHunt.pdfFile.getName(), "autors-" + BlockHunt.pdfFile.getAuthors().get(0));
 | 
				
			||||||
				+ BlockHunt.pdfFile.getName());
 | 
							MessageM.sendMessage(player, "%NVersion: %A%version%%N.", "version-" + BlockHunt.pdfFile.getVersion());
 | 
				
			||||||
		MessageM.sendMessage(player, "%A%name%%N made by %A%autors%%N.",
 | 
							MessageM.sendMessage(player, "%NType %A%helpusage% %Nfor help.", "helpusage-" + BlockHunt.CMDhelp.usage);
 | 
				
			||||||
				"name-" + BlockHunt.pdfFile.getName(), "autors-"
 | 
							MessageM.sendMessage(player, "%NDev-Page: %Ahttp://dev.bukkit.org/bukkit-plugins/blockhunt/");
 | 
				
			||||||
						+ BlockHunt.pdfFile.getAuthors().get(0));
 | 
					 | 
				
			||||||
		MessageM.sendMessage(player, "%NVersion: %A%version%%N.", "version-"
 | 
					 | 
				
			||||||
				+ BlockHunt.pdfFile.getVersion());
 | 
					 | 
				
			||||||
		MessageM.sendMessage(player, "%NType %A%helpusage% %Nfor help.",
 | 
					 | 
				
			||||||
				"helpusage-" + BlockHunt.CMDhelp.usage);
 | 
					 | 
				
			||||||
		MessageM.sendMessage(player,
 | 
					 | 
				
			||||||
				"%NDev-Page: %Ahttp://dev.bukkit.org/bukkit-plugins/blockhunt/");
 | 
					 | 
				
			||||||
		MessageM.sendMessage(player, "%NDonations are welcome!");
 | 
							MessageM.sendMessage(player, "%NDonations are welcome!");
 | 
				
			||||||
		MessageM.sendMessage(player, "%NMade by help from some friends &c<3%N!");
 | 
							MessageM.sendMessage(player, "%NMade by help from some friends &c<3%N!");
 | 
				
			||||||
		MessageM.sendFMessage(player, ConfigC.chat_headerhigh,
 | 
							MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oInfo Page");
 | 
				
			||||||
				"header-&oInfo Page");
 | 
					 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,12 +11,10 @@ import org.bukkit.entity.Player;
 | 
				
			|||||||
public class CMDjoin extends DefaultCMD {
 | 
					public class CMDjoin extends DefaultCMD {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		if (player != null) {
 | 
							if (player != null) {
 | 
				
			||||||
			if (args.length <= 1) {
 | 
								if (args.length <= 1) {
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments,
 | 
									MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDjoin.usage);
 | 
				
			||||||
						"syntax-" + BlockHunt.CMDjoin.usage);
 | 
					 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				ArenaHandler.playerJoinArena(player, args[1]);
 | 
									ArenaHandler.playerJoinArena(player, args[1]);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,8 +10,7 @@ import org.bukkit.entity.Player;
 | 
				
			|||||||
public class CMDleave extends DefaultCMD {
 | 
					public class CMDleave extends DefaultCMD {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		if (player != null) {
 | 
							if (player != null) {
 | 
				
			||||||
			ArenaHandler.playerLeaveArena(player, true, true);
 | 
								ArenaHandler.playerLeaveArena(player, true, true);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,10 +12,8 @@ import org.bukkit.entity.Player;
 | 
				
			|||||||
public class CMDlist extends DefaultCMD {
 | 
					public class CMDlist extends DefaultCMD {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
							MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName());
 | 
				
			||||||
		MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-"
 | 
					 | 
				
			||||||
				+ BlockHunt.pdfFile.getName());
 | 
					 | 
				
			||||||
		if (W.arenaList.size() >= 1) {
 | 
							if (W.arenaList.size() >= 1) {
 | 
				
			||||||
			MessageM.sendMessage(player, "&7Available arena(s):");
 | 
								MessageM.sendMessage(player, "&7Available arena(s):");
 | 
				
			||||||
			for (Arena arena : W.arenaList) {
 | 
								for (Arena arena : W.arenaList) {
 | 
				
			||||||
@@ -25,8 +23,7 @@ public class CMDlist extends DefaultCMD {
 | 
				
			|||||||
			MessageM.sendMessage(player, "&7&oNo arenas available...");
 | 
								MessageM.sendMessage(player, "&7&oNo arenas available...");
 | 
				
			||||||
			MessageM.sendMessage(player, "&7&oCreate an arena first please.");
 | 
								MessageM.sendMessage(player, "&7&oCreate an arena first please.");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		MessageM.sendFMessage(player, ConfigC.chat_headerhigh,
 | 
							MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oArenas list");
 | 
				
			||||||
				"header-&oArenas list");
 | 
					 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,8 +19,7 @@ public class CMDnotfound {
 | 
				
			|||||||
	 * @author Steffion
 | 
						 * @author Steffion
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public static boolean exectue(Player player, Command cmd, String label,
 | 
						public static boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		MessageM.sendFMessage(player, ConfigC.error_commandNotFound);
 | 
							MessageM.sendFMessage(player, ConfigC.error_commandNotFound);
 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,8 +24,7 @@ public class CMDreload extends DefaultCMD {
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		ConfigM.newFiles();
 | 
							ConfigM.newFiles();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		W.config.load();
 | 
							W.config.load();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,30 +17,21 @@ import org.bukkit.entity.Player;
 | 
				
			|||||||
public class CMDremove extends DefaultCMD {
 | 
					public class CMDremove extends DefaultCMD {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		if (player != null) {
 | 
							if (player != null) {
 | 
				
			||||||
			if (args.length <= 1) {
 | 
								if (args.length <= 1) {
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments,
 | 
									MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDremove.usage);
 | 
				
			||||||
						"syntax-" + BlockHunt.CMDremove.usage);
 | 
					 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				for (Arena arena : W.arenaList) {
 | 
									for (Arena arena : W.arenaList) {
 | 
				
			||||||
					if (args[1].equalsIgnoreCase(arena.arenaName)) {
 | 
										if (args[1].equalsIgnoreCase(arena.arenaName)) {
 | 
				
			||||||
						MessageM.sendFMessage(player,
 | 
											MessageM.sendFMessage(player, ConfigC.normal_removeRemovedArena, "name-" + args[1]);
 | 
				
			||||||
								ConfigC.normal_removeRemovedArena, "name-"
 | 
					 | 
				
			||||||
										+ args[1]);
 | 
					 | 
				
			||||||
						W.arenas.getFile().set(args[1], null);
 | 
											W.arenas.getFile().set(args[1], null);
 | 
				
			||||||
						for (String sign : W.signs.getFile().getKeys(false)) {
 | 
											for (String sign : W.signs.getFile().getKeys(false)) {
 | 
				
			||||||
							if (W.signs.getFile().get(sign + ".arenaName")
 | 
												if (W.signs.getFile().get(sign + ".arenaName").toString().equalsIgnoreCase(args[1])) {
 | 
				
			||||||
									.toString().equalsIgnoreCase(args[1])) {
 | 
													LocationSerializable signLoc = new LocationSerializable((Location) W.signs.getFile().get(sign + ".location"));
 | 
				
			||||||
								LocationSerializable signLoc = new LocationSerializable(
 | 
					 | 
				
			||||||
										(Location) W.signs.getFile().get(
 | 
					 | 
				
			||||||
												sign + ".location"));
 | 
					 | 
				
			||||||
								signLoc.getBlock().setType(Material.AIR);
 | 
													signLoc.getBlock().setType(Material.AIR);
 | 
				
			||||||
								signLoc.getWorld().playEffect(signLoc,
 | 
													signLoc.getWorld().playEffect(signLoc, Effect.MOBSPAWNER_FLAMES, 0);
 | 
				
			||||||
										Effect.MOBSPAWNER_FLAMES, 0);
 | 
													signLoc.getWorld().playSound(signLoc, Sound.ENDERDRAGON_WINGS, 1, 1);
 | 
				
			||||||
								signLoc.getWorld().playSound(signLoc,
 | 
					 | 
				
			||||||
										Sound.ENDERDRAGON_WINGS, 1, 1);
 | 
					 | 
				
			||||||
								W.signs.getFile().set(sign, null);
 | 
													W.signs.getFile().set(sign, null);
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
@@ -53,8 +44,7 @@ public class CMDremove extends DefaultCMD {
 | 
				
			|||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.error_noArena, "name-"
 | 
									MessageM.sendFMessage(player, ConfigC.error_noArena, "name-" + args[1]);
 | 
				
			||||||
						+ args[1]);
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			MessageM.sendFMessage(player, ConfigC.error_onlyIngame);
 | 
								MessageM.sendFMessage(player, ConfigC.error_onlyIngame);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,12 +11,10 @@ import org.bukkit.entity.Player;
 | 
				
			|||||||
public class CMDset extends DefaultCMD {
 | 
					public class CMDset extends DefaultCMD {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		if (player != null) {
 | 
							if (player != null) {
 | 
				
			||||||
			if (args.length <= 1) {
 | 
								if (args.length <= 1) {
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments,
 | 
									MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDset.usage);
 | 
				
			||||||
						"syntax-" + BlockHunt.CMDset.usage);
 | 
					 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				String arenaname = args[1];
 | 
									String arenaname = args[1];
 | 
				
			||||||
				InventoryHandler.openPanel(player, arenaname);
 | 
									InventoryHandler.openPanel(player, arenaname);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,12 +14,10 @@ import org.bukkit.entity.Player;
 | 
				
			|||||||
public class CMDsetwarp extends DefaultCMD {
 | 
					public class CMDsetwarp extends DefaultCMD {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		if (player != null) {
 | 
							if (player != null) {
 | 
				
			||||||
			if (args.length <= 2) {
 | 
								if (args.length <= 2) {
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments,
 | 
									MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDsetwarp.usage);
 | 
				
			||||||
						"syntax-" + BlockHunt.CMDsetwarp.usage);
 | 
					 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				String arenaname = args[2];
 | 
									String arenaname = args[2];
 | 
				
			||||||
				String warpname = args[1];
 | 
									String warpname = args[1];
 | 
				
			||||||
@@ -31,40 +29,28 @@ public class CMDsetwarp extends DefaultCMD {
 | 
				
			|||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				if (arena != null) {
 | 
									if (arena != null) {
 | 
				
			||||||
					LocationSerializable loc = new LocationSerializable(
 | 
										LocationSerializable loc = new LocationSerializable(player.getLocation());
 | 
				
			||||||
							player.getLocation());
 | 
					 | 
				
			||||||
					if (warpname.equalsIgnoreCase("lobby")) {
 | 
										if (warpname.equalsIgnoreCase("lobby")) {
 | 
				
			||||||
						arena.lobbyWarp = loc;
 | 
											arena.lobbyWarp = loc;
 | 
				
			||||||
						save(arena);
 | 
											save(arena);
 | 
				
			||||||
						MessageM.sendFMessage(player,
 | 
											MessageM.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
 | 
				
			||||||
								ConfigC.normal_setwarpWarpSet, "warp-"
 | 
					 | 
				
			||||||
										+ warpname);
 | 
					 | 
				
			||||||
					} else if (warpname.equalsIgnoreCase("hiders")) {
 | 
										} else if (warpname.equalsIgnoreCase("hiders")) {
 | 
				
			||||||
						arena.hidersWarp = loc;
 | 
											arena.hidersWarp = loc;
 | 
				
			||||||
						save(arena);
 | 
											save(arena);
 | 
				
			||||||
						MessageM.sendFMessage(player,
 | 
											MessageM.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
 | 
				
			||||||
								ConfigC.normal_setwarpWarpSet, "warp-"
 | 
					 | 
				
			||||||
										+ warpname);
 | 
					 | 
				
			||||||
					} else if (warpname.equalsIgnoreCase("seekers")) {
 | 
										} else if (warpname.equalsIgnoreCase("seekers")) {
 | 
				
			||||||
						arena.seekersWarp = loc;
 | 
											arena.seekersWarp = loc;
 | 
				
			||||||
						save(arena);
 | 
											save(arena);
 | 
				
			||||||
						MessageM.sendFMessage(player,
 | 
											MessageM.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
 | 
				
			||||||
								ConfigC.normal_setwarpWarpSet, "warp-"
 | 
					 | 
				
			||||||
										+ warpname);
 | 
					 | 
				
			||||||
					} else if (warpname.equalsIgnoreCase("spawn")) {
 | 
										} else if (warpname.equalsIgnoreCase("spawn")) {
 | 
				
			||||||
						arena.spawnWarp = loc;
 | 
											arena.spawnWarp = loc;
 | 
				
			||||||
						save(arena);
 | 
											save(arena);
 | 
				
			||||||
						MessageM.sendFMessage(player,
 | 
											MessageM.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
 | 
				
			||||||
								ConfigC.normal_setwarpWarpSet, "warp-"
 | 
					 | 
				
			||||||
										+ warpname);
 | 
					 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
						MessageM.sendFMessage(player,
 | 
											MessageM.sendFMessage(player, ConfigC.error_setwarpWarpNotFound, "warp-" + warpname);
 | 
				
			||||||
								ConfigC.error_setwarpWarpNotFound, "warp-"
 | 
					 | 
				
			||||||
										+ warpname);
 | 
					 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					MessageM.sendFMessage(player, ConfigC.error_noArena,
 | 
										MessageM.sendFMessage(player, ConfigC.error_noArena, "name-" + arenaname);
 | 
				
			||||||
							"name-" + arenaname);
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,8 +8,7 @@ import org.bukkit.entity.Player;
 | 
				
			|||||||
public class CMDshop extends DefaultCMD {
 | 
					public class CMDshop extends DefaultCMD {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		InventoryHandler.openShop(player);
 | 
							InventoryHandler.openShop(player);
 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,12 +13,10 @@ import org.bukkit.entity.Player;
 | 
				
			|||||||
public class CMDstart extends DefaultCMD {
 | 
					public class CMDstart extends DefaultCMD {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		if (player != null) {
 | 
							if (player != null) {
 | 
				
			||||||
			if (args.length <= 1) {
 | 
								if (args.length <= 1) {
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments,
 | 
									MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDstart.usage);
 | 
				
			||||||
						"syntax-" + BlockHunt.CMDstart.usage);
 | 
					 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				Arena arena = null;
 | 
									Arena arena = null;
 | 
				
			||||||
				for (Arena arena2 : W.arenaList) {
 | 
									for (Arena arena2 : W.arenaList) {
 | 
				
			||||||
@@ -32,12 +30,9 @@ public class CMDstart extends DefaultCMD {
 | 
				
			|||||||
						if (arena.playersInArena.size() >= 2) {
 | 
											if (arena.playersInArena.size() >= 2) {
 | 
				
			||||||
							arena.timer = 11;
 | 
												arena.timer = 11;
 | 
				
			||||||
							arena.gameState = ArenaState.STARTING;
 | 
												arena.gameState = ArenaState.STARTING;
 | 
				
			||||||
							MessageM.sendFMessage(player,
 | 
												MessageM.sendFMessage(player, ConfigC.normal_startForced, "arenaname-" + arena.arenaName);
 | 
				
			||||||
									ConfigC.normal_startForced, "arenaname-"
 | 
					 | 
				
			||||||
											+ arena.arenaName);
 | 
					 | 
				
			||||||
						} else {
 | 
											} else {
 | 
				
			||||||
							MessageM.sendFMessage(player,
 | 
												MessageM.sendFMessage(player, ConfigC.warning_lobbyNeedAtleast, "1-2");
 | 
				
			||||||
									ConfigC.warning_lobbyNeedAtleast, "1-2");
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					} else if (arena.gameState.equals(ArenaState.STARTING)) {
 | 
										} else if (arena.gameState.equals(ArenaState.STARTING)) {
 | 
				
			||||||
						if (arena.playersInArena.size() < arena.maxPlayers) {
 | 
											if (arena.playersInArena.size() < arena.maxPlayers) {
 | 
				
			||||||
@@ -48,13 +43,10 @@ public class CMDstart extends DefaultCMD {
 | 
				
			|||||||
							arena.timer = 1;
 | 
												arena.timer = 1;
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						MessageM.sendFMessage(player,
 | 
											MessageM.sendFMessage(player, ConfigC.normal_startForced, "arenaname-" + arena.arenaName);
 | 
				
			||||||
								ConfigC.normal_startForced, "arenaname-"
 | 
					 | 
				
			||||||
										+ arena.arenaName);
 | 
					 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					MessageM.sendFMessage(player, ConfigC.error_noArena,
 | 
										MessageM.sendFMessage(player, ConfigC.error_noArena, "name-" + args[1]);
 | 
				
			||||||
							"name-" + args[1]);
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,11 +23,9 @@ public class CMDtokens extends DefaultCMD {
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		if (args.length <= 3) {
 | 
							if (args.length <= 3) {
 | 
				
			||||||
			MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments,
 | 
								MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDtokens.usage);
 | 
				
			||||||
					"syntax-" + BlockHunt.CMDtokens.usage);
 | 
					 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			String option = args[1];
 | 
								String option = args[1];
 | 
				
			||||||
			String playerName = args[2];
 | 
								String playerName = args[2];
 | 
				
			||||||
@@ -35,16 +33,13 @@ public class CMDtokens extends DefaultCMD {
 | 
				
			|||||||
			try {
 | 
								try {
 | 
				
			||||||
				amount = Integer.valueOf(args[3]);
 | 
									amount = Integer.valueOf(args[3]);
 | 
				
			||||||
			} catch (NumberFormatException e) {
 | 
								} catch (NumberFormatException e) {
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.error_notANumber, "1-"
 | 
									MessageM.sendFMessage(player, ConfigC.error_notANumber, "1-" + args[3]);
 | 
				
			||||||
						+ args[3]);
 | 
					 | 
				
			||||||
				return true;
 | 
									return true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			Player tokenPlayer = Bukkit.getPlayer(playerName);
 | 
								Player tokenPlayer = Bukkit.getPlayer(playerName);
 | 
				
			||||||
			if (tokenPlayer == null) {
 | 
								if (tokenPlayer == null) {
 | 
				
			||||||
				MessageM.sendFMessage(player,
 | 
									MessageM.sendFMessage(player, ConfigC.error_tokensPlayerNotOnline, "playername-" + playerName);
 | 
				
			||||||
						ConfigC.error_tokensPlayerNotOnline, "playername-"
 | 
					 | 
				
			||||||
								+ playerName);
 | 
					 | 
				
			||||||
				return true;
 | 
									return true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			String name = "\u00A78Console";
 | 
								String name = "\u00A78Console";
 | 
				
			||||||
@@ -55,48 +50,28 @@ public class CMDtokens extends DefaultCMD {
 | 
				
			|||||||
			if (option.equalsIgnoreCase("set")) {
 | 
								if (option.equalsIgnoreCase("set")) {
 | 
				
			||||||
				W.shop.getFile().set(tokenPlayer.getName() + ".tokens", amount);
 | 
									W.shop.getFile().set(tokenPlayer.getName() + ".tokens", amount);
 | 
				
			||||||
				W.shop.save();
 | 
									W.shop.save();
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.normal_tokensChanged,
 | 
									MessageM.sendFMessage(player, ConfigC.normal_tokensChanged, "option-Set", "playername-" + tokenPlayer.getName(), "option2-to", "amount-" + amount);
 | 
				
			||||||
						"option-Set", "playername-" + tokenPlayer.getName(),
 | 
									MessageM.sendFMessage(tokenPlayer, ConfigC.normal_tokensChangedPerson, "option-set", "playername-" + name, "option2-to", "amount-" + amount);
 | 
				
			||||||
						"option2-to", "amount-" + amount);
 | 
					 | 
				
			||||||
				MessageM.sendFMessage(tokenPlayer,
 | 
					 | 
				
			||||||
						ConfigC.normal_tokensChangedPerson, "option-set",
 | 
					 | 
				
			||||||
						"playername-" + name, "option2-to",
 | 
					 | 
				
			||||||
						"amount-" + amount);
 | 
					 | 
				
			||||||
			} else if (option.equalsIgnoreCase("add")) {
 | 
								} else if (option.equalsIgnoreCase("add")) {
 | 
				
			||||||
				int tokens = 0;
 | 
									int tokens = 0;
 | 
				
			||||||
				if (W.shop.getFile().getInt(tokenPlayer.getName() + ".tokens") != 0) {
 | 
									if (W.shop.getFile().getInt(tokenPlayer.getName() + ".tokens") != 0) {
 | 
				
			||||||
					tokens = W.shop.getFile().getInt(
 | 
										tokens = W.shop.getFile().getInt(tokenPlayer.getName() + ".tokens");
 | 
				
			||||||
							tokenPlayer.getName() + ".tokens");
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				W.shop.getFile().set(tokenPlayer.getName() + ".tokens",
 | 
									W.shop.getFile().set(tokenPlayer.getName() + ".tokens", tokens + amount);
 | 
				
			||||||
						tokens + amount);
 | 
					 | 
				
			||||||
				W.shop.save();
 | 
									W.shop.save();
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.normal_tokensChanged,
 | 
									MessageM.sendFMessage(player, ConfigC.normal_tokensChanged, "option-Added", "playername-" + tokenPlayer.getName(), "option2-to", "amount-" + amount);
 | 
				
			||||||
						"option-Added", "playername-" + tokenPlayer.getName(),
 | 
									MessageM.sendFMessage(tokenPlayer, ConfigC.normal_tokensChangedPerson, "option-added", "playername-" + name, "option2-to", "amount-" + amount);
 | 
				
			||||||
						"option2-to", "amount-" + amount);
 | 
					 | 
				
			||||||
				MessageM.sendFMessage(tokenPlayer,
 | 
					 | 
				
			||||||
						ConfigC.normal_tokensChangedPerson, "option-added",
 | 
					 | 
				
			||||||
						"playername-" + name, "option2-to",
 | 
					 | 
				
			||||||
						"amount-" + amount);
 | 
					 | 
				
			||||||
			} else if (option.equalsIgnoreCase("take")) {
 | 
								} else if (option.equalsIgnoreCase("take")) {
 | 
				
			||||||
				int tokens = 0;
 | 
									int tokens = 0;
 | 
				
			||||||
				if (W.shop.getFile().getInt(tokenPlayer.getName() + ".tokens") != 0) {
 | 
									if (W.shop.getFile().getInt(tokenPlayer.getName() + ".tokens") != 0) {
 | 
				
			||||||
					tokens = W.shop.getFile().getInt(
 | 
										tokens = W.shop.getFile().getInt(tokenPlayer.getName() + ".tokens");
 | 
				
			||||||
							tokenPlayer.getName() + ".tokens");
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				W.shop.getFile().set(tokenPlayer.getName() + ".tokens",
 | 
									W.shop.getFile().set(tokenPlayer.getName() + ".tokens", tokens - amount);
 | 
				
			||||||
						tokens - amount);
 | 
					 | 
				
			||||||
				W.shop.save();
 | 
									W.shop.save();
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.normal_tokensChanged,
 | 
									MessageM.sendFMessage(player, ConfigC.normal_tokensChanged, "option-Took", "playername-" + tokenPlayer.getName(), "option2-from", "amount-" + amount);
 | 
				
			||||||
						"option-Took", "playername-" + tokenPlayer.getName(),
 | 
									MessageM.sendFMessage(tokenPlayer, ConfigC.normal_tokensChangedPerson, "option-took", "playername-" + name, "option2-from", "amount-" + amount);
 | 
				
			||||||
						"option2-from", "amount-" + amount);
 | 
					 | 
				
			||||||
				MessageM.sendFMessage(tokenPlayer,
 | 
					 | 
				
			||||||
						ConfigC.normal_tokensChangedPerson, "option-took",
 | 
					 | 
				
			||||||
						"playername-" + name, "option2-from",
 | 
					 | 
				
			||||||
						"amount-" + amount);
 | 
					 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				MessageM.sendFMessage(player,
 | 
									MessageM.sendFMessage(player, ConfigC.error_tokensUnknownsetting, "option-" + option);
 | 
				
			||||||
						ConfigC.error_tokensUnknownsetting, "option-" + option);
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,18 +17,13 @@ import org.bukkit.inventory.meta.ItemMeta;
 | 
				
			|||||||
public class CMDwand extends DefaultCMD {
 | 
					public class CMDwand extends DefaultCMD {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		if (player != null) {
 | 
							if (player != null) {
 | 
				
			||||||
			ItemStack wand = new ItemStack(
 | 
								ItemStack wand = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.wandIDname)));
 | 
				
			||||||
					Material.getMaterial((String) W.config
 | 
					 | 
				
			||||||
							.get(ConfigC.wandIDname)));
 | 
					 | 
				
			||||||
			ItemMeta im = wand.getItemMeta();
 | 
								ItemMeta im = wand.getItemMeta();
 | 
				
			||||||
			im.setDisplayName(MessageM.replaceAll((String) W.config
 | 
								im.setDisplayName(MessageM.replaceAll((String) W.config.get(ConfigC.wandName)));
 | 
				
			||||||
					.get(ConfigC.wandName)));
 | 
					 | 
				
			||||||
			W.config.load();
 | 
								W.config.load();
 | 
				
			||||||
			List<String> lores = W.config.getFile().getStringList(
 | 
								List<String> lores = W.config.getFile().getStringList(ConfigC.wandDescription.location);
 | 
				
			||||||
					ConfigC.wandDescription.location);
 | 
					 | 
				
			||||||
			List<String> lores2 = new ArrayList<String>();
 | 
								List<String> lores2 = new ArrayList<String>();
 | 
				
			||||||
			for (String lore : lores) {
 | 
								for (String lore : lores) {
 | 
				
			||||||
				lores2.add(MessageM.replaceAll(lore));
 | 
									lores2.add(MessageM.replaceAll(lore));
 | 
				
			||||||
@@ -38,9 +33,7 @@ public class CMDwand extends DefaultCMD {
 | 
				
			|||||||
			wand.setItemMeta(im);
 | 
								wand.setItemMeta(im);
 | 
				
			||||||
			player.getInventory().addItem(wand);
 | 
								player.getInventory().addItem(wand);
 | 
				
			||||||
			player.playSound(player.getLocation(), Sound.ORB_PICKUP, 5, 0);
 | 
								player.playSound(player.getLocation(), Sound.ORB_PICKUP, 5, 0);
 | 
				
			||||||
			MessageM.sendFMessage(player, ConfigC.normal_wandGaveWand, "type-"
 | 
								MessageM.sendFMessage(player, ConfigC.normal_wandGaveWand, "type-" + wand.getType().toString().replaceAll("_", " ").toLowerCase());
 | 
				
			||||||
					+ wand.getType().toString().replaceAll("_", " ")
 | 
					 | 
				
			||||||
							.toLowerCase());
 | 
					 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			MessageM.sendFMessage(player, ConfigC.error_onlyIngame);
 | 
								MessageM.sendFMessage(player, ConfigC.error_onlyIngame);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,8 +18,7 @@ public class DefaultCMD {
 | 
				
			|||||||
	 * @author Steffion
 | 
						 * @author Steffion
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public boolean exectue(Player player, Command cmd, String label,
 | 
						public boolean exectue(Player player, Command cmd, String label, String[] args) {
 | 
				
			||||||
			String[] args) {
 | 
					 | 
				
			||||||
		MessageM.sendMessage(player, "%TAG%NExample of a Command!");
 | 
							MessageM.sendMessage(player, "%TAG%NExample of a Command!");
 | 
				
			||||||
		// TODO Place the command stuff here.
 | 
							// TODO Place the command stuff here.
 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,234 +15,95 @@ public enum ConfigC {
 | 
				
			|||||||
	 * @author Steffion
 | 
						 * @author Steffion
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	chat_tag ("[" + BlockHunt.pdfFile.getName() + "] ", W.config),
 | 
						chat_tag("[" + BlockHunt.pdfFile.getName() + "] ", W.config), chat_normal("&b", W.config), chat_warning("&c", W.config), chat_error("&c", W.config), chat_arg("&e",
 | 
				
			||||||
	chat_normal ("&b", W.config),
 | 
								W.config), chat_header("&9", W.config), chat_headerhigh("%H_______.[ %A%header%%H ]._______", W.config),
 | 
				
			||||||
	chat_warning ("&c", W.config),
 | 
					 | 
				
			||||||
	chat_error ("&c", W.config),
 | 
					 | 
				
			||||||
	chat_arg ("&e", W.config),
 | 
					 | 
				
			||||||
	chat_header ("&9", W.config),
 | 
					 | 
				
			||||||
	chat_headerhigh ("%H_______.[ %A%header%%H ]._______", W.config),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	commandEnabled_info (true, W.config),
 | 
						commandEnabled_info(true, W.config), commandEnabled_help(true, W.config), commandEnabled_reload(true, W.config), commandEnabled_join(true, W.config), commandEnabled_leave(
 | 
				
			||||||
	commandEnabled_help (true, W.config),
 | 
								true, W.config), commandEnabled_list(true, W.config), commandEnabled_shop(true, W.config), commandEnabled_start(true, W.config), commandEnabled_wand(true,
 | 
				
			||||||
	commandEnabled_reload (true, W.config),
 | 
								W.config), commandEnabled_create(true, W.config), commandEnabled_set(true, W.config), commandEnabled_setwarp(true, W.config), commandEnabled_remove(true,
 | 
				
			||||||
	commandEnabled_join (true, W.config),
 | 
								W.config), commandEnabled_tokens(true, W.config),
 | 
				
			||||||
	commandEnabled_leave (true, W.config),
 | 
					 | 
				
			||||||
	commandEnabled_list (true, W.config),
 | 
					 | 
				
			||||||
	commandEnabled_shop (true, W.config),
 | 
					 | 
				
			||||||
	commandEnabled_start (true, W.config),
 | 
					 | 
				
			||||||
	commandEnabled_wand (true, W.config),
 | 
					 | 
				
			||||||
	commandEnabled_create (true, W.config),
 | 
					 | 
				
			||||||
	commandEnabled_set (true, W.config),
 | 
					 | 
				
			||||||
	commandEnabled_setwarp (true, W.config),
 | 
					 | 
				
			||||||
	commandEnabled_remove (true, W.config),
 | 
					 | 
				
			||||||
	commandEnabled_tokens (true, W.config),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	autoUpdateCheck (true, W.config),
 | 
						autoUpdateCheck(true, W.config), autoDownloadUpdate(false, W.config),
 | 
				
			||||||
	autoDownloadUpdate (false, W.config),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wandIDname ("STICK", W.config),
 | 
						wandIDname("STICK", W.config), wandName("%A&l" + BlockHunt.pdfFile.getName() + "%N's selection wand", W.config), wandDescription(new String[] {
 | 
				
			||||||
	wandName ("%A&l" + BlockHunt.pdfFile.getName() + "%N's selection wand",
 | 
								"%NUse this item to select an arena for your arena.", "%ALeft-Click%N to select point #1.", "%ARight-Click%N to select point #2.",
 | 
				
			||||||
			W.config),
 | 
								"%NUse the create command to define your arena.", "%A/" + BlockHunt.pdfFile.getName() + " <help|h>" }, W.config),
 | 
				
			||||||
	wandDescription (new String[] {
 | 
					 | 
				
			||||||
			"%NUse this item to select an arena for your arena.",
 | 
					 | 
				
			||||||
			"%ALeft-Click%N to select point #1.",
 | 
					 | 
				
			||||||
			"%ARight-Click%N to select point #2.",
 | 
					 | 
				
			||||||
			"%NUse the create command to define your arena.",
 | 
					 | 
				
			||||||
			"%A/" + BlockHunt.pdfFile.getName() + " <help|h>" }, W.config),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	shop_title ("%H&lBlockHunt %NShop", W.config),
 | 
						shop_title("%H&lBlockHunt %NShop", W.config), shop_price("%NPrice: %A%amount% %Ntokens.", W.config),
 | 
				
			||||||
	shop_price ("%NPrice: %A%amount% %Ntokens.", W.config),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	shop_blockChooserv1Enabled (true, W.config),
 | 
						shop_blockChooserv1Enabled(true, W.config), shop_blockChooserv1IDname("BOOK", W.config), shop_blockChooserv1Price(3000, W.config), shop_blockChooserv1Name(
 | 
				
			||||||
	shop_blockChooserv1IDname ("BOOK", W.config),
 | 
								"%H&lBlockHunt Chooser", W.config), shop_blockChooserv1Description(new String[] { "%NUse this item before the arena starts.",
 | 
				
			||||||
	shop_blockChooserv1Price (3000, W.config),
 | 
								"%ARight-Click%N in the lobby and choose", "%Nthe block you want to be!", "&6Unlimited uses." }, W.config),
 | 
				
			||||||
	shop_blockChooserv1Name ("%H&lBlockHunt Chooser", W.config),
 | 
					 | 
				
			||||||
	shop_blockChooserv1Description (new String[] {
 | 
					 | 
				
			||||||
			"%NUse this item before the arena starts.",
 | 
					 | 
				
			||||||
			"%ARight-Click%N in the lobby and choose",
 | 
					 | 
				
			||||||
			"%Nthe block you want to be!", "&6Unlimited uses." }, W.config),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	shop_BlockHuntPassv2Enabled (true, W.config),
 | 
						shop_BlockHuntPassv2Enabled(true, W.config), shop_BlockHuntPassv2IDName("NAME_TAG", W.config), shop_BlockHuntPassv2Price(150, W.config), shop_BlockHuntPassv2Name(
 | 
				
			||||||
	shop_BlockHuntPassv2IDName ("NAME_TAG", W.config),
 | 
								"%H&lBlockHunt Pass", W.config), shop_BlockHuntPassv2Description(new String[] { "%NUse this item before the arena starts.",
 | 
				
			||||||
	shop_BlockHuntPassv2Price (150, W.config),
 | 
								"%ARight-Click%N in the lobby and choose", "%Nif you want to be a Hider or a Seeker!", "&61 time use.", }, W.config),
 | 
				
			||||||
	shop_BlockHuntPassv2Name ("%H&lBlockHunt Pass", W.config),
 | 
					 | 
				
			||||||
	shop_BlockHuntPassv2Description (new String[] {
 | 
					 | 
				
			||||||
			"%NUse this item before the arena starts.",
 | 
					 | 
				
			||||||
			"%ARight-Click%N in the lobby and choose",
 | 
					 | 
				
			||||||
			"%Nif you want to be a Hider or a Seeker!", "&61 time use.", },
 | 
					 | 
				
			||||||
			W.config),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	sign_LEAVE (new String[] { "%H[" + BlockHunt.pdfFile.getName() + "%H]",
 | 
						sign_LEAVE(new String[] { "%H[" + BlockHunt.pdfFile.getName() + "%H]", "&4LEAVE", "&8Right-Click", "&8To leave." }, W.config), sign_SHOP(new String[] {
 | 
				
			||||||
			"&4LEAVE", "&8Right-Click", "&8To leave." }, W.config),
 | 
								"%H[" + BlockHunt.pdfFile.getName() + "%H]", "&4SHOP", "&8Right-Click", "&8To shop." }, W.config), sign_WAITING(new String[] {
 | 
				
			||||||
	sign_SHOP (new String[] { "%H[" + BlockHunt.pdfFile.getName() + "%H]",
 | 
								"%H[" + BlockHunt.pdfFile.getName() + "%H]", "%A%arenaname%", "%A%players%%N/%A%maxplayers%", "&8Waiting..." }, W.config), sign_STARTING(new String[] {
 | 
				
			||||||
			"&4SHOP", "&8Right-Click", "&8To shop." }, W.config),
 | 
								"%H[" + BlockHunt.pdfFile.getName() + "%H]", "%A%arenaname%", "%A%players%%N/%A%maxplayers%", "&2Start: %A%timeleft%" }, W.config), sign_INGAME(new String[] {
 | 
				
			||||||
	sign_WAITING (new String[] { "%H[" + BlockHunt.pdfFile.getName() + "%H]",
 | 
								"%H[" + BlockHunt.pdfFile.getName() + "%H]", "%A%arenaname%", "%A%players%%N/%A%maxplayers%", "%EIngame: %A%timeleft%" }, W.config),
 | 
				
			||||||
			"%A%arenaname%", "%A%players%%N/%A%maxplayers%", "&8Waiting..." },
 | 
					 | 
				
			||||||
			W.config),
 | 
					 | 
				
			||||||
	sign_STARTING (new String[] { "%H[" + BlockHunt.pdfFile.getName() + "%H]",
 | 
					 | 
				
			||||||
			"%A%arenaname%", "%A%players%%N/%A%maxplayers%",
 | 
					 | 
				
			||||||
			"&2Start: %A%timeleft%" }, W.config),
 | 
					 | 
				
			||||||
	sign_INGAME (new String[] { "%H[" + BlockHunt.pdfFile.getName() + "%H]",
 | 
					 | 
				
			||||||
			"%A%arenaname%", "%A%players%%N/%A%maxplayers%",
 | 
					 | 
				
			||||||
			"%EIngame: %A%timeleft%" }, W.config),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	scoreboard_enabled (true, W.config),
 | 
						scoreboard_enabled(true, W.config), scoreboard_title("%H[" + BlockHunt.pdfFile.getName() + "]", W.config), scoreboard_timeleft("%ATime left:", W.config), scoreboard_seekers(
 | 
				
			||||||
	scoreboard_title ("%H[" + BlockHunt.pdfFile.getName() + "]", W.config),
 | 
								"%NSeekers:", W.config), scoreboard_hiders("%NHiders:", W.config),
 | 
				
			||||||
	scoreboard_timeleft ("%ATime left:", W.config),
 | 
					 | 
				
			||||||
	scoreboard_seekers ("%NSeekers:", W.config),
 | 
					 | 
				
			||||||
	scoreboard_hiders ("%NHiders:", W.config),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	requireInventoryClearOnJoin (false, W.config),
 | 
						requireInventoryClearOnJoin(false, W.config),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	log_enabledPlugin ("%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%autors%%N.",
 | 
						log_enabledPlugin("%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%autors%%N.", W.messages), log_disabledPlugin(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%autors%%N.", W.messages),
 | 
				
			||||||
	log_disabledPlugin ("%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%autors%%N.",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	help_info ("%NDisplays the plugin's info.", W.messages),
 | 
						help_info("%NDisplays the plugin's info.", W.messages), help_help("%NShows a list of commands.", W.messages), help_reload("%NReloads all configs.", W.messages), help_join(
 | 
				
			||||||
	help_help ("%NShows a list of commands.", W.messages),
 | 
								"%NJoins a " + BlockHunt.pdfFile.getName() + " game.", W.messages), help_leave("%NLeave a " + BlockHunt.pdfFile.getName() + " game.", W.messages), help_list(
 | 
				
			||||||
	help_reload ("%NReloads all configs.", W.messages),
 | 
								"%NShows a list of available arenas.", W.messages), help_shop("%NOpens the " + BlockHunt.pdfFile.getName() + " shop.", W.messages), help_start(
 | 
				
			||||||
	help_join ("%NJoins a " + BlockHunt.pdfFile.getName() + " game.",
 | 
								"%NForces an arena to start.", W.messages), help_wand("%NGives you the wand selection tool.", W.messages), help_create(
 | 
				
			||||||
			W.messages),
 | 
								"%NCreates an arena from your selection.", W.messages), help_set("%NOpens a panel to set settings.", W.messages), help_setwarp(
 | 
				
			||||||
	help_leave ("%NLeave a " + BlockHunt.pdfFile.getName() + " game.",
 | 
								"%NSets warps for your arena.", W.messages), help_remove("%NDeletes an Arena.", W.messages), help_tokens("%NChange someones tokens.", W.messages),
 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	help_list ("%NShows a list of available arenas.", W.messages),
 | 
					 | 
				
			||||||
	help_shop ("%NOpens the " + BlockHunt.pdfFile.getName() + " shop.",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	help_start ("%NForces an arena to start.", W.messages),
 | 
					 | 
				
			||||||
	help_wand ("%NGives you the wand selection tool.", W.messages),
 | 
					 | 
				
			||||||
	help_create ("%NCreates an arena from your selection.", W.messages),
 | 
					 | 
				
			||||||
	help_set ("%NOpens a panel to set settings.", W.messages),
 | 
					 | 
				
			||||||
	help_setwarp ("%NSets warps for your arena.", W.messages),
 | 
					 | 
				
			||||||
	help_remove ("%NDeletes an Arena.", W.messages),
 | 
					 | 
				
			||||||
	help_tokens ("%NChange someones tokens.", W.messages),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	button_add ("%NAdd %A%1%%N to %A%2%%N", W.messages),
 | 
						button_add("%NAdd %A%1%%N to %A%2%%N", W.messages), button_add2("Add", W.messages), button_setting("%NSetting %A%1%%N is now: %A%2%%N.", W.messages), button_remove(
 | 
				
			||||||
	button_add2 ("Add", W.messages),
 | 
								"%NRemove %A%1%%N from %A%2%%N", W.messages), button_remove2("Remove", W.messages),
 | 
				
			||||||
	button_setting ("%NSetting %A%1%%N is now: %A%2%%N.", W.messages),
 | 
					 | 
				
			||||||
	button_remove ("%NRemove %A%1%%N from %A%2%%N", W.messages),
 | 
					 | 
				
			||||||
	button_remove2 ("Remove", W.messages),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	normal_reloadedConfigs ("%TAG&aReloaded all configs!", W.messages),
 | 
						normal_reloadedConfigs("%TAG&aReloaded all configs!", W.messages), normal_joinJoinedArena("%TAG%A%playername%%N joined your arena. (%A%1%%N/%A%2%%N)", W.messages), normal_leaveYouLeft(
 | 
				
			||||||
	normal_joinJoinedArena ("%TAG%A%playername%%N joined your arena. (%A%1%%N/%A%2%%N)",
 | 
								"%TAG%NYou left the arena! Thanks for playing!", W.messages), normal_leaveLeftArena("%TAG%A%playername%%N left your arena. (%A%1%%N/%A%2%%N)", W.messages), normal_startForced(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%NYou forced to start arena '%A%arenaname%%N'!", W.messages), normal_wandGaveWand("%TAG%NHere you go! &o(Use the %A&o%type%%N&o!)", W.messages), normal_wandSetPosition(
 | 
				
			||||||
	normal_leaveYouLeft ("%TAG%NYou left the arena! Thanks for playing!",
 | 
								"%TAG%NSet position %A#%number%%N to location: (%A%x%%N, %A%y%%N, %A%z%%N).", W.messages), normal_createCreatedArena(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%NCreated an arena with the name '%A%name%%N'.", W.messages), normal_lobbyArenaIsStarting("%TAG%NThe arena will start in %A%1%%N second(s)!", W.messages), normal_lobbyArenaStarted(
 | 
				
			||||||
	normal_leaveLeftArena ("%TAG%A%playername%%N left your arena. (%A%1%%N/%A%2%%N)",
 | 
								"%TAG%NThe arena has been started! The seeker is coming to find you in %A%secs%%N seconds!", W.messages), normal_ingameSeekerChoosen(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%NPlayer %A%seeker%%N has been choosen as seeker!", W.messages), normal_ingameBlock("%TAG%NYou're disguised as a(n) '%A%block%%N' block.", W.messages), normal_ingameArenaEnd(
 | 
				
			||||||
	normal_startForced ("%TAG%NYou forced to start arena '%A%arenaname%%N'!",
 | 
								"%TAG%NThe arena will end in %A%1%%N second(s)!", W.messages), normal_ingameSeekerSpawned("%TAG%A%playername%%N has spawned as a seeker!", W.messages), normal_ingameGivenSword(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%NYou were given a sword!", W.messages), normal_ingameHiderDied("%TAG%NHider %A%playername%%N was killed by %A%killer%%N!", W.messages), normal_ingameHidersLeft(
 | 
				
			||||||
	normal_wandGaveWand ("%TAG%NHere you go! &o(Use the %A&o%type%%N&o!)",
 | 
								"%NHider(s) left: %A%left%%N", W.messages), normal_ingameSeekerDied("%TAG%NSeeker %A%playername%%N died and will respawn in %A%secs%%N seconds!", W.messages), normal_winSeekers(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%NThe %ASEEKERS%N have won!", W.messages), normal_winHiders("%TAG%NThe %AHIDERS%N have won!", W.messages), normal_setwarpWarpSet(
 | 
				
			||||||
	normal_wandSetPosition ("%TAG%NSet position %A#%number%%N to location: (%A%x%%N, %A%y%%N, %A%z%%N).",
 | 
								"%TAG%NSet warp '%A%warp%%N' to your location!", W.messages), normal_addedToken("%TAG%A%amount%%N tokens were added to your account!", W.messages), normal_removeRemovedArena(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%NRemoved arena '%A%name%%N'!", W.messages), normal_tokensChanged("%TAG%N%option% %A%amount%%N tokens %option2% %A%playername%%N.", W.messages), normal_tokensChangedPerson(
 | 
				
			||||||
	normal_createCreatedArena ("%TAG%NCreated an arena with the name '%A%name%%N'.",
 | 
								"%TAG%NPlayer %A%playername%%N %N%option% %A%amount%%N %option2% your tokens.", W.messages), normal_ingameNowSolid(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%NYou're now a solid '%A%block%%N' block!", W.messages), normal_ingameNoMoreSolid("%TAG%NYou're no longer a solid block!", W.messages), normal_shopBoughtItem(
 | 
				
			||||||
	normal_lobbyArenaIsStarting ("%TAG%NThe arena will start in %A%1%%N second(s)!",
 | 
								"%TAG%NYou've bought the '%A%itemname%%N' item!", W.messages), normal_shopChoosenBlock("%TAG%NYou've choosen to be a(n) '%A%block%%N' block!", W.messages), normal_shopChoosenSeeker(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%NYou've choosen to be a %Aseeker%N!", W.messages), normal_shopChoosenHiders("%TAG%NYou've choosen to be a %Ahider%N!", W.messages),
 | 
				
			||||||
	normal_lobbyArenaStarted ("%TAG%NThe arena has been started! The seeker is coming to find you in %A%secs%%N seconds!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_ingameSeekerChoosen ("%TAG%NPlayer %A%seeker%%N has been choosen as seeker!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_ingameBlock ("%TAG%NYou're disguised as a(n) '%A%block%%N' block.",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_ingameArenaEnd ("%TAG%NThe arena will end in %A%1%%N second(s)!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_ingameSeekerSpawned ("%TAG%A%playername%%N has spawned as a seeker!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_ingameGivenSword ("%TAG%NYou were given a sword!", W.messages),
 | 
					 | 
				
			||||||
	normal_ingameHiderDied ("%TAG%NHider %A%playername%%N was killed by %A%killer%%N!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_ingameHidersLeft ("%NHider(s) left: %A%left%%N",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_ingameSeekerDied ("%TAG%NSeeker %A%playername%%N died and will respawn in %A%secs%%N seconds!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_winSeekers ("%TAG%NThe %ASEEKERS%N have won!", W.messages),
 | 
					 | 
				
			||||||
	normal_winHiders ("%TAG%NThe %AHIDERS%N have won!", W.messages),
 | 
					 | 
				
			||||||
	normal_setwarpWarpSet ("%TAG%NSet warp '%A%warp%%N' to your location!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_addedToken ("%TAG%A%amount%%N tokens were added to your account!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_removeRemovedArena ("%TAG%NRemoved arena '%A%name%%N'!", W.messages),
 | 
					 | 
				
			||||||
	normal_tokensChanged ("%TAG%N%option% %A%amount%%N tokens %option2% %A%playername%%N.",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_tokensChangedPerson ("%TAG%NPlayer %A%playername%%N %N%option% %A%amount%%N %option2% your tokens.",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_ingameNowSolid ("%TAG%NYou're now a solid '%A%block%%N' block!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_ingameNoMoreSolid ("%TAG%NYou're no longer a solid block!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_shopBoughtItem ("%TAG%NYou've bought the '%A%itemname%%N' item!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_shopChoosenBlock ("%TAG%NYou've choosen to be a(n) '%A%block%%N' block!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_shopChoosenSeeker ("%TAG%NYou've choosen to be a %Aseeker%N!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	normal_shopChoosenHiders ("%TAG%NYou've choosen to be a %Ahider%N!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	warning_lobbyNeedAtleast ("%TAG%WYou need atleast %A%1%%W player(s) to start the game!",
 | 
						warning_lobbyNeedAtleast("%TAG%WYou need atleast %A%1%%W player(s) to start the game!", W.messages), warning_ingameNEWSeekerChoosen(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%WThe last seeker left and a new seeker has been choosen!", W.messages), warning_unableToCommand(
 | 
				
			||||||
	warning_ingameNEWSeekerChoosen ("%TAG%WThe last seeker left and a new seeker has been choosen!",
 | 
								"%TAG%WSorry but that command is disabled in the arena.", W.messages), warning_ingameNoSolidPlace("%TAG%WThat's not a valid place to become solid!",
 | 
				
			||||||
			W.messages),
 | 
								W.messages), warning_arenaStopped("%TAG%WThe arena has been forced to stop!", W.messages),
 | 
				
			||||||
	warning_unableToCommand ("%TAG%WSorry but that command is disabled in the arena.",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	warning_ingameNoSolidPlace ("%TAG%WThat's not a valid place to become solid!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	warning_arenaStopped ("%TAG%WThe arena has been forced to stop!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	error_noPermission ("%TAG%EYou don't have the permissions to do that!",
 | 
						error_noPermission("%TAG%EYou don't have the permissions to do that!", W.messages), error_notANumber("%TAG%E'%A%1%%E' is not a number!", W.messages), error_commandNotEnabled(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%EThis command has been disabled!", W.messages), error_commandNotFound("%TAG%ECouldn't find the command. Try %A/" + BlockHunt.pdfFile.getName()
 | 
				
			||||||
	error_notANumber ("%TAG%E'%A%1%%E' is not a number!", W.messages),
 | 
								+ " help %Efor more info.", W.messages), error_notEnoughArguments("%TAG%EYou're missing arguments, correct syntax: %A%syntax%", W.messages), error_libsDisguisesNotInstalled(
 | 
				
			||||||
	error_commandNotEnabled ("%TAG%EThis command has been disabled!",
 | 
								"%TAG%EThe plugin '%ALib's Disguises%E' is required to run this plugin! Intall it or it won't work!", W.messages), error_protocolLibNotInstalled(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%EThe plugin '%AProtocolLib%E' is required to run this plugin! Intall it or it won't work!", W.messages), error_noArena(
 | 
				
			||||||
	error_commandNotFound ("%TAG%ECouldn't find the command. Try %A/"
 | 
								"%TAG%ENo arena found with the name '%A%name%%E'.", W.messages), error_onlyIngame("%TAG%EThis is an only in-game command!", W.messages), error_joinAlreadyJoined(
 | 
				
			||||||
			+ BlockHunt.pdfFile.getName() + " help %Efor more info.",
 | 
								"%TAG%EYou've already joined an arena!", W.messages), error_joinNoBlocksSet("%TAG%EThere are none blocks set for this arena. Notify the administrator.",
 | 
				
			||||||
			W.messages),
 | 
								W.messages), error_joinWarpsNotSet("%TAG%EThere are no warps set for this arena. Notify the administrator.", W.messages), error_joinArenaIngame(
 | 
				
			||||||
	error_notEnoughArguments ("%TAG%EYou're missing arguments, correct syntax: %A%syntax%",
 | 
								"%TAG%EThis game has already started.", W.messages), error_joinFull("%TAG%EUnable to join this arena. It's full!", W.messages), error_joinInventoryNotEmpty(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%EYour inventory should be empty before joining!", W.messages), error_leaveNotInArena("%TAG%EYou're not in an arena!", W.messages), error_createSelectionFirst(
 | 
				
			||||||
	error_libsDisguisesNotInstalled ("%TAG%EThe plugin '%ALib's Disguises%E' is required to run this plugin! Intall it or it won't work!",
 | 
								"%TAG%EMake a selection first. Use the wand command: %A/" + BlockHunt.pdfFile.getName() + " <wand|w>%E.", W.messages), error_createNotSameWorld(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%EMake your selection points in the same world!", W.messages), error_setTooHighNumber("%TAG%EThat amount is too high! Max amount is: %A%max%%E.",
 | 
				
			||||||
	error_protocolLibNotInstalled ("%TAG%EThe plugin '%AProtocolLib%E' is required to run this plugin! Intall it or it won't work!",
 | 
								W.messages), error_setTooLowNumber("%TAG%EThat amount is too low! Minimal amount is: %A%min%%E.", W.messages), error_setNotABlock(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%EThat is not a block!", W.messages), error_setwarpWarpNotFound("%TAG%EWarp '%A%warp%%E' is not valid!", W.messages), error_tokensPlayerNotOnline(
 | 
				
			||||||
	error_noArena ("%TAG%ENo arena found with the name '%A%name%%E'.",
 | 
								"%TAG%ENo player found with the name '%A%playername%%E'!", W.messages), error_tokensUnknownsetting("%TAG%E'%A%option%%E' is not a known option!", W.messages), error_shopNeedMoreTokens(
 | 
				
			||||||
			W.messages),
 | 
								"%TAG%EYou need more tokens before you can buy this item.", W.messages), error_shopMaxSeekersReached(
 | 
				
			||||||
	error_onlyIngame ("%TAG%EThis is an only in-game command!", W.messages),
 | 
								"%TAG%ESorry, the maximum amount of seekers has been reached!", W.messages), error_shopMaxHidersReached(
 | 
				
			||||||
	error_joinAlreadyJoined ("%TAG%EYou've already joined an arena!",
 | 
								"%TAG%ESorry, the maximum amount of hiders has been reached!", W.messages);
 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_joinNoBlocksSet ("%TAG%EThere are none blocks set for this arena. Notify the administrator.",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_joinWarpsNotSet ("%TAG%EThere are no warps set for this arena. Notify the administrator.",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_joinArenaIngame ("%TAG%EThis game has already started.", W.messages),
 | 
					 | 
				
			||||||
	error_joinFull ("%TAG%EUnable to join this arena. It's full!", W.messages),
 | 
					 | 
				
			||||||
	error_joinInventoryNotEmpty ("%TAG%EYour inventory should be empty before joining!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_leaveNotInArena ("%TAG%EYou're not in an arena!", W.messages),
 | 
					 | 
				
			||||||
	error_createSelectionFirst ("%TAG%EMake a selection first. Use the wand command: %A/"
 | 
					 | 
				
			||||||
			+ BlockHunt.pdfFile.getName() + " <wand|w>%E.",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_createNotSameWorld ("%TAG%EMake your selection points in the same world!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_setTooHighNumber ("%TAG%EThat amount is too high! Max amount is: %A%max%%E.",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_setTooLowNumber ("%TAG%EThat amount is too low! Minimal amount is: %A%min%%E.",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_setNotABlock ("%TAG%EThat is not a block!", W.messages),
 | 
					 | 
				
			||||||
	error_setwarpWarpNotFound ("%TAG%EWarp '%A%warp%%E' is not valid!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_tokensPlayerNotOnline ("%TAG%ENo player found with the name '%A%playername%%E'!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_tokensUnknownsetting ("%TAG%E'%A%option%%E' is not a known option!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_shopNeedMoreTokens ("%TAG%EYou need more tokens before you can buy this item.",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_shopMaxSeekersReached ("%TAG%ESorry, the maximum amount of seekers has been reached!",
 | 
					 | 
				
			||||||
			W.messages),
 | 
					 | 
				
			||||||
	error_shopMaxHidersReached ("%TAG%ESorry, the maximum amount of hiders has been reached!",
 | 
					 | 
				
			||||||
			W.messages);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public Object value;
 | 
						public Object value;
 | 
				
			||||||
	public ConfigM config;
 | 
						public ConfigM config;
 | 
				
			||||||
@@ -256,7 +117,7 @@ public enum ConfigC {
 | 
				
			|||||||
	 * @param config
 | 
						 * @param config
 | 
				
			||||||
	 *            The config file.
 | 
						 *            The config file.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	private ConfigC (Object value, ConfigM config) {
 | 
						private ConfigC(Object value, ConfigM config) {
 | 
				
			||||||
		this.value = value;
 | 
							this.value = value;
 | 
				
			||||||
		this.config = config;
 | 
							this.config = config;
 | 
				
			||||||
		this.location = this.name().replaceAll("_", ".");
 | 
							this.location = this.name().replaceAll("_", ".");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,146 +31,98 @@ public class InventoryHandler {
 | 
				
			|||||||
			arenaname = arena.arenaName;
 | 
								arenaname = arena.arenaName;
 | 
				
			||||||
			if (shorten.length() > 6)
 | 
								if (shorten.length() > 6)
 | 
				
			||||||
				shorten = shorten.substring(0, 6);
 | 
									shorten = shorten.substring(0, 6);
 | 
				
			||||||
			Inventory panel = Bukkit
 | 
								Inventory panel = Bukkit.createInventory(null, 54, MessageM.replaceAll("\u00A7r%N&lBlockHunt Arena: %A" + shorten));
 | 
				
			||||||
					.createInventory(
 | 
					 | 
				
			||||||
							null,
 | 
					 | 
				
			||||||
							54,
 | 
					 | 
				
			||||||
							MessageM.replaceAll("\u00A7r%N&lBlockHunt Arena: %A"
 | 
					 | 
				
			||||||
									+ shorten));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ItemStack arenaNameNote = new ItemStack(Material.PAPER, 1);
 | 
								ItemStack arenaNameNote = new ItemStack(Material.PAPER, 1);
 | 
				
			||||||
			ItemMeta arenaNameNote_IM = arenaNameNote.getItemMeta();
 | 
								ItemMeta arenaNameNote_IM = arenaNameNote.getItemMeta();
 | 
				
			||||||
			arenaNameNote_IM.setDisplayName(MessageM
 | 
								arenaNameNote_IM.setDisplayName(MessageM.replaceAll("%NBlockHunt arena: %A" + arena.arenaName));
 | 
				
			||||||
					.replaceAll("%NBlockHunt arena: %A" + arena.arenaName));
 | 
					 | 
				
			||||||
			arenaNameNote.setItemMeta(arenaNameNote_IM);
 | 
								arenaNameNote.setItemMeta(arenaNameNote_IM);
 | 
				
			||||||
			panel.setItem(0, arenaNameNote);
 | 
								panel.setItem(0, arenaNameNote);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			//
 | 
								//
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ItemStack maxPlayers_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
								ItemStack maxPlayers_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
			ItemStack maxPlayers = new ItemStack(Material.BEDROCK,
 | 
								ItemStack maxPlayers = new ItemStack(Material.BEDROCK, arena.maxPlayers);
 | 
				
			||||||
					arena.maxPlayers);
 | 
					 | 
				
			||||||
			ItemStack maxPlayers_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
								ItemStack maxPlayers_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ItemStack minPlayers_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
								ItemStack minPlayers_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
			ItemStack minPlayers = new ItemStack(Material.BEDROCK,
 | 
								ItemStack minPlayers = new ItemStack(Material.BEDROCK, arena.minPlayers);
 | 
				
			||||||
					arena.minPlayers);
 | 
					 | 
				
			||||||
			ItemStack minPlayers_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
								ItemStack minPlayers_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ItemStack amountSeekersOnStart_UP = new ItemStack(
 | 
								ItemStack amountSeekersOnStart_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
					Material.GOLD_NUGGET, 1);
 | 
								ItemStack amountSeekersOnStart = new ItemStack(Material.BEDROCK, arena.amountSeekersOnStart);
 | 
				
			||||||
			ItemStack amountSeekersOnStart = new ItemStack(
 | 
								ItemStack amountSeekersOnStart_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
					Material.BEDROCK, arena.amountSeekersOnStart);
 | 
					 | 
				
			||||||
			ItemStack amountSeekersOnStart_DOWN = new ItemStack(
 | 
					 | 
				
			||||||
					Material.GOLD_NUGGET, 1);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ItemStack timeInLobbyUntilStart_UP = new ItemStack(
 | 
								ItemStack timeInLobbyUntilStart_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
					Material.GOLD_NUGGET, 1);
 | 
								ItemStack timeInLobbyUntilStart = new ItemStack(Material.BEDROCK, arena.timeInLobbyUntilStart);
 | 
				
			||||||
			ItemStack timeInLobbyUntilStart = new ItemStack(
 | 
								ItemStack timeInLobbyUntilStart_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
					Material.BEDROCK, arena.timeInLobbyUntilStart);
 | 
					 | 
				
			||||||
			ItemStack timeInLobbyUntilStart_DOWN = new ItemStack(
 | 
					 | 
				
			||||||
					Material.GOLD_NUGGET, 1);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ItemStack waitingTimeSeeker_UP = new ItemStack(
 | 
								ItemStack waitingTimeSeeker_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
					Material.GOLD_NUGGET, 1);
 | 
								ItemStack waitingTimeSeeker = new ItemStack(Material.BEDROCK, arena.waitingTimeSeeker);
 | 
				
			||||||
			ItemStack waitingTimeSeeker = new ItemStack(
 | 
								ItemStack waitingTimeSeeker_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
					Material.BEDROCK, arena.waitingTimeSeeker);
 | 
					 | 
				
			||||||
			ItemStack waitingTimeSeeker_DOWN = new ItemStack(
 | 
					 | 
				
			||||||
					Material.GOLD_NUGGET, 1);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ItemStack gameTime_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
								ItemStack gameTime_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
			ItemStack gameTime = new ItemStack(Material.BEDROCK,
 | 
								ItemStack gameTime = new ItemStack(Material.BEDROCK, arena.gameTime);
 | 
				
			||||||
					arena.gameTime);
 | 
					 | 
				
			||||||
			ItemStack gameTime_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
								ItemStack gameTime_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ItemStack disguiseBlocks_NOTE = new ItemStack(Material.BOOK, 1);
 | 
								ItemStack disguiseBlocks_NOTE = new ItemStack(Material.BOOK, 1);
 | 
				
			||||||
			ItemMeta disguiseBlocks_NOTE_IM = disguiseBlocks_NOTE.getItemMeta();
 | 
								ItemMeta disguiseBlocks_NOTE_IM = disguiseBlocks_NOTE.getItemMeta();
 | 
				
			||||||
			disguiseBlocks_NOTE_IM.setDisplayName(MessageM
 | 
								disguiseBlocks_NOTE_IM.setDisplayName(MessageM.replaceAll("%NSet the %AdisguiseBlocks%N."));
 | 
				
			||||||
					.replaceAll("%NSet the %AdisguiseBlocks%N."));
 | 
					 | 
				
			||||||
			disguiseBlocks_NOTE.setItemMeta(disguiseBlocks_NOTE_IM);
 | 
								disguiseBlocks_NOTE.setItemMeta(disguiseBlocks_NOTE_IM);
 | 
				
			||||||
			panel.setItem(37, disguiseBlocks_NOTE);
 | 
								panel.setItem(37, disguiseBlocks_NOTE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ItemStack timeUntilHidersSword_UP = new ItemStack(
 | 
								ItemStack timeUntilHidersSword_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
					Material.GOLD_NUGGET, 1);
 | 
								ItemStack timeUntilHidersSword = new ItemStack(Material.BEDROCK, arena.timeUntilHidersSword);
 | 
				
			||||||
			ItemStack timeUntilHidersSword = new ItemStack(
 | 
								ItemStack timeUntilHidersSword_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
					Material.BEDROCK, arena.timeUntilHidersSword);
 | 
					 | 
				
			||||||
			ItemStack timeUntilHidersSword_DOWN = new ItemStack(
 | 
					 | 
				
			||||||
					Material.GOLD_NUGGET, 1);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ItemStack hidersTokenWin_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
								ItemStack hidersTokenWin_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
			ItemStack hidersTokenWin = new ItemStack(
 | 
								ItemStack hidersTokenWin = new ItemStack(Material.BEDROCK, arena.hidersTokenWin);
 | 
				
			||||||
					Material.BEDROCK, arena.hidersTokenWin);
 | 
								ItemStack hidersTokenWin_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
			ItemStack hidersTokenWin_DOWN = new ItemStack(Material.GOLD_NUGGET,
 | 
					 | 
				
			||||||
					1);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ItemStack seekersTokenWin_UP = new ItemStack(Material.GOLD_NUGGET,
 | 
								ItemStack seekersTokenWin_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
					1);
 | 
								ItemStack seekersTokenWin = new ItemStack(Material.BEDROCK, arena.seekersTokenWin);
 | 
				
			||||||
			ItemStack seekersTokenWin = new ItemStack(
 | 
								ItemStack seekersTokenWin_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
					Material.BEDROCK, arena.seekersTokenWin);
 | 
					 | 
				
			||||||
			ItemStack seekersTokenWin_DOWN = new ItemStack(
 | 
					 | 
				
			||||||
					Material.GOLD_NUGGET, 1);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ItemStack killTokens_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
								ItemStack killTokens_UP = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
			ItemStack killTokens = new ItemStack(Material.BEDROCK,
 | 
								ItemStack killTokens = new ItemStack(Material.BEDROCK, arena.killTokens);
 | 
				
			||||||
					arena.killTokens);
 | 
					 | 
				
			||||||
			ItemStack killTokens_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
								ItemStack killTokens_DOWN = new ItemStack(Material.GOLD_NUGGET, 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			//
 | 
								//
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			updownButton(panel, arena, ArenaType.maxPlayers, "maxPlayers", "1",
 | 
								updownButton(panel, arena, ArenaType.maxPlayers, "maxPlayers", "1", maxPlayers_UP, maxPlayers, maxPlayers_DOWN, 1, 10, 19);
 | 
				
			||||||
					maxPlayers_UP, maxPlayers, maxPlayers_DOWN, 1, 10, 19);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			updownButton(panel, arena, ArenaType.minPlayers, "minPlayers", "1",
 | 
								updownButton(panel, arena, ArenaType.minPlayers, "minPlayers", "1", minPlayers_UP, minPlayers, minPlayers_DOWN, 2, 11, 20);
 | 
				
			||||||
					minPlayers_UP, minPlayers, minPlayers_DOWN, 2, 11, 20);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			updownButton(panel, arena, ArenaType.amountSeekersOnStart,
 | 
								updownButton(panel, arena, ArenaType.amountSeekersOnStart, "amountSeekersOnStart", "1", amountSeekersOnStart_UP, amountSeekersOnStart,
 | 
				
			||||||
					"amountSeekersOnStart", "1", amountSeekersOnStart_UP,
 | 
										amountSeekersOnStart_DOWN, 4, 13, 22);
 | 
				
			||||||
					amountSeekersOnStart, amountSeekersOnStart_DOWN, 4, 13, 22);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			updownButton(panel, arena, ArenaType.timeInLobbyUntilStart,
 | 
								updownButton(panel, arena, ArenaType.timeInLobbyUntilStart, "timeInLobbyUntilStart", "1 %Nsecond", timeInLobbyUntilStart_UP, timeInLobbyUntilStart,
 | 
				
			||||||
					"timeInLobbyUntilStart", "1 %Nsecond",
 | 
					 | 
				
			||||||
					timeInLobbyUntilStart_UP, timeInLobbyUntilStart,
 | 
					 | 
				
			||||||
					timeInLobbyUntilStart_DOWN, 6, 15, 24);
 | 
										timeInLobbyUntilStart_DOWN, 6, 15, 24);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			updownButton(panel, arena, ArenaType.waitingTimeSeeker,
 | 
								updownButton(panel, arena, ArenaType.waitingTimeSeeker, "waitingTimeSeeker", "1 %Nsecond", waitingTimeSeeker_UP, waitingTimeSeeker, waitingTimeSeeker_DOWN,
 | 
				
			||||||
					"waitingTimeSeeker", "1 %Nsecond", waitingTimeSeeker_UP,
 | 
										7, 16, 25);
 | 
				
			||||||
					waitingTimeSeeker, waitingTimeSeeker_DOWN, 7, 16, 25);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			updownButton(panel, arena, ArenaType.gameTime, "gameTime",
 | 
								updownButton(panel, arena, ArenaType.gameTime, "gameTime", "1 %Nsecond", gameTime_UP, gameTime, gameTime_DOWN, 8, 17, 26);
 | 
				
			||||||
					"1 %Nsecond", gameTime_UP, gameTime, gameTime_DOWN, 8, 17,
 | 
					 | 
				
			||||||
					26);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			updownButton(panel, arena, ArenaType.timeUntilHidersSword,
 | 
								updownButton(panel, arena, ArenaType.timeUntilHidersSword, "timeUntilHidersSword", "1 %Nsecond", timeUntilHidersSword_UP, timeUntilHidersSword,
 | 
				
			||||||
					"timeUntilHidersSword", "1 %Nsecond",
 | 
					 | 
				
			||||||
					timeUntilHidersSword_UP, timeUntilHidersSword,
 | 
					 | 
				
			||||||
					timeUntilHidersSword_DOWN, 30, 39, 48);
 | 
										timeUntilHidersSword_DOWN, 30, 39, 48);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			updownButton(panel, arena, ArenaType.hidersTokenWin,
 | 
								updownButton(panel, arena, ArenaType.hidersTokenWin, "hidersTokenWin", "1 %Ntoken", hidersTokenWin_UP, hidersTokenWin, hidersTokenWin_DOWN, 32, 41, 50);
 | 
				
			||||||
					"hidersTokenWin", "1 %Ntoken", hidersTokenWin_UP,
 | 
					 | 
				
			||||||
					hidersTokenWin, hidersTokenWin_DOWN, 32, 41, 50);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			updownButton(panel, arena, ArenaType.seekersTokenWin,
 | 
								updownButton(panel, arena, ArenaType.seekersTokenWin, "seekersTokenWin", "1 %Ntoken", seekersTokenWin_UP, seekersTokenWin, seekersTokenWin_DOWN, 33, 42, 51);
 | 
				
			||||||
					"seekersTokenWin", "1 %Ntoken", seekersTokenWin_UP,
 | 
					 | 
				
			||||||
					seekersTokenWin, seekersTokenWin_DOWN, 33, 42, 51);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			updownButton(panel, arena, ArenaType.killTokens, "killTokens",
 | 
								updownButton(panel, arena, ArenaType.killTokens, "killTokens", "1 %Ntoken", killTokens_UP, killTokens, killTokens_DOWN, 34, 43, 52);
 | 
				
			||||||
					"1 %Ntoken", killTokens_UP, killTokens, killTokens_DOWN,
 | 
					 | 
				
			||||||
					34, 43, 52);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			player.openInventory(panel);
 | 
								player.openInventory(panel);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			MessageM.sendFMessage(player, ConfigC.error_noArena, "name-"
 | 
								MessageM.sendFMessage(player, ConfigC.error_noArena, "name-" + arenaname);
 | 
				
			||||||
					+ arenaname);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public static void updownButton(Inventory panel, Arena arena, ArenaType at,
 | 
						public static void updownButton(Inventory panel, Arena arena, ArenaType at, String option, String addremove, ItemStack UP, ItemStack BUTTON, ItemStack DOWN, int up,
 | 
				
			||||||
			String option, String addremove, ItemStack UP, ItemStack BUTTON,
 | 
								int button, int down) {
 | 
				
			||||||
			ItemStack DOWN, int up, int button, int down) {
 | 
					 | 
				
			||||||
		ItemMeta UP_IM = UP.getItemMeta();
 | 
							ItemMeta UP_IM = UP.getItemMeta();
 | 
				
			||||||
		UP_IM.setDisplayName(MessageM.replaceAll(
 | 
							UP_IM.setDisplayName(MessageM.replaceAll((String) W.messages.get(ConfigC.button_add), "1-" + addremove, "2-" + option));
 | 
				
			||||||
				(String) W.messages.get(ConfigC.button_add), "1-" + addremove,
 | 
					 | 
				
			||||||
				"2-" + option));
 | 
					 | 
				
			||||||
		UP.setItemMeta(UP_IM);
 | 
							UP.setItemMeta(UP_IM);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		int setting = 0;
 | 
							int setting = 0;
 | 
				
			||||||
@@ -208,15 +160,11 @@ public class InventoryHandler {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ItemMeta BUTTON_IM = BUTTON.getItemMeta();
 | 
							ItemMeta BUTTON_IM = BUTTON.getItemMeta();
 | 
				
			||||||
		BUTTON_IM.setDisplayName(MessageM.replaceAll(
 | 
							BUTTON_IM.setDisplayName(MessageM.replaceAll((String) W.messages.get(ConfigC.button_setting), "1-" + option, "2-" + setting));
 | 
				
			||||||
				(String) W.messages.get(ConfigC.button_setting), "1-" + option,
 | 
					 | 
				
			||||||
				"2-" + setting));
 | 
					 | 
				
			||||||
		BUTTON.setItemMeta(BUTTON_IM);
 | 
							BUTTON.setItemMeta(BUTTON_IM);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ItemMeta DOWN_IM = DOWN.getItemMeta();
 | 
							ItemMeta DOWN_IM = DOWN.getItemMeta();
 | 
				
			||||||
		DOWN_IM.setDisplayName(MessageM.replaceAll(
 | 
							DOWN_IM.setDisplayName(MessageM.replaceAll((String) W.messages.get(ConfigC.button_remove), "1-" + addremove, "2-" + option));
 | 
				
			||||||
				(String) W.messages.get(ConfigC.button_remove), "1-"
 | 
					 | 
				
			||||||
						+ addremove, "2-" + option));
 | 
					 | 
				
			||||||
		DOWN.setItemMeta(DOWN_IM);
 | 
							DOWN.setItemMeta(DOWN_IM);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		panel.setItem(up, UP);
 | 
							panel.setItem(up, UP);
 | 
				
			||||||
@@ -226,16 +174,13 @@ public class InventoryHandler {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	public static void openDisguiseBlocks(Arena arena, Player player) {
 | 
						public static void openDisguiseBlocks(Arena arena, Player player) {
 | 
				
			||||||
		String arenaname = arena.arenaName;
 | 
							String arenaname = arena.arenaName;
 | 
				
			||||||
		Inventory panel = Bukkit.createInventory(null, 36,
 | 
							Inventory panel = Bukkit.createInventory(null, 36, MessageM.replaceAll("%N&lDisguiseBlocks"));
 | 
				
			||||||
				MessageM.replaceAll("%N&lDisguiseBlocks"));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ItemStack arenaNameNote = new ItemStack(Material.PAPER, 1);
 | 
							ItemStack arenaNameNote = new ItemStack(Material.PAPER, 1);
 | 
				
			||||||
		ItemMeta arenaNameNote_IM = arenaNameNote.getItemMeta();
 | 
							ItemMeta arenaNameNote_IM = arenaNameNote.getItemMeta();
 | 
				
			||||||
		arenaNameNote_IM.setDisplayName(MessageM
 | 
							arenaNameNote_IM.setDisplayName(MessageM.replaceAll("%NDisguiseBlocks of arena: %A" + arenaname));
 | 
				
			||||||
				.replaceAll("%NDisguiseBlocks of arena: %A" + arenaname));
 | 
					 | 
				
			||||||
		ArrayList<String> lores = new ArrayList<String>();
 | 
							ArrayList<String> lores = new ArrayList<String>();
 | 
				
			||||||
		lores.add(MessageM
 | 
							lores.add(MessageM.replaceAll("%NPlace the DisguiseBlocks inside this inventory."));
 | 
				
			||||||
				.replaceAll("%NPlace the DisguiseBlocks inside this inventory."));
 | 
					 | 
				
			||||||
		arenaNameNote_IM.setLore(lores);
 | 
							arenaNameNote_IM.setLore(lores);
 | 
				
			||||||
		arenaNameNote.setItemMeta(arenaNameNote_IM);
 | 
							arenaNameNote.setItemMeta(arenaNameNote_IM);
 | 
				
			||||||
		panel.setItem(0, arenaNameNote);
 | 
							panel.setItem(0, arenaNameNote);
 | 
				
			||||||
@@ -248,73 +193,51 @@ public class InventoryHandler {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public static void openShop(Player player) {
 | 
						public static void openShop(Player player) {
 | 
				
			||||||
		Inventory shop = Bukkit.createInventory(
 | 
							Inventory shop = Bukkit.createInventory(null, 9, MessageM.replaceAll("\u00A7r" + W.config.get(ConfigC.shop_title)));
 | 
				
			||||||
				null,
 | 
					 | 
				
			||||||
				9,
 | 
					 | 
				
			||||||
				MessageM.replaceAll("\u00A7r"
 | 
					 | 
				
			||||||
						+ W.config.get(ConfigC.shop_title)));
 | 
					 | 
				
			||||||
		if (W.shop.getFile().get(player.getName() + ".tokens") == null) {
 | 
							if (W.shop.getFile().get(player.getName() + ".tokens") == null) {
 | 
				
			||||||
			W.shop.getFile().set(player.getName() + ".tokens", 0);
 | 
								W.shop.getFile().set(player.getName() + ".tokens", 0);
 | 
				
			||||||
			W.shop.save();
 | 
								W.shop.save();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		int playerTokens = W.shop.getFile()
 | 
							int playerTokens = W.shop.getFile().getInt(player.getName() + ".tokens");
 | 
				
			||||||
				.getInt(player.getName() + ".tokens");
 | 
					 | 
				
			||||||
		List<String> lores = new ArrayList<String>();
 | 
							List<String> lores = new ArrayList<String>();
 | 
				
			||||||
		List<String> lores2 = new ArrayList<String>();
 | 
							List<String> lores2 = new ArrayList<String>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ItemStack shopTokens = new ItemStack(Material.EMERALD, 1);
 | 
							ItemStack shopTokens = new ItemStack(Material.EMERALD, 1);
 | 
				
			||||||
		ItemMeta shopTokens_IM = shopTokens.getItemMeta();
 | 
							ItemMeta shopTokens_IM = shopTokens.getItemMeta();
 | 
				
			||||||
		shopTokens_IM.setDisplayName(MessageM.replaceAll("%N&lTokens: %A"
 | 
							shopTokens_IM.setDisplayName(MessageM.replaceAll("%N&lTokens: %A" + playerTokens));
 | 
				
			||||||
				+ playerTokens));
 | 
					 | 
				
			||||||
		shopTokens.setItemMeta(shopTokens_IM);
 | 
							shopTokens.setItemMeta(shopTokens_IM);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ItemStack shopBlockChooser = new ItemStack(
 | 
							ItemStack shopBlockChooser = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.shop_blockChooserv1IDname)), 1);
 | 
				
			||||||
				Material.getMaterial((String) W.config
 | 
					 | 
				
			||||||
						.get(ConfigC.shop_blockChooserv1IDname)), 1);
 | 
					 | 
				
			||||||
		ItemMeta shopBlockChooser_IM = shopBlockChooser.getItemMeta();
 | 
							ItemMeta shopBlockChooser_IM = shopBlockChooser.getItemMeta();
 | 
				
			||||||
		shopBlockChooser_IM.setDisplayName(MessageM
 | 
							shopBlockChooser_IM.setDisplayName(MessageM.replaceAll((String) W.config.get(ConfigC.shop_blockChooserv1Name)));
 | 
				
			||||||
				.replaceAll((String) W.config
 | 
							lores = W.config.getFile().getStringList(ConfigC.shop_blockChooserv1Description.location);
 | 
				
			||||||
						.get(ConfigC.shop_blockChooserv1Name)));
 | 
					 | 
				
			||||||
		lores = W.config.getFile().getStringList(
 | 
					 | 
				
			||||||
				ConfigC.shop_blockChooserv1Description.location);
 | 
					 | 
				
			||||||
		lores2 = new ArrayList<String>();
 | 
							lores2 = new ArrayList<String>();
 | 
				
			||||||
		for (String lore : lores) {
 | 
							for (String lore : lores) {
 | 
				
			||||||
			lores2.add(MessageM.replaceAll(lore));
 | 
								lores2.add(MessageM.replaceAll(lore));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		lores2.add(MessageM.replaceAll(
 | 
							lores2.add(MessageM.replaceAll((String) W.config.get(ConfigC.shop_price), "amount-" + W.config.get(ConfigC.shop_blockChooserv1Price)));
 | 
				
			||||||
				(String) W.config.get(ConfigC.shop_price),
 | 
					 | 
				
			||||||
				"amount-" + W.config.get(ConfigC.shop_blockChooserv1Price)));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		shopBlockChooser_IM.setLore(lores2);
 | 
							shopBlockChooser_IM.setLore(lores2);
 | 
				
			||||||
		shopBlockChooser.setItemMeta(shopBlockChooser_IM);
 | 
							shopBlockChooser.setItemMeta(shopBlockChooser_IM);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ItemStack shopBlockHuntPass = new ItemStack(
 | 
							ItemStack shopBlockHuntPass = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.shop_BlockHuntPassv2IDName)), 1);
 | 
				
			||||||
				Material.getMaterial((String) W.config
 | 
					 | 
				
			||||||
						.get(ConfigC.shop_BlockHuntPassv2IDName)), 1);
 | 
					 | 
				
			||||||
		ItemMeta shopBlockHuntPass_IM = shopBlockHuntPass.getItemMeta();
 | 
							ItemMeta shopBlockHuntPass_IM = shopBlockHuntPass.getItemMeta();
 | 
				
			||||||
		shopBlockHuntPass_IM.setDisplayName(MessageM
 | 
							shopBlockHuntPass_IM.setDisplayName(MessageM.replaceAll((String) W.config.get(ConfigC.shop_BlockHuntPassv2Name)));
 | 
				
			||||||
				.replaceAll((String) W.config
 | 
							lores = W.config.getFile().getStringList(ConfigC.shop_BlockHuntPassv2Description.location);
 | 
				
			||||||
						.get(ConfigC.shop_BlockHuntPassv2Name)));
 | 
					 | 
				
			||||||
		lores = W.config.getFile().getStringList(
 | 
					 | 
				
			||||||
				ConfigC.shop_BlockHuntPassv2Description.location);
 | 
					 | 
				
			||||||
		lores2 = new ArrayList<String>();
 | 
							lores2 = new ArrayList<String>();
 | 
				
			||||||
		for (String lore : lores) {
 | 
							for (String lore : lores) {
 | 
				
			||||||
			lores2.add(MessageM.replaceAll(lore));
 | 
								lores2.add(MessageM.replaceAll(lore));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		lores2.add(MessageM.replaceAll(
 | 
							lores2.add(MessageM.replaceAll((String) W.config.get(ConfigC.shop_price), "amount-" + W.config.get(ConfigC.shop_BlockHuntPassv2Price)));
 | 
				
			||||||
				(String) W.config.get(ConfigC.shop_price),
 | 
					 | 
				
			||||||
				"amount-" + W.config.get(ConfigC.shop_BlockHuntPassv2Price)));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		shopBlockHuntPass_IM.setLore(lores2);
 | 
							shopBlockHuntPass_IM.setLore(lores2);
 | 
				
			||||||
		shopBlockHuntPass.setItemMeta(shopBlockHuntPass_IM);
 | 
							shopBlockHuntPass.setItemMeta(shopBlockHuntPass_IM);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		shop.setItem(0, shopTokens);
 | 
							shop.setItem(0, shopTokens);
 | 
				
			||||||
		if ((Boolean) W.config.get(ConfigC.shop_blockChooserv1Enabled) == true
 | 
							if ((Boolean) W.config.get(ConfigC.shop_blockChooserv1Enabled) == true
 | 
				
			||||||
				&& ((Boolean) W.shop.getFile().get(
 | 
									&& ((Boolean) W.shop.getFile().get(player.getName() + ".blockchooser") == null && !PermissionsM.hasPerm(player, Permissions.shopblockchooser, false))) {
 | 
				
			||||||
						player.getName() + ".blockchooser") == null && !PermissionsM
 | 
					 | 
				
			||||||
						.hasPerm(player, Permissions.shopblockchooser, false))) {
 | 
					 | 
				
			||||||
			shop.setItem(1, shopBlockChooser);
 | 
								shop.setItem(1, shopBlockChooser);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if ((Boolean) W.config.get(ConfigC.shop_BlockHuntPassv2Enabled) == true) {
 | 
							if ((Boolean) W.config.get(ConfigC.shop_BlockHuntPassv2Enabled) == true) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,7 @@ import org.bukkit.event.block.BlockBreakEvent;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class OnBlockBreakEvent implements Listener {
 | 
					public class OnBlockBreakEvent implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
 | 
						@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
 | 
				
			||||||
	public void onBlockBreakEvent(BlockBreakEvent event) {
 | 
						public void onBlockBreakEvent(BlockBreakEvent event) {
 | 
				
			||||||
		Player player = event.getPlayer();
 | 
							Player player = event.getPlayer();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -24,8 +24,7 @@ public class OnBlockBreakEvent implements Listener {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (event.getBlock().equals(Material.SIGN_POST)
 | 
							if (event.getBlock().equals(Material.SIGN_POST) || event.getBlock().equals(Material.WALL_SIGN)) {
 | 
				
			||||||
				|| event.getBlock().equals(Material.WALL_SIGN)) {
 | 
					 | 
				
			||||||
			if (!PermissionsM.hasPerm(player, Permissions.signcreate, true)) {
 | 
								if (!PermissionsM.hasPerm(player, Permissions.signcreate, true)) {
 | 
				
			||||||
				event.setCancelled(true);
 | 
									event.setCancelled(true);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,7 +11,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class OnBlockPlaceEvent implements Listener {
 | 
					public class OnBlockPlaceEvent implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
 | 
						@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
 | 
				
			||||||
	public void onBlockPlaceEvent(BlockPlaceEvent event) {
 | 
						public void onBlockPlaceEvent(BlockPlaceEvent event) {
 | 
				
			||||||
		Player player = event.getPlayer();
 | 
							Player player = event.getPlayer();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,7 +24,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
 | 
				
			|||||||
public class OnEntityDamageByEntityEvent implements Listener {
 | 
					public class OnEntityDamageByEntityEvent implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@SuppressWarnings("deprecation")
 | 
						@SuppressWarnings("deprecation")
 | 
				
			||||||
	@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
 | 
						@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
 | 
				
			||||||
	public void onEntityDamageByEntityEvent(EntityDamageByEntityEvent event) {
 | 
						public void onEntityDamageByEntityEvent(EntityDamageByEntityEvent event) {
 | 
				
			||||||
		Player player = null;
 | 
							Player player = null;
 | 
				
			||||||
		if (event.getEntity() instanceof Player) {
 | 
							if (event.getEntity() instanceof Player) {
 | 
				
			||||||
@@ -41,22 +41,16 @@ public class OnEntityDamageByEntityEvent implements Listener {
 | 
				
			|||||||
		if (player != null) {
 | 
							if (player != null) {
 | 
				
			||||||
			for (Arena arena : W.arenaList) {
 | 
								for (Arena arena : W.arenaList) {
 | 
				
			||||||
				if (arena.playersInArena.contains(player)) {
 | 
									if (arena.playersInArena.contains(player)) {
 | 
				
			||||||
					if (arena.gameState == ArenaState.WAITING
 | 
										if (arena.gameState == ArenaState.WAITING || arena.gameState == ArenaState.STARTING) {
 | 
				
			||||||
							|| arena.gameState == ArenaState.STARTING) {
 | 
					 | 
				
			||||||
						event.setCancelled(true);
 | 
											event.setCancelled(true);
 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
						if (arena.seekers.contains(player)
 | 
											if (arena.seekers.contains(player) && arena.seekers.contains(event.getDamager())) {
 | 
				
			||||||
								&& arena.seekers.contains(event.getDamager())) {
 | 
					 | 
				
			||||||
							event.setCancelled(true);
 | 
												event.setCancelled(true);
 | 
				
			||||||
						} else if (arena.playersInArena.contains(player)
 | 
											} else if (arena.playersInArena.contains(player) && arena.playersInArena.contains(event.getDamager())
 | 
				
			||||||
								&& arena.playersInArena.contains(event
 | 
													&& !arena.seekers.contains(event.getDamager()) && !arena.seekers.contains(player)) {
 | 
				
			||||||
										.getDamager())
 | 
					 | 
				
			||||||
								&& !arena.seekers.contains(event.getDamager())
 | 
					 | 
				
			||||||
								&& !arena.seekers.contains(player)) {
 | 
					 | 
				
			||||||
							event.setCancelled(true);
 | 
												event.setCancelled(true);
 | 
				
			||||||
						} else {
 | 
											} else {
 | 
				
			||||||
							player.getWorld().playSound(player.getLocation(),
 | 
												player.getWorld().playSound(player.getLocation(), Sound.HURT_FLESH, 1, 1);
 | 
				
			||||||
									Sound.HURT_FLESH, 1, 1);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
							if (event.getDamage() >= player.getHealth()) {
 | 
												if (event.getDamage() >= player.getHealth()) {
 | 
				
			||||||
								player.setHealth(20);
 | 
													player.setHealth(20);
 | 
				
			||||||
@@ -66,51 +60,29 @@ public class OnEntityDamageByEntityEvent implements Listener {
 | 
				
			|||||||
								W.pBlock.remove(player);
 | 
													W.pBlock.remove(player);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
								if (!arena.seekers.contains(player)) {
 | 
													if (!arena.seekers.contains(player)) {
 | 
				
			||||||
									if (W.shop.getFile().get(
 | 
														if (W.shop.getFile().get(damager.getName() + ".tokens") == null) {
 | 
				
			||||||
											damager.getName() + ".tokens") == null) {
 | 
															W.shop.getFile().set(damager.getName() + ".tokens", 0);
 | 
				
			||||||
										W.shop.getFile().set(
 | 
					 | 
				
			||||||
												damager.getName() + ".tokens",
 | 
					 | 
				
			||||||
												0);
 | 
					 | 
				
			||||||
										W.shop.save();
 | 
															W.shop.save();
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
									int damagerTokens = W.shop.getFile()
 | 
														int damagerTokens = W.shop.getFile().getInt(damager.getName() + ".tokens");
 | 
				
			||||||
											.getInt(damager.getName()
 | 
														W.shop.getFile().set(damager.getName() + ".tokens", damagerTokens + arena.killTokens);
 | 
				
			||||||
													+ ".tokens");
 | 
					 | 
				
			||||||
									W.shop.getFile().set(
 | 
					 | 
				
			||||||
											damager.getName() + ".tokens",
 | 
					 | 
				
			||||||
											damagerTokens + arena.killTokens);
 | 
					 | 
				
			||||||
									W.shop.save();
 | 
														W.shop.save();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									MessageM.sendFMessage(damager,
 | 
														MessageM.sendFMessage(damager, ConfigC.normal_addedToken, "amount-" + arena.killTokens);
 | 
				
			||||||
											ConfigC.normal_addedToken,
 | 
					 | 
				
			||||||
											"amount-" + arena.killTokens);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
									if (W.shop.getFile().get(
 | 
														if (W.shop.getFile().get(player.getName() + ".tokens") == null) {
 | 
				
			||||||
											player.getName() + ".tokens") == null) {
 | 
															W.shop.getFile().set(player.getName() + ".tokens", 0);
 | 
				
			||||||
										W.shop.getFile()
 | 
					 | 
				
			||||||
												.set(player.getName()
 | 
					 | 
				
			||||||
														+ ".tokens", 0);
 | 
					 | 
				
			||||||
										W.shop.save();
 | 
															W.shop.save();
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
									int playerTokens = W.shop.getFile().getInt(
 | 
														int playerTokens = W.shop.getFile().getInt(player.getName() + ".tokens");
 | 
				
			||||||
											player.getName() + ".tokens");
 | 
					 | 
				
			||||||
									float addingTokens = ((float) arena.hidersTokenWin - (((float) arena.timer / (float) arena.gameTime) * (float) arena.hidersTokenWin));
 | 
														float addingTokens = ((float) arena.hidersTokenWin - (((float) arena.timer / (float) arena.gameTime) * (float) arena.hidersTokenWin));
 | 
				
			||||||
									W.shop.getFile().set(
 | 
														W.shop.getFile().set(player.getName() + ".tokens", playerTokens + (int) addingTokens);
 | 
				
			||||||
											player.getName() + ".tokens",
 | 
					 | 
				
			||||||
											playerTokens + (int) addingTokens);
 | 
					 | 
				
			||||||
									W.shop.save();
 | 
														W.shop.save();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									MessageM.sendFMessage(player,
 | 
														MessageM.sendFMessage(player, ConfigC.normal_addedToken, "amount-" + (int) addingTokens);
 | 
				
			||||||
											ConfigC.normal_addedToken,
 | 
					 | 
				
			||||||
											"amount-" + (int) addingTokens);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
									arena.seekers.add(player);
 | 
														arena.seekers.add(player);
 | 
				
			||||||
									ArenaHandler
 | 
														ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameHiderDied, "playername-" + player.getName(), "killer-" + damagername);
 | 
				
			||||||
											.sendFMessage(
 | 
					 | 
				
			||||||
													arena,
 | 
					 | 
				
			||||||
													ConfigC.normal_ingameHiderDied,
 | 
					 | 
				
			||||||
                                                    "playername-" + player.getName(),
 | 
					 | 
				
			||||||
                                                    "killer-" + damagername);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
									int hidercount = (arena.playersInArena.size() - arena.seekers.size());
 | 
														int hidercount = (arena.playersInArena.size() - arena.seekers.size());
 | 
				
			||||||
									if ((hidercount <= 3) && (hidercount > 0)) {
 | 
														if ((hidercount <= 3) && (hidercount > 0)) {
 | 
				
			||||||
@@ -122,34 +94,42 @@ public class OnEntityDamageByEntityEvent implements Listener {
 | 
				
			|||||||
										}
 | 
															}
 | 
				
			||||||
										Collections.sort(hiders);
 | 
															Collections.sort(hiders);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				                            ArenaHandler.sendFMessage(arena,
 | 
															ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameHidersLeft, "left-" + StringUtils.join(hiders.toArray(), ", "));
 | 
				
			||||||
				                                            ConfigC.normal_ingameHidersLeft,
 | 
					 | 
				
			||||||
				                                            "left-" + StringUtils.join(hiders.toArray(), ", "));
 | 
					 | 
				
			||||||
									} else {
 | 
														} else {
 | 
				
			||||||
				                            ArenaHandler.sendFMessage(arena,
 | 
															ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameHidersLeft, "left-" + hidercount);
 | 
				
			||||||
				                                            ConfigC.normal_ingameHidersLeft,
 | 
					 | 
				
			||||||
				                                            "left-" + hidercount);
 | 
					 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
								player.getInventory().clear();
 | 
													player.getInventory().clear();
 | 
				
			||||||
								player.updateInventory();
 | 
													player.updateInventory();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
								if (arena.seekers.size() >= arena.playersInArena
 | 
													if (arena.seekers.size() >= arena.playersInArena.size()) {
 | 
				
			||||||
										.size()) {
 | 
					 | 
				
			||||||
									ArenaHandler.seekersWin(arena);
 | 
														ArenaHandler.seekersWin(arena);
 | 
				
			||||||
								} else {
 | 
													} else {
 | 
				
			||||||
									DisguiseAPI.undisguiseToAll(player);
 | 
														DisguiseAPI.undisguiseToAll(player);
 | 
				
			||||||
									W.seekertime.put(player,
 | 
														W.seekertime.put(player, arena.waitingTimeSeeker);
 | 
				
			||||||
											arena.waitingTimeSeeker);
 | 
					 | 
				
			||||||
									player.teleport(arena.seekersWarp);
 | 
														player.teleport(arena.seekersWarp);
 | 
				
			||||||
									player.setGameMode(GameMode.SURVIVAL);
 | 
														player.setGameMode(GameMode.SURVIVAL);
 | 
				
			||||||
									player.setWalkSpeed(0.25F);
 | 
														player.setWalkSpeed(0.25F);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
									// Fix for client not showing players after they join
 | 
														// Fix for client not showing players after
 | 
				
			||||||
 | 
														// they join
 | 
				
			||||||
									for (Player otherplayer : arena.playersInArena) {
 | 
														for (Player otherplayer : arena.playersInArena) {
 | 
				
			||||||
										if (otherplayer.canSee(player)) otherplayer.showPlayer(player);       // Make new player visible to others
 | 
															if (otherplayer.canSee(player))
 | 
				
			||||||
										if (player.canSee(otherplayer)) player.showPlayer(otherplayer);       // Make other players visible to new player
 | 
																otherplayer.showPlayer(player); // Make
 | 
				
			||||||
 | 
																								// new
 | 
				
			||||||
 | 
																								// player
 | 
				
			||||||
 | 
																								// visible
 | 
				
			||||||
 | 
																								// to
 | 
				
			||||||
 | 
																								// others
 | 
				
			||||||
 | 
															if (player.canSee(otherplayer))
 | 
				
			||||||
 | 
																player.showPlayer(otherplayer); // Make
 | 
				
			||||||
 | 
																								// other
 | 
				
			||||||
 | 
																								// players
 | 
				
			||||||
 | 
																								// visible
 | 
				
			||||||
 | 
																								// to
 | 
				
			||||||
 | 
																								// new
 | 
				
			||||||
 | 
																								// player
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,7 +13,7 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class OnEntityDamageEvent implements Listener {
 | 
					public class OnEntityDamageEvent implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
 | 
						@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
 | 
				
			||||||
	public void onEntityDamageEvent(EntityDamageEvent event) {
 | 
						public void onEntityDamageEvent(EntityDamageEvent event) {
 | 
				
			||||||
		Entity ent = event.getEntity();
 | 
							Entity ent = event.getEntity();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,7 +11,7 @@ import org.bukkit.event.entity.FoodLevelChangeEvent;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class OnFoodLevelChangeEvent implements Listener {
 | 
					public class OnFoodLevelChangeEvent implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
 | 
						@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
 | 
				
			||||||
	public void onFoodLevelChangeEvent(FoodLevelChangeEvent event) {
 | 
						public void onFoodLevelChangeEvent(FoodLevelChangeEvent event) {
 | 
				
			||||||
		Player player = (Player) event.getEntity();
 | 
							Player player = (Player) event.getEntity();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,13 +22,12 @@ import org.bukkit.inventory.ItemStack;
 | 
				
			|||||||
public class OnInventoryClickEvent implements Listener {
 | 
					public class OnInventoryClickEvent implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@SuppressWarnings("deprecation")
 | 
						@SuppressWarnings("deprecation")
 | 
				
			||||||
	@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
 | 
						@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
 | 
				
			||||||
	public void onInventoryClickEvent(InventoryClickEvent event) {
 | 
						public void onInventoryClickEvent(InventoryClickEvent event) {
 | 
				
			||||||
		Player player = (Player) event.getWhoClicked();
 | 
							Player player = (Player) event.getWhoClicked();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (Arena arena : W.arenaList) {
 | 
							for (Arena arena : W.arenaList) {
 | 
				
			||||||
			if (arena.playersInArena.contains(player)
 | 
								if (arena.playersInArena.contains(player) && !arena.seekers.contains(player)) {
 | 
				
			||||||
					&& !arena.seekers.contains(player)) {
 | 
					 | 
				
			||||||
				if (event.getSlot() == 8 || event.getSlot() == 39) {
 | 
									if (event.getSlot() == 8 || event.getSlot() == 39) {
 | 
				
			||||||
					event.setCancelled(true);
 | 
										event.setCancelled(true);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
@@ -40,11 +39,9 @@ public class OnInventoryClickEvent implements Listener {
 | 
				
			|||||||
			if (inv.getName().contains("DisguiseBlocks")) {
 | 
								if (inv.getName().contains("DisguiseBlocks")) {
 | 
				
			||||||
				if (event.getCurrentItem() != null) {
 | 
									if (event.getCurrentItem() != null) {
 | 
				
			||||||
					if (!event.getCurrentItem().getType().isBlock()) {
 | 
										if (!event.getCurrentItem().getType().isBlock()) {
 | 
				
			||||||
						if (!event.getCurrentItem().getType()
 | 
											if (!event.getCurrentItem().getType().equals(Material.FLOWER_POT_ITEM)) {
 | 
				
			||||||
								.equals(Material.FLOWER_POT_ITEM)) {
 | 
					 | 
				
			||||||
							event.setCancelled(true);
 | 
												event.setCancelled(true);
 | 
				
			||||||
							MessageM.sendFMessage(player,
 | 
												MessageM.sendFMessage(player, ConfigC.error_setNotABlock);
 | 
				
			||||||
									ConfigC.error_setNotABlock);
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
@@ -53,127 +50,71 @@ public class OnInventoryClickEvent implements Listener {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Early exit if this isnt a blockhunt inventory
 | 
								// Early exit if this isnt a blockhunt inventory
 | 
				
			||||||
			if (!inv.getName().contains("BlockHunt")) return;
 | 
								if (!inv.getName().contains("BlockHunt"))
 | 
				
			||||||
 | 
									return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (inv.getName().startsWith("\u00A7r")) {
 | 
								if (inv.getName().startsWith("\u00A7r")) {
 | 
				
			||||||
				if (inv.getName().equals(
 | 
									if (inv.getName().equals(MessageM.replaceAll((String) "\u00A7r" + W.config.get(ConfigC.shop_title)))) {
 | 
				
			||||||
						MessageM.replaceAll((String) "\u00A7r"
 | 
					 | 
				
			||||||
								+ W.config.get(ConfigC.shop_title)))) {
 | 
					 | 
				
			||||||
					event.setCancelled(true);
 | 
										event.setCancelled(true);
 | 
				
			||||||
					ItemStack item = event.getCurrentItem();
 | 
										ItemStack item = event.getCurrentItem();
 | 
				
			||||||
					if (W.shop.getFile().get(player.getName() + ".tokens") == null) {
 | 
										if (W.shop.getFile().get(player.getName() + ".tokens") == null) {
 | 
				
			||||||
						W.shop.getFile().set(player.getName() + ".tokens", 0);
 | 
											W.shop.getFile().set(player.getName() + ".tokens", 0);
 | 
				
			||||||
						W.shop.save();
 | 
											W.shop.save();
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
					int playerTokens = W.shop.getFile().getInt(
 | 
										int playerTokens = W.shop.getFile().getInt(player.getName() + ".tokens");
 | 
				
			||||||
							player.getName() + ".tokens");
 | 
					 | 
				
			||||||
					if (item == null)
 | 
										if (item == null)
 | 
				
			||||||
						return;
 | 
											return;
 | 
				
			||||||
					if (item.getType().equals(Material.AIR))
 | 
										if (item.getType().equals(Material.AIR))
 | 
				
			||||||
						return;
 | 
											return;
 | 
				
			||||||
					if (item.getItemMeta().getDisplayName() == null)
 | 
										if (item.getItemMeta().getDisplayName() == null)
 | 
				
			||||||
						return;
 | 
											return;
 | 
				
			||||||
					if (item.getItemMeta()
 | 
										if (item.getItemMeta().getDisplayName().equals(MessageM.replaceAll(W.config.get(ConfigC.shop_blockChooserv1Name).toString()))) {
 | 
				
			||||||
							.getDisplayName()
 | 
											if (playerTokens >= (Integer) W.config.get(ConfigC.shop_blockChooserv1Price)) {
 | 
				
			||||||
							.equals(MessageM
 | 
												W.shop.getFile().set(player.getName() + ".blockchooser", true);
 | 
				
			||||||
									.replaceAll(W.config.get(
 | 
												W.shop.getFile().set(player.getName() + ".tokens", playerTokens - (Integer) W.config.get(ConfigC.shop_blockChooserv1Price));
 | 
				
			||||||
											ConfigC.shop_blockChooserv1Name)
 | 
					 | 
				
			||||||
											.toString()))) {
 | 
					 | 
				
			||||||
						if (playerTokens >= (Integer) W.config
 | 
					 | 
				
			||||||
								.get(ConfigC.shop_blockChooserv1Price)) {
 | 
					 | 
				
			||||||
							W.shop.getFile().set(
 | 
					 | 
				
			||||||
									player.getName() + ".blockchooser", true);
 | 
					 | 
				
			||||||
							W.shop.getFile()
 | 
					 | 
				
			||||||
									.set(player.getName() + ".tokens",
 | 
					 | 
				
			||||||
											playerTokens
 | 
					 | 
				
			||||||
													- (Integer) W.config
 | 
					 | 
				
			||||||
															.get(ConfigC.shop_blockChooserv1Price));
 | 
					 | 
				
			||||||
							W.shop.save();
 | 
												W.shop.save();
 | 
				
			||||||
							MessageM.sendFMessage(
 | 
												MessageM.sendFMessage(player, ConfigC.normal_shopBoughtItem, "itemname-" + W.config.get(ConfigC.shop_blockChooserv1Name));
 | 
				
			||||||
									player,
 | 
					 | 
				
			||||||
									ConfigC.normal_shopBoughtItem,
 | 
					 | 
				
			||||||
									"itemname-"
 | 
					 | 
				
			||||||
											+ W.config
 | 
					 | 
				
			||||||
													.get(ConfigC.shop_blockChooserv1Name));
 | 
					 | 
				
			||||||
						} else {
 | 
											} else {
 | 
				
			||||||
							MessageM.sendFMessage(player,
 | 
												MessageM.sendFMessage(player, ConfigC.error_shopNeedMoreTokens);
 | 
				
			||||||
									ConfigC.error_shopNeedMoreTokens);
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					} else if (item
 | 
										} else if (item.getItemMeta().getDisplayName().equals(MessageM.replaceAll(W.config.get(ConfigC.shop_BlockHuntPassv2Name).toString()))) {
 | 
				
			||||||
							.getItemMeta()
 | 
											if (playerTokens >= (Integer) W.config.get(ConfigC.shop_BlockHuntPassv2Price)) {
 | 
				
			||||||
							.getDisplayName()
 | 
												if (W.shop.getFile().get(player.getName() + ".blockhuntpass") == null) {
 | 
				
			||||||
							.equals(MessageM.replaceAll(W.config.get(
 | 
													W.shop.getFile().set(player.getName() + ".blockhuntpass", 0);
 | 
				
			||||||
									ConfigC.shop_BlockHuntPassv2Name)
 | 
					 | 
				
			||||||
									.toString()))) {
 | 
					 | 
				
			||||||
						if (playerTokens >= (Integer) W.config
 | 
					 | 
				
			||||||
								.get(ConfigC.shop_BlockHuntPassv2Price)) {
 | 
					 | 
				
			||||||
							if (W.shop.getFile().get(
 | 
					 | 
				
			||||||
									player.getName() + ".blockhuntpass") == null) {
 | 
					 | 
				
			||||||
								W.shop.getFile().set(
 | 
					 | 
				
			||||||
										player.getName() + ".blockhuntpass", 0);
 | 
					 | 
				
			||||||
								W.shop.save();
 | 
													W.shop.save();
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							W.shop.getFile().set(
 | 
												W.shop.getFile().set(player.getName() + ".blockhuntpass", (Integer) W.shop.getFile().get(player.getName() + ".blockhuntpass") + 1);
 | 
				
			||||||
									player.getName() + ".blockhuntpass",
 | 
												W.shop.getFile().set(player.getName() + ".tokens", playerTokens - (Integer) W.config.get(ConfigC.shop_BlockHuntPassv2Price));
 | 
				
			||||||
									(Integer) W.shop.getFile()
 | 
					 | 
				
			||||||
											.get(player.getName()
 | 
					 | 
				
			||||||
													+ ".blockhuntpass") + 1);
 | 
					 | 
				
			||||||
							W.shop.getFile()
 | 
					 | 
				
			||||||
									.set(player.getName() + ".tokens",
 | 
					 | 
				
			||||||
											playerTokens
 | 
					 | 
				
			||||||
													- (Integer) W.config
 | 
					 | 
				
			||||||
															.get(ConfigC.shop_BlockHuntPassv2Price));
 | 
					 | 
				
			||||||
							W.shop.save();
 | 
												W.shop.save();
 | 
				
			||||||
							MessageM.sendFMessage(
 | 
												MessageM.sendFMessage(player, ConfigC.normal_shopBoughtItem, "itemname-" + W.config.get(ConfigC.shop_BlockHuntPassv2Name));
 | 
				
			||||||
									player,
 | 
					 | 
				
			||||||
									ConfigC.normal_shopBoughtItem,
 | 
					 | 
				
			||||||
									"itemname-"
 | 
					 | 
				
			||||||
											+ W.config
 | 
					 | 
				
			||||||
													.get(ConfigC.shop_BlockHuntPassv2Name));
 | 
					 | 
				
			||||||
						} else {
 | 
											} else {
 | 
				
			||||||
							MessageM.sendFMessage(player,
 | 
												MessageM.sendFMessage(player, ConfigC.error_shopNeedMoreTokens);
 | 
				
			||||||
									ConfigC.error_shopNeedMoreTokens);
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					InventoryHandler.openShop(player);
 | 
										InventoryHandler.openShop(player);
 | 
				
			||||||
				} else if (inv.getName().contains(
 | 
									} else if (inv.getName().contains(MessageM.replaceAll((String) W.config.get(ConfigC.shop_blockChooserv1Name)))) {
 | 
				
			||||||
						MessageM.replaceAll((String) W.config
 | 
					 | 
				
			||||||
								.get(ConfigC.shop_blockChooserv1Name)))) {
 | 
					 | 
				
			||||||
					event.setCancelled(true);
 | 
										event.setCancelled(true);
 | 
				
			||||||
					if (event.getCurrentItem().getType() != Material.AIR) {
 | 
										if (event.getCurrentItem().getType() != Material.AIR) {
 | 
				
			||||||
						if (event.getCurrentItem().getType().isBlock()) {
 | 
											if (event.getCurrentItem().getType().isBlock()) {
 | 
				
			||||||
							W.choosenBlock.put(player, event.getCurrentItem());
 | 
												W.choosenBlock.put(player, event.getCurrentItem());
 | 
				
			||||||
							MessageM.sendFMessage(
 | 
												MessageM.sendFMessage(player, ConfigC.normal_shopChoosenBlock, "block-"
 | 
				
			||||||
									player,
 | 
														+ event.getCurrentItem().getType().toString().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase());
 | 
				
			||||||
									ConfigC.normal_shopChoosenBlock,
 | 
					 | 
				
			||||||
									"block-"
 | 
					 | 
				
			||||||
											+ event.getCurrentItem().getType()
 | 
					 | 
				
			||||||
													.toString()
 | 
					 | 
				
			||||||
													.replaceAll("_", "")
 | 
					 | 
				
			||||||
													.replaceAll("BLOCK", "")
 | 
					 | 
				
			||||||
													.toLowerCase());
 | 
					 | 
				
			||||||
						} else {
 | 
											} else {
 | 
				
			||||||
							MessageM.sendFMessage(player,
 | 
												MessageM.sendFMessage(player, ConfigC.error_setNotABlock);
 | 
				
			||||||
									ConfigC.error_setNotABlock);
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				} else if (inv.getName().contains(
 | 
									} else if (inv.getName().contains(MessageM.replaceAll((String) W.config.get(ConfigC.shop_BlockHuntPassv2Name)))) {
 | 
				
			||||||
						MessageM.replaceAll((String) W.config
 | 
					 | 
				
			||||||
								.get(ConfigC.shop_BlockHuntPassv2Name)))) {
 | 
					 | 
				
			||||||
					event.setCancelled(true);
 | 
										event.setCancelled(true);
 | 
				
			||||||
					if (event.getCurrentItem().getType() != Material.AIR) {
 | 
										if (event.getCurrentItem().getType() != Material.AIR) {
 | 
				
			||||||
						if (event.getCurrentItem().getType()
 | 
											if (event.getCurrentItem().getType().equals(Material.WOOL) && event.getCurrentItem().getDurability() == (short) 11) {
 | 
				
			||||||
								.equals(Material.WOOL)
 | 
					 | 
				
			||||||
								&& event.getCurrentItem().getDurability() == (short) 11) {
 | 
					 | 
				
			||||||
							int i = 0;
 | 
												int i = 0;
 | 
				
			||||||
							for (Arena arena : W.arenaList) {
 | 
												for (Arena arena : W.arenaList) {
 | 
				
			||||||
								if (arena.playersInArena.contains(player)) {
 | 
													if (arena.playersInArena.contains(player)) {
 | 
				
			||||||
									for (Player playerCheck : arena.playersInArena) {
 | 
														for (Player playerCheck : arena.playersInArena) {
 | 
				
			||||||
										if (W.choosenSeeker.get(playerCheck) != null) {
 | 
															if (W.choosenSeeker.get(playerCheck) != null) {
 | 
				
			||||||
											if (W.choosenSeeker
 | 
																if (W.choosenSeeker.get(playerCheck) == true) {
 | 
				
			||||||
													.get(playerCheck) == true) {
 | 
					 | 
				
			||||||
												i = i + 1;
 | 
																	i = i + 1;
 | 
				
			||||||
											}
 | 
																}
 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
@@ -181,47 +122,30 @@ public class OnInventoryClickEvent implements Listener {
 | 
				
			|||||||
								}
 | 
													}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
								if (i >= arena.amountSeekersOnStart) {
 | 
													if (i >= arena.amountSeekersOnStart) {
 | 
				
			||||||
									MessageM.sendFMessage(player,
 | 
														MessageM.sendFMessage(player, ConfigC.error_shopMaxSeekersReached);
 | 
				
			||||||
											ConfigC.error_shopMaxSeekersReached);
 | 
					 | 
				
			||||||
								} else {
 | 
													} else {
 | 
				
			||||||
									W.choosenSeeker.put(player, true);
 | 
														W.choosenSeeker.put(player, true);
 | 
				
			||||||
									player.getInventory().setItemInHand(
 | 
														player.getInventory().setItemInHand(new ItemStack(Material.AIR));
 | 
				
			||||||
											new ItemStack(Material.AIR));
 | 
					 | 
				
			||||||
									player.updateInventory();
 | 
														player.updateInventory();
 | 
				
			||||||
									MessageM.sendFMessage(player,
 | 
														MessageM.sendFMessage(player, ConfigC.normal_shopChoosenSeeker);
 | 
				
			||||||
											ConfigC.normal_shopChoosenSeeker);
 | 
					 | 
				
			||||||
									inv.clear();
 | 
														inv.clear();
 | 
				
			||||||
									if (W.shop.getFile()
 | 
														if (W.shop.getFile().getInt(player.getName() + ".blockhuntpass") == 1) {
 | 
				
			||||||
											.getInt(player.getName()
 | 
															W.shop.getFile().set(player.getName() + ".blockhuntpass", null);
 | 
				
			||||||
													+ ".blockhuntpass") == 1) {
 | 
					 | 
				
			||||||
										W.shop.getFile().set(
 | 
					 | 
				
			||||||
												player.getName()
 | 
					 | 
				
			||||||
														+ ".blockhuntpass",
 | 
					 | 
				
			||||||
												null);
 | 
					 | 
				
			||||||
										W.shop.save();
 | 
															W.shop.save();
 | 
				
			||||||
									} else {
 | 
														} else {
 | 
				
			||||||
										W.shop.getFile()
 | 
															W.shop.getFile().set(player.getName() + ".blockhuntpass", W.shop.getFile().getInt(player.getName() + ".blockhuntpass") - 1);
 | 
				
			||||||
												.set(player.getName()
 | 
					 | 
				
			||||||
														+ ".blockhuntpass",
 | 
					 | 
				
			||||||
														W.shop.getFile()
 | 
					 | 
				
			||||||
																.getInt(player
 | 
					 | 
				
			||||||
																		.getName()
 | 
					 | 
				
			||||||
																		+ ".blockhuntpass") - 1);
 | 
					 | 
				
			||||||
										W.shop.save();
 | 
															W.shop.save();
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						} else if (event.getCurrentItem().getType()
 | 
											} else if (event.getCurrentItem().getType().equals(Material.WOOL) && event.getCurrentItem().getDurability() == (short) 14) {
 | 
				
			||||||
								.equals(Material.WOOL)
 | 
					 | 
				
			||||||
								&& event.getCurrentItem().getDurability() == (short) 14) {
 | 
					 | 
				
			||||||
							int i = 0;
 | 
												int i = 0;
 | 
				
			||||||
							for (Arena arena : W.arenaList) {
 | 
												for (Arena arena : W.arenaList) {
 | 
				
			||||||
								if (arena.playersInArena.contains(player)) {
 | 
													if (arena.playersInArena.contains(player)) {
 | 
				
			||||||
									for (Player playerCheck : arena.playersInArena) {
 | 
														for (Player playerCheck : arena.playersInArena) {
 | 
				
			||||||
										if (W.choosenSeeker.get(playerCheck) != null) {
 | 
															if (W.choosenSeeker.get(playerCheck) != null) {
 | 
				
			||||||
											if (W.choosenSeeker
 | 
																if (W.choosenSeeker.get(playerCheck) == false) {
 | 
				
			||||||
													.get(playerCheck) == false) {
 | 
					 | 
				
			||||||
												i = i + 1;
 | 
																	i = i + 1;
 | 
				
			||||||
											}
 | 
																}
 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
@@ -229,32 +153,18 @@ public class OnInventoryClickEvent implements Listener {
 | 
				
			|||||||
								}
 | 
													}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
								if (i >= (arena.playersInArena.size() - 1)) {
 | 
													if (i >= (arena.playersInArena.size() - 1)) {
 | 
				
			||||||
									MessageM.sendFMessage(player,
 | 
														MessageM.sendFMessage(player, ConfigC.error_shopMaxHidersReached);
 | 
				
			||||||
											ConfigC.error_shopMaxHidersReached);
 | 
					 | 
				
			||||||
								} else {
 | 
													} else {
 | 
				
			||||||
									W.choosenSeeker.put(player, false);
 | 
														W.choosenSeeker.put(player, false);
 | 
				
			||||||
									player.getInventory().setItemInHand(
 | 
														player.getInventory().setItemInHand(new ItemStack(Material.AIR));
 | 
				
			||||||
											new ItemStack(Material.AIR));
 | 
					 | 
				
			||||||
									player.updateInventory();
 | 
														player.updateInventory();
 | 
				
			||||||
									MessageM.sendFMessage(player,
 | 
														MessageM.sendFMessage(player, ConfigC.normal_shopChoosenHiders);
 | 
				
			||||||
											ConfigC.normal_shopChoosenHiders);
 | 
					 | 
				
			||||||
									inv.clear();
 | 
														inv.clear();
 | 
				
			||||||
									if (W.shop.getFile()
 | 
														if (W.shop.getFile().getInt(player.getName() + ".blockhuntpass") == 1) {
 | 
				
			||||||
											.getInt(player.getName()
 | 
															W.shop.getFile().set(player.getName() + ".blockhuntpass", null);
 | 
				
			||||||
													+ ".blockhuntpass") == 1) {
 | 
					 | 
				
			||||||
										W.shop.getFile().set(
 | 
					 | 
				
			||||||
												player.getName()
 | 
					 | 
				
			||||||
														+ ".blockhuntpass",
 | 
					 | 
				
			||||||
												null);
 | 
					 | 
				
			||||||
										W.shop.save();
 | 
															W.shop.save();
 | 
				
			||||||
									} else {
 | 
														} else {
 | 
				
			||||||
										W.shop.getFile()
 | 
															W.shop.getFile().set(player.getName() + ".blockhuntpass", W.shop.getFile().getInt(player.getName() + ".blockhuntpass") - 1);
 | 
				
			||||||
												.set(player.getName()
 | 
					 | 
				
			||||||
														+ ".blockhuntpass",
 | 
					 | 
				
			||||||
														W.shop.getFile()
 | 
					 | 
				
			||||||
																.getInt(player
 | 
					 | 
				
			||||||
																		.getName()
 | 
					 | 
				
			||||||
																		+ ".blockhuntpass") - 1);
 | 
					 | 
				
			||||||
										W.shop.save();
 | 
															W.shop.save();
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
@@ -264,13 +174,7 @@ public class OnInventoryClickEvent implements Listener {
 | 
				
			|||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					event.setCancelled(true);
 | 
										event.setCancelled(true);
 | 
				
			||||||
					ItemStack item = event.getCurrentItem();
 | 
										ItemStack item = event.getCurrentItem();
 | 
				
			||||||
					String arenaname = inv
 | 
										String arenaname = inv.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageM.replaceAll("%NBlockHunt arena: %A"), "");
 | 
				
			||||||
							.getItem(0)
 | 
					 | 
				
			||||||
							.getItemMeta()
 | 
					 | 
				
			||||||
							.getDisplayName()
 | 
					 | 
				
			||||||
							.replaceAll(
 | 
					 | 
				
			||||||
									MessageM.replaceAll("%NBlockHunt arena: %A"),
 | 
					 | 
				
			||||||
									"");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
					Arena arena = null;
 | 
										Arena arena = null;
 | 
				
			||||||
					for (Arena arena2 : W.arenaList) {
 | 
										for (Arena arena2 : W.arenaList) {
 | 
				
			||||||
@@ -286,65 +190,33 @@ public class OnInventoryClickEvent implements Listener {
 | 
				
			|||||||
					if (!item.getItemMeta().hasDisplayName())
 | 
										if (!item.getItemMeta().hasDisplayName())
 | 
				
			||||||
						return;
 | 
											return;
 | 
				
			||||||
					if (item.getType().equals(Material.GOLD_NUGGET)) {
 | 
										if (item.getType().equals(Material.GOLD_NUGGET)) {
 | 
				
			||||||
						if (item.getItemMeta().getDisplayName()
 | 
											if (item.getItemMeta().getDisplayName().contains("maxPlayers")) {
 | 
				
			||||||
								.contains("maxPlayers")) {
 | 
												updownButton(player, item, arena, ArenaType.maxPlayers, arena.maxPlayers, Bukkit.getMaxPlayers(), 2, 1, 1);
 | 
				
			||||||
							updownButton(player, item, arena,
 | 
											} else if (item.getItemMeta().getDisplayName().contains("minPlayers")) {
 | 
				
			||||||
									ArenaType.maxPlayers, arena.maxPlayers,
 | 
												updownButton(player, item, arena, ArenaType.minPlayers, arena.minPlayers, Bukkit.getMaxPlayers() - 1, 2, 1, 1);
 | 
				
			||||||
									Bukkit.getMaxPlayers(), 2, 1, 1);
 | 
											} else if (item.getItemMeta().getDisplayName().contains("amountSeekersOnStart")) {
 | 
				
			||||||
						} else if (item.getItemMeta().getDisplayName()
 | 
												updownButton(player, item, arena, ArenaType.amountSeekersOnStart, arena.amountSeekersOnStart, arena.maxPlayers - 1, 1, 1, 1);
 | 
				
			||||||
								.contains("minPlayers")) {
 | 
											} else if (item.getItemMeta().getDisplayName().contains("timeInLobbyUntilStart")) {
 | 
				
			||||||
							updownButton(player, item, arena,
 | 
												updownButton(player, item, arena, ArenaType.timeInLobbyUntilStart, arena.timeInLobbyUntilStart, 1000, 5, 1, 1);
 | 
				
			||||||
									ArenaType.minPlayers, arena.minPlayers,
 | 
											} else if (item.getItemMeta().getDisplayName().contains("waitingTimeSeeker")) {
 | 
				
			||||||
									Bukkit.getMaxPlayers() - 1, 2, 1, 1);
 | 
												updownButton(player, item, arena, ArenaType.waitingTimeSeeker, arena.waitingTimeSeeker, 1000, 5, 1, 1);
 | 
				
			||||||
						} else if (item.getItemMeta().getDisplayName()
 | 
											} else if (item.getItemMeta().getDisplayName().contains("gameTime")) {
 | 
				
			||||||
								.contains("amountSeekersOnStart")) {
 | 
												updownButton(player, item, arena, ArenaType.gameTime, arena.gameTime, 1000, 5, 1, 1);
 | 
				
			||||||
							updownButton(player, item, arena,
 | 
											} else if (item.getItemMeta().getDisplayName().contains("timeUntilHidersSword")) {
 | 
				
			||||||
									ArenaType.amountSeekersOnStart,
 | 
												updownButton(player, item, arena, ArenaType.timeUntilHidersSword, arena.timeUntilHidersSword, 1000, 0, 1, 1);
 | 
				
			||||||
									arena.amountSeekersOnStart,
 | 
											} else if (item.getItemMeta().getDisplayName().contains("hidersTokenWin")) {
 | 
				
			||||||
									arena.maxPlayers - 1, 1, 1, 1);
 | 
												updownButton(player, item, arena, ArenaType.hidersTokenWin, arena.hidersTokenWin, 1000, 0, 1, 1);
 | 
				
			||||||
						} else if (item.getItemMeta().getDisplayName()
 | 
											} else if (item.getItemMeta().getDisplayName().contains("seekersTokenWin")) {
 | 
				
			||||||
								.contains("timeInLobbyUntilStart")) {
 | 
												updownButton(player, item, arena, ArenaType.seekersTokenWin, arena.seekersTokenWin, 1000, 0, 1, 1);
 | 
				
			||||||
							updownButton(player, item, arena,
 | 
											} else if (item.getItemMeta().getDisplayName().contains("killTokens")) {
 | 
				
			||||||
									ArenaType.timeInLobbyUntilStart,
 | 
												updownButton(player, item, arena, ArenaType.killTokens, arena.killTokens, 1000, 0, 1, 1);
 | 
				
			||||||
									arena.timeInLobbyUntilStart, 1000, 5, 1, 1);
 | 
					 | 
				
			||||||
						} else if (item.getItemMeta().getDisplayName()
 | 
					 | 
				
			||||||
								.contains("waitingTimeSeeker")) {
 | 
					 | 
				
			||||||
							updownButton(player, item, arena,
 | 
					 | 
				
			||||||
									ArenaType.waitingTimeSeeker,
 | 
					 | 
				
			||||||
									arena.waitingTimeSeeker, 1000, 5, 1, 1);
 | 
					 | 
				
			||||||
						} else if (item.getItemMeta().getDisplayName()
 | 
					 | 
				
			||||||
								.contains("gameTime")) {
 | 
					 | 
				
			||||||
							updownButton(player, item, arena,
 | 
					 | 
				
			||||||
									ArenaType.gameTime, arena.gameTime, 1000,
 | 
					 | 
				
			||||||
									5, 1, 1);
 | 
					 | 
				
			||||||
						} else if (item.getItemMeta().getDisplayName()
 | 
					 | 
				
			||||||
								.contains("timeUntilHidersSword")) {
 | 
					 | 
				
			||||||
							updownButton(player, item, arena,
 | 
					 | 
				
			||||||
									ArenaType.timeUntilHidersSword,
 | 
					 | 
				
			||||||
									arena.timeUntilHidersSword, 1000, 0, 1, 1);
 | 
					 | 
				
			||||||
						} else if (item.getItemMeta().getDisplayName()
 | 
					 | 
				
			||||||
								.contains("hidersTokenWin")) {
 | 
					 | 
				
			||||||
							updownButton(player, item, arena,
 | 
					 | 
				
			||||||
									ArenaType.hidersTokenWin,
 | 
					 | 
				
			||||||
									arena.hidersTokenWin, 1000, 0, 1, 1);
 | 
					 | 
				
			||||||
						} else if (item.getItemMeta().getDisplayName()
 | 
					 | 
				
			||||||
								.contains("seekersTokenWin")) {
 | 
					 | 
				
			||||||
							updownButton(player, item, arena,
 | 
					 | 
				
			||||||
									ArenaType.seekersTokenWin,
 | 
					 | 
				
			||||||
									arena.seekersTokenWin, 1000, 0, 1, 1);
 | 
					 | 
				
			||||||
						} else if (item.getItemMeta().getDisplayName()
 | 
					 | 
				
			||||||
								.contains("killTokens")) {
 | 
					 | 
				
			||||||
							updownButton(player, item, arena,
 | 
					 | 
				
			||||||
									ArenaType.killTokens, arena.killTokens,
 | 
					 | 
				
			||||||
									1000, 0, 1, 1);
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						save(arena);
 | 
											save(arena);
 | 
				
			||||||
						InventoryHandler.openPanel(player, arena.arenaName);
 | 
											InventoryHandler.openPanel(player, arena.arenaName);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					} else if (item.getType().equals(Material.BOOK)) {
 | 
										} else if (item.getType().equals(Material.BOOK)) {
 | 
				
			||||||
						if (item.getItemMeta().getDisplayName()
 | 
											if (item.getItemMeta().getDisplayName().contains("disguiseBlocks")) {
 | 
				
			||||||
								.contains("disguiseBlocks")) {
 | 
					 | 
				
			||||||
							InventoryHandler.openDisguiseBlocks(arena, player);
 | 
												InventoryHandler.openDisguiseBlocks(arena, player);
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
@@ -359,10 +231,8 @@ public class OnInventoryClickEvent implements Listener {
 | 
				
			|||||||
		ArenaHandler.loadArenas();
 | 
							ArenaHandler.loadArenas();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public static void updownButton(Player player, ItemStack item, Arena arena,
 | 
						public static void updownButton(Player player, ItemStack item, Arena arena, ArenaType at, int option, int max, int min, int add, int remove) {
 | 
				
			||||||
			ArenaType at, int option, int max, int min, int add, int remove) {
 | 
							if (item.getItemMeta().getDisplayName().contains((String) W.messages.get(ConfigC.button_add2))) {
 | 
				
			||||||
		if (item.getItemMeta().getDisplayName()
 | 
					 | 
				
			||||||
				.contains((String) W.messages.get(ConfigC.button_add2))) {
 | 
					 | 
				
			||||||
			if (option < max) {
 | 
								if (option < max) {
 | 
				
			||||||
				switch (at) {
 | 
									switch (at) {
 | 
				
			||||||
				case maxPlayers:
 | 
									case maxPlayers:
 | 
				
			||||||
@@ -397,11 +267,9 @@ public class OnInventoryClickEvent implements Listener {
 | 
				
			|||||||
					break;
 | 
										break;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.error_setTooHighNumber,
 | 
									MessageM.sendFMessage(player, ConfigC.error_setTooHighNumber, "max-" + max);
 | 
				
			||||||
						"max-" + max);
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		} else if (item.getItemMeta().getDisplayName()
 | 
							} else if (item.getItemMeta().getDisplayName().contains((String) W.messages.get(ConfigC.button_remove2))) {
 | 
				
			||||||
				.contains((String) W.messages.get(ConfigC.button_remove2))) {
 | 
					 | 
				
			||||||
			if (option > min) {
 | 
								if (option > min) {
 | 
				
			||||||
				switch (at) {
 | 
									switch (at) {
 | 
				
			||||||
				case maxPlayers:
 | 
									case maxPlayers:
 | 
				
			||||||
@@ -436,8 +304,7 @@ public class OnInventoryClickEvent implements Listener {
 | 
				
			|||||||
					break;
 | 
										break;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				MessageM.sendFMessage(player, ConfigC.error_setTooLowNumber,
 | 
									MessageM.sendFMessage(player, ConfigC.error_setTooLowNumber, "min-" + min);
 | 
				
			||||||
						"min-" + min);
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,18 +18,12 @@ import org.bukkit.inventory.ItemStack;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class OnInventoryCloseEvent implements Listener {
 | 
					public class OnInventoryCloseEvent implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
 | 
						@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
 | 
				
			||||||
	public void onInventoryCloseEvent(InventoryCloseEvent event) {
 | 
						public void onInventoryCloseEvent(InventoryCloseEvent event) {
 | 
				
			||||||
		Inventory inv = event.getInventory();
 | 
							Inventory inv = event.getInventory();
 | 
				
			||||||
		if (inv.getType().equals(InventoryType.CHEST)) {
 | 
							if (inv.getType().equals(InventoryType.CHEST)) {
 | 
				
			||||||
			if (inv.getName().contains("DisguiseBlocks")) {
 | 
								if (inv.getName().contains("DisguiseBlocks")) {
 | 
				
			||||||
				String arenaname = inv
 | 
									String arenaname = inv.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageM.replaceAll("%NDisguiseBlocks of arena: %A"), "");
 | 
				
			||||||
						.getItem(0)
 | 
					 | 
				
			||||||
						.getItemMeta()
 | 
					 | 
				
			||||||
						.getDisplayName()
 | 
					 | 
				
			||||||
						.replaceAll(
 | 
					 | 
				
			||||||
								MessageM.replaceAll("%NDisguiseBlocks of arena: %A"),
 | 
					 | 
				
			||||||
								"");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
				Arena arena = null;
 | 
									Arena arena = null;
 | 
				
			||||||
				for (Arena arena2 : W.arenaList) {
 | 
									for (Arena arena2 : W.arenaList) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,22 +15,16 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class OnPlayerCommandPreprocessEvent implements Listener {
 | 
					public class OnPlayerCommandPreprocessEvent implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@EventHandler(priority = EventPriority.HIGH, ignoreCancelled=true)
 | 
						@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
 | 
				
			||||||
	public void onPlayerCommandPreprocessEvent(
 | 
						public void onPlayerCommandPreprocessEvent(PlayerCommandPreprocessEvent event) {
 | 
				
			||||||
			PlayerCommandPreprocessEvent event) {
 | 
					 | 
				
			||||||
		Player player = event.getPlayer();
 | 
							Player player = event.getPlayer();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (Arena arena : W.arenaList) {
 | 
							for (Arena arena : W.arenaList) {
 | 
				
			||||||
			if (arena.playersInArena.contains(player)) {
 | 
								if (arena.playersInArena.contains(player)) {
 | 
				
			||||||
				String m = event.getMessage();
 | 
									String m = event.getMessage();
 | 
				
			||||||
				if (m.startsWith("/blockhunt") || m.startsWith("/bh")
 | 
									if (m.startsWith("/blockhunt") || m.startsWith("/bh") || m.startsWith("/seekandfind") || m.startsWith("/seekandfind") || m.startsWith("/saf")
 | 
				
			||||||
						|| m.startsWith("/seekandfind")
 | 
											|| m.startsWith("/sf") || m.startsWith("/hideandseek") || m.startsWith("/has") || m.startsWith("/hs") || m.startsWith("/ban")
 | 
				
			||||||
						|| m.startsWith("/seekandfind") || m.startsWith("/saf")
 | 
											|| m.startsWith("/kick") || m.startsWith("/tempban") || m.startsWith("/mute") || m.startsWith("/reload")) {
 | 
				
			||||||
						|| m.startsWith("/sf") || m.startsWith("/hideandseek")
 | 
					 | 
				
			||||||
						|| m.startsWith("/has") || m.startsWith("/hs")
 | 
					 | 
				
			||||||
						|| m.startsWith("/ban") || m.startsWith("/kick")
 | 
					 | 
				
			||||||
						|| m.startsWith("/tempban") || m.startsWith("/mute")
 | 
					 | 
				
			||||||
						|| m.startsWith("/reload")) {
 | 
					 | 
				
			||||||
					return;
 | 
										return;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -40,8 +34,7 @@ public class OnPlayerCommandPreprocessEvent implements Listener {
 | 
				
			|||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (PermissionsM
 | 
									if (PermissionsM.hasPerm(player, Permissions.allcommands, false)) {
 | 
				
			||||||
						.hasPerm(player, Permissions.allcommands, false)) {
 | 
					 | 
				
			||||||
					return;
 | 
										return;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,7 +11,7 @@ import org.bukkit.event.player.PlayerDropItemEvent;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class OnPlayerDropItemEvent implements Listener {
 | 
					public class OnPlayerDropItemEvent implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
 | 
						@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
 | 
				
			||||||
	public void onPlayerDropItemEvent(PlayerDropItemEvent event) {
 | 
						public void onPlayerDropItemEvent(PlayerDropItemEvent event) {
 | 
				
			||||||
		Player player = event.getPlayer();
 | 
							Player player = event.getPlayer();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,7 +31,7 @@ import org.bukkit.inventory.meta.ItemMeta;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class OnPlayerInteractEvent implements Listener {
 | 
					public class OnPlayerInteractEvent implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
 | 
						@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
 | 
				
			||||||
	public void onPlayerInteractEvent(PlayerInteractEvent event) {
 | 
						public void onPlayerInteractEvent(PlayerInteractEvent event) {
 | 
				
			||||||
		Player player = event.getPlayer();
 | 
							Player player = event.getPlayer();
 | 
				
			||||||
		Block block = event.getClickedBlock();
 | 
							Block block = event.getClickedBlock();
 | 
				
			||||||
@@ -40,49 +40,24 @@ public class OnPlayerInteractEvent implements Listener {
 | 
				
			|||||||
			if (item.getType() != Material.AIR) {
 | 
								if (item.getType() != Material.AIR) {
 | 
				
			||||||
				if (item.getItemMeta().hasDisplayName()) {
 | 
									if (item.getItemMeta().hasDisplayName()) {
 | 
				
			||||||
					ItemMeta im = item.getItemMeta();
 | 
										ItemMeta im = item.getItemMeta();
 | 
				
			||||||
					if (im.getDisplayName().equals(
 | 
										if (im.getDisplayName().equals(MessageM.replaceAll((String) W.config.get(ConfigC.wandName)))) {
 | 
				
			||||||
							MessageM.replaceAll((String) W.config
 | 
					 | 
				
			||||||
									.get(ConfigC.wandName)))) {
 | 
					 | 
				
			||||||
						Action action = event.getAction();
 | 
											Action action = event.getAction();
 | 
				
			||||||
						if (event.hasBlock()) {
 | 
											if (event.hasBlock()) {
 | 
				
			||||||
							LocationSerializable location = new LocationSerializable(
 | 
												LocationSerializable location = new LocationSerializable(event.getClickedBlock().getLocation());
 | 
				
			||||||
									event.getClickedBlock().getLocation());
 | 
					 | 
				
			||||||
							if (action.equals(Action.LEFT_CLICK_BLOCK)) {
 | 
												if (action.equals(Action.LEFT_CLICK_BLOCK)) {
 | 
				
			||||||
								event.setCancelled(true);
 | 
													event.setCancelled(true);
 | 
				
			||||||
								if (W.pos1.get(player) == null
 | 
													if (W.pos1.get(player) == null || !W.pos1.get(player).equals(location)) {
 | 
				
			||||||
										|| !W.pos1.get(player).equals(location)) {
 | 
														MessageM.sendFMessage(player, ConfigC.normal_wandSetPosition, "number-1",
 | 
				
			||||||
									MessageM.sendFMessage(
 | 
																"pos-%N(%A" + location.getBlockX() + "%N, %A" + location.getBlockY() + "%N, %A" + location.getBlockZ() + "%N)", "x-"
 | 
				
			||||||
											player,
 | 
																		+ location.getBlockX(), "y-" + location.getBlockY(), "z-" + location.getBlockZ());
 | 
				
			||||||
											ConfigC.normal_wandSetPosition,
 | 
					 | 
				
			||||||
											"number-1",
 | 
					 | 
				
			||||||
											"pos-%N(%A" + location.getBlockX()
 | 
					 | 
				
			||||||
													+ "%N, %A"
 | 
					 | 
				
			||||||
													+ location.getBlockY()
 | 
					 | 
				
			||||||
													+ "%N, %A"
 | 
					 | 
				
			||||||
													+ location.getBlockZ()
 | 
					 | 
				
			||||||
													+ "%N)",
 | 
					 | 
				
			||||||
											"x-" + location.getBlockX(), "y-"
 | 
					 | 
				
			||||||
													+ location.getBlockY(),
 | 
					 | 
				
			||||||
											"z-" + location.getBlockZ());
 | 
					 | 
				
			||||||
									W.pos1.put(player, location);
 | 
														W.pos1.put(player, location);
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
							} else if (action.equals(Action.RIGHT_CLICK_BLOCK)) {
 | 
												} else if (action.equals(Action.RIGHT_CLICK_BLOCK)) {
 | 
				
			||||||
								event.setCancelled(true);
 | 
													event.setCancelled(true);
 | 
				
			||||||
								if (W.pos2.get(player) == null
 | 
													if (W.pos2.get(player) == null || !W.pos2.get(player).equals(location)) {
 | 
				
			||||||
										|| !W.pos2.get(player).equals(location)) {
 | 
														MessageM.sendFMessage(player, ConfigC.normal_wandSetPosition, "number-2",
 | 
				
			||||||
									MessageM.sendFMessage(
 | 
																"pos-%N(%A" + location.getBlockX() + "%N, %A" + location.getBlockY() + "%N, %A" + location.getBlockZ() + "%N)", "x-"
 | 
				
			||||||
											player,
 | 
																		+ location.getBlockX(), "y-" + location.getBlockY(), "z-" + location.getBlockZ());
 | 
				
			||||||
											ConfigC.normal_wandSetPosition,
 | 
					 | 
				
			||||||
											"number-2",
 | 
					 | 
				
			||||||
											"pos-%N(%A" + location.getBlockX()
 | 
					 | 
				
			||||||
													+ "%N, %A"
 | 
					 | 
				
			||||||
													+ location.getBlockY()
 | 
					 | 
				
			||||||
													+ "%N, %A"
 | 
					 | 
				
			||||||
													+ location.getBlockZ()
 | 
					 | 
				
			||||||
													+ "%N)",
 | 
					 | 
				
			||||||
											"x-" + location.getBlockX(), "y-"
 | 
					 | 
				
			||||||
													+ location.getBlockY(),
 | 
					 | 
				
			||||||
											"z-" + location.getBlockZ());
 | 
					 | 
				
			||||||
									W.pos2.put(player, location);
 | 
														W.pos2.put(player, location);
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
@@ -94,44 +69,23 @@ public class OnPlayerInteractEvent implements Listener {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
 | 
							if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
 | 
				
			||||||
			if (event.getClickedBlock() != null) {
 | 
								if (event.getClickedBlock() != null) {
 | 
				
			||||||
				if (event.getClickedBlock().getType()
 | 
									if (event.getClickedBlock().getType().equals(Material.SIGN_POST) || event.getClickedBlock().getType().equals(Material.WALL_SIGN)) {
 | 
				
			||||||
						.equals(Material.SIGN_POST)
 | 
										if (SignsHandler.isSign(new LocationSerializable(event.getClickedBlock().getLocation()))) {
 | 
				
			||||||
						|| event.getClickedBlock().getType()
 | 
					 | 
				
			||||||
								.equals(Material.WALL_SIGN)) {
 | 
					 | 
				
			||||||
					if (SignsHandler.isSign(new LocationSerializable(event
 | 
					 | 
				
			||||||
							.getClickedBlock().getLocation()))) {
 | 
					 | 
				
			||||||
						Sign sign = (Sign) event.getClickedBlock().getState();
 | 
											Sign sign = (Sign) event.getClickedBlock().getState();
 | 
				
			||||||
						if (sign.getLine(1) != null) {
 | 
											if (sign.getLine(1) != null) {
 | 
				
			||||||
							if (sign.getLine(1)
 | 
												if (sign.getLine(1).equals(MessageM.replaceAll(W.config.getFile().getStringList(ConfigC.sign_LEAVE.location).get(1)))) {
 | 
				
			||||||
									.equals(MessageM
 | 
													if (PermissionsM.hasPerm(player, Permissions.joinsign, true)) {
 | 
				
			||||||
											.replaceAll(W.config
 | 
														ArenaHandler.playerLeaveArena(player, true, true);
 | 
				
			||||||
													.getFile()
 | 
					 | 
				
			||||||
													.getStringList(
 | 
					 | 
				
			||||||
															ConfigC.sign_LEAVE.location)
 | 
					 | 
				
			||||||
													.get(1)))) {
 | 
					 | 
				
			||||||
								if (PermissionsM.hasPerm(player,
 | 
					 | 
				
			||||||
										Permissions.joinsign, true)) {
 | 
					 | 
				
			||||||
									ArenaHandler.playerLeaveArena(player, true,
 | 
					 | 
				
			||||||
											true);
 | 
					 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
							} else if (sign.getLine(1).equals(
 | 
												} else if (sign.getLine(1).equals(MessageM.replaceAll(W.config.getFile().getStringList(ConfigC.sign_SHOP.location).get(1)))) {
 | 
				
			||||||
									MessageM.replaceAll(W.config
 | 
													if (PermissionsM.hasPerm(player, Permissions.shop, true)) {
 | 
				
			||||||
											.getFile()
 | 
					 | 
				
			||||||
											.getStringList(
 | 
					 | 
				
			||||||
													ConfigC.sign_SHOP.location)
 | 
					 | 
				
			||||||
											.get(1)))) {
 | 
					 | 
				
			||||||
								if (PermissionsM.hasPerm(player,
 | 
					 | 
				
			||||||
										Permissions.shop, true)) {
 | 
					 | 
				
			||||||
									InventoryHandler.openShop(player);
 | 
														InventoryHandler.openShop(player);
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
							} else {
 | 
												} else {
 | 
				
			||||||
								for (Arena arena : W.arenaList) {
 | 
													for (Arena arena : W.arenaList) {
 | 
				
			||||||
									if (sign.getLines()[1]
 | 
														if (sign.getLines()[1].contains(arena.arenaName)) {
 | 
				
			||||||
											.contains(arena.arenaName)) {
 | 
															if (PermissionsM.hasPerm(player, Permissions.joinsign, true)) {
 | 
				
			||||||
										if (PermissionsM.hasPerm(player,
 | 
																ArenaHandler.playerJoinArena(player, arena.arenaName);
 | 
				
			||||||
												Permissions.joinsign, true)) {
 | 
					 | 
				
			||||||
											ArenaHandler.playerJoinArena(
 | 
					 | 
				
			||||||
													player, arena.arenaName);
 | 
					 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
@@ -142,24 +96,12 @@ public class OnPlayerInteractEvent implements Listener {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (event.getAction() == Action.RIGHT_CLICK_BLOCK
 | 
							if (event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_BLOCK) {
 | 
				
			||||||
				|| event.getAction() == Action.LEFT_CLICK_BLOCK) {
 | 
					 | 
				
			||||||
			if (event.getClickedBlock().getType() != Material.AIR) {
 | 
								if (event.getClickedBlock().getType() != Material.AIR) {
 | 
				
			||||||
				if (event.getClickedBlock().getType()
 | 
									if (event.getClickedBlock().getType().equals(Material.ENCHANTMENT_TABLE) || event.getClickedBlock().getType().equals(Material.WORKBENCH)
 | 
				
			||||||
						.equals(Material.ENCHANTMENT_TABLE)
 | 
											|| event.getClickedBlock().getType().equals(Material.FURNACE) || event.getClickedBlock().getType().equals(Material.CHEST)
 | 
				
			||||||
						|| event.getClickedBlock().getType()
 | 
											|| event.getClickedBlock().getType().equals(Material.ANVIL) || event.getClickedBlock().getType().equals(Material.ENDER_CHEST)
 | 
				
			||||||
								.equals(Material.WORKBENCH)
 | 
											|| event.getClickedBlock().getType().equals(Material.JUKEBOX) || block.getFace(block).equals(Material.FIRE)) {
 | 
				
			||||||
						|| event.getClickedBlock().getType()
 | 
					 | 
				
			||||||
								.equals(Material.FURNACE)
 | 
					 | 
				
			||||||
						|| event.getClickedBlock().getType()
 | 
					 | 
				
			||||||
								.equals(Material.CHEST)
 | 
					 | 
				
			||||||
						|| event.getClickedBlock().getType()
 | 
					 | 
				
			||||||
								.equals(Material.ANVIL)
 | 
					 | 
				
			||||||
						|| event.getClickedBlock().getType()
 | 
					 | 
				
			||||||
								.equals(Material.ENDER_CHEST)
 | 
					 | 
				
			||||||
						|| event.getClickedBlock().getType()
 | 
					 | 
				
			||||||
								.equals(Material.JUKEBOX)
 | 
					 | 
				
			||||||
						|| block.getFace(block).equals(Material.FIRE)) {
 | 
					 | 
				
			||||||
					for (Arena arena : W.arenaList) {
 | 
										for (Arena arena : W.arenaList) {
 | 
				
			||||||
						if (arena.playersInArena.contains(player)) {
 | 
											if (arena.playersInArena.contains(player)) {
 | 
				
			||||||
							event.setCancelled(true);
 | 
												event.setCancelled(true);
 | 
				
			||||||
@@ -169,21 +111,16 @@ public class OnPlayerInteractEvent implements Listener {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (event.getAction() == Action.LEFT_CLICK_BLOCK
 | 
							if (event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_BLOCK) {
 | 
				
			||||||
				|| event.getAction() == Action.LEFT_CLICK_BLOCK) {
 | 
					 | 
				
			||||||
			for (Arena arena : W.arenaList) {
 | 
								for (Arena arena : W.arenaList) {
 | 
				
			||||||
				if (arena.seekers.contains(player)) {
 | 
									if (arena.seekers.contains(player)) {
 | 
				
			||||||
					for (Player pl : arena.playersInArena) {
 | 
										for (Player pl : arena.playersInArena) {
 | 
				
			||||||
						if (W.hiddenLoc.get(pl) != null) {
 | 
											if (W.hiddenLoc.get(pl) != null) {
 | 
				
			||||||
							Block pLoc = event.getClickedBlock();
 | 
												Block pLoc = event.getClickedBlock();
 | 
				
			||||||
							Block moveLocBlock = W.hiddenLoc.get(pl).getBlock();
 | 
												Block moveLocBlock = W.hiddenLoc.get(pl).getBlock();
 | 
				
			||||||
							if (moveLocBlock.getX() == pLoc.getX()
 | 
												if (moveLocBlock.getX() == pLoc.getX() && moveLocBlock.getY() == pLoc.getY() && moveLocBlock.getZ() == pLoc.getZ()) {
 | 
				
			||||||
									&& moveLocBlock.getY() == pLoc.getY()
 | 
													W.moveLoc.put(pl, new Location(pl.getWorld(), 0, 0, 0));
 | 
				
			||||||
									&& moveLocBlock.getZ() == pLoc.getZ()) {
 | 
													pl.getWorld().playSound(player.getLocation(), Sound.HURT_FLESH, 1, 1);
 | 
				
			||||||
								W.moveLoc.put(pl, new Location(pl.getWorld(),
 | 
					 | 
				
			||||||
										0, 0, 0));
 | 
					 | 
				
			||||||
								pl.getWorld().playSound(player.getLocation(),
 | 
					 | 
				
			||||||
										Sound.HURT_FLESH, 1, 1);
 | 
					 | 
				
			||||||
								SolidBlockHandler.makePlayerUnsolid(pl);
 | 
													SolidBlockHandler.makePlayerUnsolid(pl);
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
@@ -193,58 +130,32 @@ public class OnPlayerInteractEvent implements Listener {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (Arena arena : W.arenaList) {
 | 
							for (Arena arena : W.arenaList) {
 | 
				
			||||||
			if (arena.playersInArena.contains(player)
 | 
								if (arena.playersInArena.contains(player) && (arena.gameState.equals(ArenaState.WAITING) || arena.gameState.equals(ArenaState.STARTING))) {
 | 
				
			||||||
					&& (arena.gameState.equals(ArenaState.WAITING) || arena.gameState
 | 
					 | 
				
			||||||
							.equals(ArenaState.STARTING))) {
 | 
					 | 
				
			||||||
				event.setCancelled(true);
 | 
									event.setCancelled(true);
 | 
				
			||||||
				ItemStack item = player.getInventory().getItemInHand();
 | 
									ItemStack item = player.getInventory().getItemInHand();
 | 
				
			||||||
				if (item.getType() != Material.AIR) {
 | 
									if (item.getType() != Material.AIR) {
 | 
				
			||||||
					if (item.getItemMeta().getDisplayName() != null) {
 | 
										if (item.getItemMeta().getDisplayName() != null) {
 | 
				
			||||||
						if (item.getItemMeta()
 | 
											if (item.getItemMeta().getDisplayName().equals(MessageM.replaceAll((String) W.config.get(ConfigC.shop_blockChooserv1Name)))) {
 | 
				
			||||||
								.getDisplayName()
 | 
												Inventory blockChooser = Bukkit.createInventory(null, 36, MessageM.replaceAll("\u00A7r" + W.config.get(ConfigC.shop_blockChooserv1Name)));
 | 
				
			||||||
								.equals(MessageM.replaceAll((String) W.config
 | 
					 | 
				
			||||||
										.get(ConfigC.shop_blockChooserv1Name)))) {
 | 
					 | 
				
			||||||
							Inventory blockChooser = Bukkit
 | 
					 | 
				
			||||||
									.createInventory(
 | 
					 | 
				
			||||||
											null,
 | 
					 | 
				
			||||||
											36,
 | 
					 | 
				
			||||||
											MessageM.replaceAll("\u00A7r"
 | 
					 | 
				
			||||||
													+ W.config
 | 
					 | 
				
			||||||
															.get(ConfigC.shop_blockChooserv1Name)));
 | 
					 | 
				
			||||||
							if (arena.disguiseBlocks != null) {
 | 
												if (arena.disguiseBlocks != null) {
 | 
				
			||||||
								for (int i = arena.disguiseBlocks.size(); i > 0; i = i - 1) {
 | 
													for (int i = arena.disguiseBlocks.size(); i > 0; i = i - 1) {
 | 
				
			||||||
									blockChooser.setItem(i - 1,
 | 
														blockChooser.setItem(i - 1, arena.disguiseBlocks.get(i - 1));
 | 
				
			||||||
											arena.disguiseBlocks.get(i - 1));
 | 
					 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							player.openInventory(blockChooser);
 | 
												player.openInventory(blockChooser);
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						if (item.getItemMeta()
 | 
											if (item.getItemMeta().getDisplayName().equals(MessageM.replaceAll((String) W.config.get(ConfigC.shop_BlockHuntPassv2Name)))) {
 | 
				
			||||||
								.getDisplayName()
 | 
												Inventory BlockHuntPass = Bukkit.createInventory(null, 9, MessageM.replaceAll("\u00A7r" + W.config.get(ConfigC.shop_BlockHuntPassv2Name)));
 | 
				
			||||||
								.equals(MessageM.replaceAll((String) W.config
 | 
												ItemStack BlockHuntPassSEEKER = new ItemStack(Material.WOOL, 1, (short) 11);
 | 
				
			||||||
										.get(ConfigC.shop_BlockHuntPassv2Name)))) {
 | 
												ItemMeta BlockHuntPassIM = BlockHuntPassSEEKER.getItemMeta();
 | 
				
			||||||
							Inventory BlockHuntPass = Bukkit
 | 
												BlockHuntPassIM.setDisplayName(MessageM.replaceAll("&eSEEKER"));
 | 
				
			||||||
									.createInventory(
 | 
					 | 
				
			||||||
											null,
 | 
					 | 
				
			||||||
											9,
 | 
					 | 
				
			||||||
											MessageM.replaceAll("\u00A7r"
 | 
					 | 
				
			||||||
													+ W.config
 | 
					 | 
				
			||||||
															.get(ConfigC.shop_BlockHuntPassv2Name)));
 | 
					 | 
				
			||||||
							ItemStack BlockHuntPassSEEKER = new ItemStack(
 | 
					 | 
				
			||||||
									Material.WOOL, 1, (short) 11);
 | 
					 | 
				
			||||||
							ItemMeta BlockHuntPassIM = BlockHuntPassSEEKER
 | 
					 | 
				
			||||||
									.getItemMeta();
 | 
					 | 
				
			||||||
							BlockHuntPassIM.setDisplayName(MessageM
 | 
					 | 
				
			||||||
									.replaceAll("&eSEEKER"));
 | 
					 | 
				
			||||||
							BlockHuntPassSEEKER.setItemMeta(BlockHuntPassIM);
 | 
												BlockHuntPassSEEKER.setItemMeta(BlockHuntPassIM);
 | 
				
			||||||
							BlockHuntPass.setItem(1, BlockHuntPassSEEKER);
 | 
												BlockHuntPass.setItem(1, BlockHuntPassSEEKER);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							ItemStack BlockHuntPassHIDER = new ItemStack(
 | 
												ItemStack BlockHuntPassHIDER = new ItemStack(Material.WOOL, 1, (short) 14);
 | 
				
			||||||
									Material.WOOL, 1, (short) 14);
 | 
												BlockHuntPassIM.setDisplayName(MessageM.replaceAll("&eHIDER"));
 | 
				
			||||||
							BlockHuntPassIM.setDisplayName(MessageM
 | 
					 | 
				
			||||||
									.replaceAll("&eHIDER"));
 | 
					 | 
				
			||||||
							BlockHuntPassHIDER.setItemMeta(BlockHuntPassIM);
 | 
												BlockHuntPassHIDER.setItemMeta(BlockHuntPassIM);
 | 
				
			||||||
							BlockHuntPass.setItem(7, BlockHuntPassHIDER);
 | 
												BlockHuntPass.setItem(7, BlockHuntPassHIDER);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,7 +15,7 @@ import org.bukkit.event.player.PlayerMoveEvent;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class OnPlayerMoveEvent implements Listener {
 | 
					public class OnPlayerMoveEvent implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
 | 
						@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
 | 
				
			||||||
	public void onPlayerMoveEvent(PlayerMoveEvent event) {
 | 
						public void onPlayerMoveEvent(PlayerMoveEvent event) {
 | 
				
			||||||
		Player player = event.getPlayer();
 | 
							Player player = event.getPlayer();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -23,18 +23,12 @@ public class OnPlayerMoveEvent implements Listener {
 | 
				
			|||||||
			if (arena.playersInArena.contains(player)) {
 | 
								if (arena.playersInArena.contains(player)) {
 | 
				
			||||||
				if (arena.gameState == ArenaState.INGAME) {
 | 
									if (arena.gameState == ArenaState.INGAME) {
 | 
				
			||||||
					W.moveLoc.put(player, player.getLocation());
 | 
										W.moveLoc.put(player, player.getLocation());
 | 
				
			||||||
					double maxX = Math
 | 
										double maxX = Math.max(arena.pos1.getX(), arena.pos2.getX());
 | 
				
			||||||
							.max(arena.pos1.getX(), arena.pos2.getX());
 | 
										double minX = Math.min(arena.pos1.getX(), arena.pos2.getX());
 | 
				
			||||||
					double minX = Math
 | 
										double maxY = Math.max(arena.pos1.getY(), arena.pos2.getY());
 | 
				
			||||||
							.min(arena.pos1.getX(), arena.pos2.getX());
 | 
										double minY = Math.min(arena.pos1.getY(), arena.pos2.getY());
 | 
				
			||||||
					double maxY = Math
 | 
										double maxZ = Math.max(arena.pos1.getZ(), arena.pos2.getZ());
 | 
				
			||||||
							.max(arena.pos1.getY(), arena.pos2.getY());
 | 
										double minZ = Math.min(arena.pos1.getZ(), arena.pos2.getZ());
 | 
				
			||||||
					double minY = Math
 | 
					 | 
				
			||||||
							.min(arena.pos1.getY(), arena.pos2.getY());
 | 
					 | 
				
			||||||
					double maxZ = Math
 | 
					 | 
				
			||||||
							.max(arena.pos1.getZ(), arena.pos2.getZ());
 | 
					 | 
				
			||||||
					double minZ = Math
 | 
					 | 
				
			||||||
							.min(arena.pos1.getZ(), arena.pos2.getZ());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
					Location loc = player.getLocation();
 | 
										Location loc = player.getLocation();
 | 
				
			||||||
					if (loc.getBlockX() > maxX) {
 | 
										if (loc.getBlockX() > maxX) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,17 +14,14 @@ import org.bukkit.event.block.SignChangeEvent;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class OnSignChangeEvent implements Listener {
 | 
					public class OnSignChangeEvent implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
 | 
						@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
 | 
				
			||||||
	public void onSignChangeEvent(SignChangeEvent event) {
 | 
						public void onSignChangeEvent(SignChangeEvent event) {
 | 
				
			||||||
		Player player = event.getPlayer();
 | 
							Player player = event.getPlayer();
 | 
				
			||||||
		String[] lines = event.getLines();
 | 
							String[] lines = event.getLines();
 | 
				
			||||||
		if (lines[0] != null) {
 | 
							if (lines[0] != null) {
 | 
				
			||||||
			if (lines[0].equalsIgnoreCase("[" + BlockHunt.pdfFile.getName()
 | 
								if (lines[0].equalsIgnoreCase("[" + BlockHunt.pdfFile.getName() + "]")) {
 | 
				
			||||||
					+ "]")) {
 | 
					 | 
				
			||||||
				if (PermissionsM.hasPerm(player, Permissions.signcreate, true)) {
 | 
									if (PermissionsM.hasPerm(player, Permissions.signcreate, true)) {
 | 
				
			||||||
					SignsHandler.createSign(event, lines,
 | 
										SignsHandler.createSign(event, lines, new LocationSerializable(event.getBlock().getLocation()));
 | 
				
			||||||
							new LocationSerializable(event.getBlock()
 | 
					 | 
				
			||||||
									.getLocation()));
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,9 +31,8 @@ public class CommandM {
 | 
				
			|||||||
	public DefaultCMD CMD;
 | 
						public DefaultCMD CMD;
 | 
				
			||||||
	public String usage;
 | 
						public String usage;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public CommandM (String name, String label, String args, String argsalias,
 | 
						public CommandM(String name, String label, String args, String argsalias, Permissions permission, ConfigC help, Boolean enabled, List<String> mainTABlist,
 | 
				
			||||||
			Permissions permission, ConfigC help, Boolean enabled,
 | 
								DefaultCMD CMD, String usage) {
 | 
				
			||||||
			List<String> mainTABlist, DefaultCMD CMD, String usage) {
 | 
					 | 
				
			||||||
		this.name = name;
 | 
							this.name = name;
 | 
				
			||||||
		this.label = label;
 | 
							this.label = label;
 | 
				
			||||||
		this.args = args;
 | 
							this.args = args;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,10 +35,9 @@ public class ConfigM {
 | 
				
			|||||||
	 * @param fileName
 | 
						 * @param fileName
 | 
				
			||||||
	 *            Name of the file.
 | 
						 *            Name of the file.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public ConfigM (String fileName) {
 | 
						public ConfigM(String fileName) {
 | 
				
			||||||
		this.fileName = fileName;
 | 
							this.fileName = fileName;
 | 
				
			||||||
		this.file = new File("plugins/" + BlockHunt.pdfFile.getName(),
 | 
							this.file = new File("plugins/" + BlockHunt.pdfFile.getName(), fileName + ".yml");
 | 
				
			||||||
				fileName + ".yml");
 | 
					 | 
				
			||||||
		this.fileLocation = BlockHunt.pdfFile.getName();
 | 
							this.fileLocation = BlockHunt.pdfFile.getName();
 | 
				
			||||||
		this.fileC = new YamlConfiguration();
 | 
							this.fileC = new YamlConfiguration();
 | 
				
			||||||
		this.checkFile();
 | 
							this.checkFile();
 | 
				
			||||||
@@ -54,12 +53,10 @@ public class ConfigM {
 | 
				
			|||||||
	 * @param fileLocation
 | 
						 * @param fileLocation
 | 
				
			||||||
	 *            Sub-Location of the file.
 | 
						 *            Sub-Location of the file.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public ConfigM (String fileName, String fileLocation) {
 | 
						public ConfigM(String fileName, String fileLocation) {
 | 
				
			||||||
		this.fileName = fileName;
 | 
							this.fileName = fileName;
 | 
				
			||||||
		this.file = new File("plugins/" + BlockHunt.pdfFile.getName()
 | 
							this.file = new File("plugins/" + BlockHunt.pdfFile.getName() + "/" + fileLocation, fileName + ".yml");
 | 
				
			||||||
				+ "/" + fileLocation, fileName + ".yml");
 | 
							this.fileLocation = BlockHunt.pdfFile.getName() + "/" + fileLocation;
 | 
				
			||||||
		this.fileLocation = BlockHunt.pdfFile.getName() + "/"
 | 
					 | 
				
			||||||
				+ fileLocation;
 | 
					 | 
				
			||||||
		this.fileC = new YamlConfiguration();
 | 
							this.fileC = new YamlConfiguration();
 | 
				
			||||||
		this.checkFile();
 | 
							this.checkFile();
 | 
				
			||||||
		this.fileCS = fileC.getConfigurationSection("");
 | 
							this.fileCS = fileC.getConfigurationSection("");
 | 
				
			||||||
@@ -73,10 +70,7 @@ public class ConfigM {
 | 
				
			|||||||
	public static void newFiles() {
 | 
						public static void newFiles() {
 | 
				
			||||||
		ConfigM.setDefaults();
 | 
							ConfigM.setDefaults();
 | 
				
			||||||
		for (String fileName : W.newFiles) {
 | 
							for (String fileName : W.newFiles) {
 | 
				
			||||||
			MessageM.sendMessage(
 | 
								MessageM.sendMessage(null, "%TAG%WCouldn't find '%A%fileName%.yml%W' creating new one.", "fileName-" + fileName);
 | 
				
			||||||
					null,
 | 
					 | 
				
			||||||
					"%TAG%WCouldn't find '%A%fileName%.yml%W' creating new one.",
 | 
					 | 
				
			||||||
					"fileName-" + fileName);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		W.newFiles.clear();
 | 
							W.newFiles.clear();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,15 +31,11 @@ public class MessageM {
 | 
				
			|||||||
	 *            Variables. Seperated with a - . Ex: "playerName-" +
 | 
						 *            Variables. Seperated with a - . Ex: "playerName-" +
 | 
				
			||||||
	 *            player.getName();
 | 
						 *            player.getName();
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public static void sendMessage(Player player, String message,
 | 
						public static void sendMessage(Player player, String message, String... vars) {
 | 
				
			||||||
			String... vars) {
 | 
					 | 
				
			||||||
		if (player == null) {
 | 
							if (player == null) {
 | 
				
			||||||
			Bukkit.getConsoleSender().sendMessage(
 | 
								Bukkit.getConsoleSender().sendMessage(MessageM.replaceAll(message.replaceAll("%player%", "Console"), vars));
 | 
				
			||||||
					MessageM.replaceAll(
 | 
					 | 
				
			||||||
							message.replaceAll("%player%", "Console"), vars));
 | 
					 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			player.sendMessage(MessageM.replaceAll(
 | 
								player.sendMessage(MessageM.replaceAll(message.replaceAll("%player%", player.getName()), vars));
 | 
				
			||||||
					message.replaceAll("%player%", player.getName()), vars));
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -55,18 +51,12 @@ public class MessageM {
 | 
				
			|||||||
	 *            Variables. Seperated with a - . Ex: "playerName-" +
 | 
						 *            Variables. Seperated with a - . Ex: "playerName-" +
 | 
				
			||||||
	 *            player.getName();
 | 
						 *            player.getName();
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public static void sendFMessage(Player player, ConfigC location,
 | 
						public static void sendFMessage(Player player, ConfigC location, String... vars) {
 | 
				
			||||||
			String... vars) {
 | 
					 | 
				
			||||||
		if (player == null) {
 | 
							if (player == null) {
 | 
				
			||||||
			Bukkit.getConsoleSender().sendMessage(
 | 
								Bukkit.getConsoleSender().sendMessage(
 | 
				
			||||||
					MessageM.replaceAll(
 | 
										MessageM.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", "Console"), vars));
 | 
				
			||||||
							location.config.getFile().get(location.location)
 | 
					 | 
				
			||||||
									.toString()
 | 
					 | 
				
			||||||
									.replaceAll("%player%", "Console"), vars));
 | 
					 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			player.sendMessage(MessageM.replaceAll(
 | 
								player.sendMessage(MessageM.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", player.getName()), vars));
 | 
				
			||||||
					location.config.getFile().get(location.location).toString()
 | 
					 | 
				
			||||||
							.replaceAll("%player%", player.getName()), vars));
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -84,13 +74,10 @@ public class MessageM {
 | 
				
			|||||||
		for (Player player : Bukkit.getOnlinePlayers()) {
 | 
							for (Player player : Bukkit.getOnlinePlayers()) {
 | 
				
			||||||
			// String pMessage = message.replaceAll("%player%",
 | 
								// String pMessage = message.replaceAll("%player%",
 | 
				
			||||||
			// player.getName());
 | 
								// player.getName());
 | 
				
			||||||
			player.sendMessage(MessageM.replaceAll(
 | 
								player.sendMessage(MessageM.replaceAll(message.replaceAll("%player%", player.getName()), vars));
 | 
				
			||||||
					message.replaceAll("%player%", player.getName()), vars));
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		// message = message.replaceAll("%player%", "Console");
 | 
							// message = message.replaceAll("%player%", "Console");
 | 
				
			||||||
		Bukkit.getConsoleSender().sendMessage(
 | 
							Bukkit.getConsoleSender().sendMessage(MessageM.replaceAll(message.replaceAll("%player%", "Console"), vars));
 | 
				
			||||||
				MessageM.replaceAll(message.replaceAll("%player%", "Console"),
 | 
					 | 
				
			||||||
						vars));
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
@@ -108,17 +95,11 @@ public class MessageM {
 | 
				
			|||||||
			// String pMessage =
 | 
								// String pMessage =
 | 
				
			||||||
			// location.config.getFile().get(location.location)
 | 
								// location.config.getFile().get(location.location)
 | 
				
			||||||
			// .toString().replaceAll("%player%", player.getName());
 | 
								// .toString().replaceAll("%player%", player.getName());
 | 
				
			||||||
			player.sendMessage(MessageM.replaceAll(
 | 
								player.sendMessage(MessageM.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", player.getName()), vars));
 | 
				
			||||||
					location.config.getFile().get(location.location).toString()
 | 
					 | 
				
			||||||
							.replaceAll("%player%", player.getName()), vars));
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		// String message = location.config.getFile().get(location.location)
 | 
							// String message = location.config.getFile().get(location.location)
 | 
				
			||||||
		// .toString().replaceAll("%player%", "Console");
 | 
							// .toString().replaceAll("%player%", "Console");
 | 
				
			||||||
		Bukkit.getConsoleSender().sendMessage(
 | 
							Bukkit.getConsoleSender().sendMessage(MessageM.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", "Console"), vars));
 | 
				
			||||||
				MessageM.replaceAll(
 | 
					 | 
				
			||||||
						location.config.getFile().get(location.location)
 | 
					 | 
				
			||||||
								.toString().replaceAll("%player%", "Console"),
 | 
					 | 
				
			||||||
						vars));
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
@@ -132,8 +113,7 @@ public class MessageM {
 | 
				
			|||||||
	 * @return
 | 
						 * @return
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public static String replaceAll(String message, String... vars) {
 | 
						public static String replaceAll(String message, String... vars) {
 | 
				
			||||||
		return MessageM.replaceColours(MessageM.replaceColourVars(MessageM
 | 
							return MessageM.replaceColours(MessageM.replaceColourVars(MessageM.replaceVars(message, vars)));
 | 
				
			||||||
				.replaceVars(message, vars)));
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
@@ -205,9 +185,7 @@ public class MessageM {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		public static String TAG() {
 | 
							public static String TAG() {
 | 
				
			||||||
			return (String) W.config.get(ConfigC.chat_header)
 | 
								return (String) W.config.get(ConfigC.chat_header) + (String) W.config.get(ConfigC.chat_tag) + (String) W.config.get(ConfigC.chat_normal);
 | 
				
			||||||
					+ (String) W.config.get(ConfigC.chat_tag)
 | 
					 | 
				
			||||||
					+ (String) W.config.get(ConfigC.chat_normal);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,8 +33,7 @@ public class PermissionsM {
 | 
				
			|||||||
	 *            permission.
 | 
						 *            permission.
 | 
				
			||||||
	 * @return True/False when either the player has the permission.
 | 
						 * @return True/False when either the player has the permission.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public static boolean hasPerm(Player player, Permissions perm,
 | 
						public static boolean hasPerm(Player player, Permissions perm, Boolean message) {
 | 
				
			||||||
			Boolean message) {
 | 
					 | 
				
			||||||
		PType type = perm.type;
 | 
							PType type = perm.type;
 | 
				
			||||||
		if (player == null) {
 | 
							if (player == null) {
 | 
				
			||||||
			return true;
 | 
								return true;
 | 
				
			||||||
@@ -91,8 +90,7 @@ public class PermissionsM {
 | 
				
			|||||||
	 *            permission.
 | 
						 *            permission.
 | 
				
			||||||
	 * @return True/False when either the player has the permission.
 | 
						 * @return True/False when either the player has the permission.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public static boolean hasRawPerm(Player player, PType type, String perm,
 | 
						public static boolean hasRawPerm(Player player, PType type, String perm, Boolean message) {
 | 
				
			||||||
			Boolean message) {
 | 
					 | 
				
			||||||
		if (player == null) {
 | 
							if (player == null) {
 | 
				
			||||||
			return true;
 | 
								return true;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,29 +20,15 @@ public class PermissionsC {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public enum Permissions {
 | 
						public enum Permissions {
 | 
				
			||||||
		info ("info", PType.ALL),
 | 
							info("info", PType.ALL), help("help", PType.ALL), reload("reload", PType.ADMIN), join("join", PType.PLAYER), joinfull("joinfull", PType.MODERATOR), joinsign(
 | 
				
			||||||
		help ("help", PType.ALL),
 | 
									"joinsign", PType.PLAYER), leave("leave", PType.PLAYER), list("list", PType.PLAYER), shop("shop", PType.PLAYER), shopblockchooser("shop.blockchooser",
 | 
				
			||||||
		reload ("reload", PType.ADMIN),
 | 
									PType.ADMIN), start("start", PType.MODERATOR), create("create", PType.ADMIN), set("set", PType.MODERATOR), setwarp("setwarp", PType.MODERATOR), signcreate(
 | 
				
			||||||
		join ("join", PType.PLAYER),
 | 
									"signcreate", PType.MODERATOR), remove("remove", PType.ADMIN), tokens("tokens", PType.ADMIN), allcommands("allcommands", PType.OP);
 | 
				
			||||||
		joinfull ("joinfull", PType.MODERATOR),
 | 
					 | 
				
			||||||
		joinsign ("joinsign", PType.PLAYER),
 | 
					 | 
				
			||||||
		leave ("leave", PType.PLAYER),
 | 
					 | 
				
			||||||
		list ("list", PType.PLAYER),
 | 
					 | 
				
			||||||
		shop ("shop", PType.PLAYER),
 | 
					 | 
				
			||||||
		shopblockchooser ("shop.blockchooser", PType.ADMIN),
 | 
					 | 
				
			||||||
		start ("start", PType.MODERATOR),
 | 
					 | 
				
			||||||
		create ("create", PType.ADMIN),
 | 
					 | 
				
			||||||
		set ("set", PType.MODERATOR),
 | 
					 | 
				
			||||||
		setwarp ("setwarp", PType.MODERATOR),
 | 
					 | 
				
			||||||
		signcreate ("signcreate", PType.MODERATOR),
 | 
					 | 
				
			||||||
		remove ("remove", PType.ADMIN),
 | 
					 | 
				
			||||||
		tokens ("tokens", PType.ADMIN),
 | 
					 | 
				
			||||||
		allcommands ("allcommands", PType.OP);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		public String perm;
 | 
							public String perm;
 | 
				
			||||||
		public PType type;
 | 
							public PType type;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		private Permissions (String perm, PType type) {
 | 
							private Permissions(String perm, PType type) {
 | 
				
			||||||
			this.perm = perm;
 | 
								this.perm = perm;
 | 
				
			||||||
			this.type = type;
 | 
								this.type = type;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,9 +18,7 @@ public class PlayerArenaData {
 | 
				
			|||||||
	public Collection<PotionEffect> pPotionEffects;
 | 
						public Collection<PotionEffect> pPotionEffects;
 | 
				
			||||||
	public boolean pFlying;
 | 
						public boolean pFlying;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public PlayerArenaData (Location pLocation, GameMode pGameMode,
 | 
						public PlayerArenaData(Location pLocation, GameMode pGameMode, ItemStack[] pInventory, ItemStack[] pArmor, Float pEXP, Integer pEXPL, Double pHealth, Integer pFood,
 | 
				
			||||||
			ItemStack[] pInventory, ItemStack[] pArmor, Float pEXP,
 | 
					 | 
				
			||||||
			Integer pEXPL, Double pHealth, Integer pFood,
 | 
					 | 
				
			||||||
			Collection<PotionEffect> pPotionEffects, boolean pFlying) {
 | 
								Collection<PotionEffect> pPotionEffects, boolean pFlying) {
 | 
				
			||||||
		this.pGameMode = pGameMode;
 | 
							this.pGameMode = pGameMode;
 | 
				
			||||||
		this.pInventory = pInventory;
 | 
							this.pInventory = pInventory;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ import nl.Steffion.BlockHunt.Arena.ArenaState;
 | 
				
			|||||||
import nl.Steffion.BlockHunt.Managers.MessageM;
 | 
					import nl.Steffion.BlockHunt.Managers.MessageM;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.bukkit.Bukkit;
 | 
					import org.bukkit.Bukkit;
 | 
				
			||||||
 | 
					import org.bukkit.ChatColor;
 | 
				
			||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
import org.bukkit.scoreboard.DisplaySlot;
 | 
					import org.bukkit.scoreboard.DisplaySlot;
 | 
				
			||||||
import org.bukkit.scoreboard.Objective;
 | 
					import org.bukkit.scoreboard.Objective;
 | 
				
			||||||
@@ -19,32 +20,30 @@ public class ScoreboardHandler {
 | 
				
			|||||||
				return;
 | 
									return;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			Objective object = board.registerNewObjective(
 | 
								Objective object = board.registerNewObjective(BlockHunt.cutString(arena.arenaName, 32), "dummy");
 | 
				
			||||||
					BlockHunt.cutString(arena.arenaName, 32), "dummy");
 | 
					
 | 
				
			||||||
			object.setDisplaySlot(DisplaySlot.SIDEBAR);
 | 
								object.setDisplaySlot(DisplaySlot.SIDEBAR);
 | 
				
			||||||
			object.setDisplayName(BlockHunt.cutString(
 | 
								object.setDisplayName(BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_title)), 32));
 | 
				
			||||||
					MessageM.replaceAll((String) W.config
 | 
								
 | 
				
			||||||
							.get(ConfigC.scoreboard_title)), 32));
 | 
								String temp = BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_timeleft)), 32);
 | 
				
			||||||
			Score timeleft = object.getScore(Bukkit.getOfflinePlayer(BlockHunt
 | 
								Score timeleft = object.getScore(Bukkit.getOfflinePlayer(ChatColor.RESET + temp));
 | 
				
			||||||
					.cutString(MessageM.replaceAll((String) W.config
 | 
					 | 
				
			||||||
							.get(ConfigC.scoreboard_timeleft)), 32)));
 | 
					 | 
				
			||||||
			timeleft.setScore(arena.timer);
 | 
								timeleft.setScore(arena.timer);
 | 
				
			||||||
			Score seekers = object.getScore(Bukkit.getOfflinePlayer(BlockHunt
 | 
								
 | 
				
			||||||
					.cutString(MessageM.replaceAll((String) W.config
 | 
								temp = BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_seekers)), 32);
 | 
				
			||||||
							.get(ConfigC.scoreboard_seekers)), 32)));
 | 
								Score seekers = object.getScore(Bukkit.getOfflinePlayer(ChatColor.RESET + temp));
 | 
				
			||||||
			seekers.setScore(arena.seekers.size());
 | 
								seekers.setScore(arena.seekers.size());
 | 
				
			||||||
			Score hiders = object.getScore(Bukkit.getOfflinePlayer(BlockHunt
 | 
								
 | 
				
			||||||
					.cutString(MessageM.replaceAll((String) W.config
 | 
								temp = BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_hiders)), 32);
 | 
				
			||||||
							.get(ConfigC.scoreboard_hiders)), 32)));
 | 
								Score hiders = object.getScore(Bukkit.getOfflinePlayer(ChatColor.RESET + temp));
 | 
				
			||||||
			hiders.setScore(arena.playersInArena.size() - arena.seekers.size());
 | 
								hiders.setScore(arena.playersInArena.size() - arena.seekers.size());
 | 
				
			||||||
 | 
								
 | 
				
			||||||
			if (arena.gameState == ArenaState.INGAME) {
 | 
								if (arena.gameState == ArenaState.INGAME) {
 | 
				
			||||||
				for (Player pl : arena.playersInArena) {
 | 
									for (Player pl : arena.playersInArena) {
 | 
				
			||||||
					pl.setScoreboard(board);
 | 
										pl.setScoreboard(board);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				for (Player pl : arena.playersInArena) {
 | 
									for (Player pl : arena.playersInArena) {
 | 
				
			||||||
					pl.setScoreboard(Bukkit.getScoreboardManager()
 | 
										pl.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());
 | 
				
			||||||
							.getNewScoreboard());
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -54,29 +53,27 @@ public class ScoreboardHandler {
 | 
				
			|||||||
		if ((Boolean) W.config.get(ConfigC.scoreboard_enabled) == true) {
 | 
							if ((Boolean) W.config.get(ConfigC.scoreboard_enabled) == true) {
 | 
				
			||||||
			Scoreboard board = arena.scoreboard;
 | 
								Scoreboard board = arena.scoreboard;
 | 
				
			||||||
			Objective object = board.getObjective(DisplaySlot.SIDEBAR);
 | 
								Objective object = board.getObjective(DisplaySlot.SIDEBAR);
 | 
				
			||||||
			object.setDisplayName(BlockHunt.cutString(
 | 
								object.setDisplayName(BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_title)), 32));
 | 
				
			||||||
					MessageM.replaceAll((String) W.config
 | 
								
 | 
				
			||||||
							.get(ConfigC.scoreboard_title)), 32));
 | 
								String temp = BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_timeleft)), 32);
 | 
				
			||||||
			Score timeleft = object.getScore(Bukkit.getOfflinePlayer(BlockHunt
 | 
								Score timeleft = object.getScore(Bukkit.getOfflinePlayer(ChatColor.RESET + temp));
 | 
				
			||||||
					.cutString(MessageM.replaceAll((String) W.config
 | 
					 | 
				
			||||||
							.get(ConfigC.scoreboard_timeleft)), 32)));
 | 
					 | 
				
			||||||
			timeleft.setScore(arena.timer);
 | 
								timeleft.setScore(arena.timer);
 | 
				
			||||||
			Score seekers = object.getScore(Bukkit.getOfflinePlayer(BlockHunt
 | 
								
 | 
				
			||||||
					.cutString(MessageM.replaceAll((String) W.config
 | 
								temp = BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_seekers)), 32);
 | 
				
			||||||
							.get(ConfigC.scoreboard_seekers)), 32)));
 | 
								Score seekers = object.getScore(Bukkit.getOfflinePlayer(ChatColor.RESET + temp));
 | 
				
			||||||
			seekers.setScore(arena.seekers.size());
 | 
								seekers.setScore(arena.seekers.size());
 | 
				
			||||||
			Score hiders = object.getScore(Bukkit.getOfflinePlayer(BlockHunt
 | 
								
 | 
				
			||||||
					.cutString(MessageM.replaceAll((String) W.config
 | 
								temp = BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_hiders)), 32);
 | 
				
			||||||
							.get(ConfigC.scoreboard_hiders)), 32)));
 | 
								Score hiders = object.getScore(Bukkit.getOfflinePlayer(ChatColor.RESET + temp));
 | 
				
			||||||
			hiders.setScore(arena.playersInArena.size() - arena.seekers.size());
 | 
								hiders.setScore(arena.playersInArena.size() - arena.seekers.size());
 | 
				
			||||||
 | 
								
 | 
				
			||||||
			if (arena.gameState == ArenaState.INGAME) {
 | 
								if (arena.gameState == ArenaState.INGAME) {
 | 
				
			||||||
				for (Player pl : arena.playersInArena) {
 | 
									for (Player pl : arena.playersInArena) {
 | 
				
			||||||
					pl.setScoreboard(board);
 | 
										pl.setScoreboard(board);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				for (Player pl : arena.playersInArena) {
 | 
									for (Player pl : arena.playersInArena) {
 | 
				
			||||||
					pl.setScoreboard(Bukkit.getScoreboardManager()
 | 
										pl.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());
 | 
				
			||||||
							.getNewScoreboard());
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,26 +12,21 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable;
 | 
				
			|||||||
import org.bukkit.configuration.serialization.SerializableAs;
 | 
					import org.bukkit.configuration.serialization.SerializableAs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@SerializableAs("BlockHuntLocation")
 | 
					@SerializableAs("BlockHuntLocation")
 | 
				
			||||||
public class LocationSerializable extends Location implements
 | 
					public class LocationSerializable extends Location implements ConfigurationSerializable {
 | 
				
			||||||
		ConfigurationSerializable {
 | 
						public LocationSerializable(World world, double x, double y, double z, float yaw, float pitch) {
 | 
				
			||||||
	public LocationSerializable (World world, double x, double y, double z,
 | 
					 | 
				
			||||||
			float yaw, float pitch) {
 | 
					 | 
				
			||||||
		super(world, x, y, z, yaw, pitch);
 | 
							super(world, x, y, z, yaw, pitch);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public LocationSerializable (Location loc) {
 | 
						public LocationSerializable(Location loc) {
 | 
				
			||||||
		super(loc.getWorld(), loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(),
 | 
							super(loc.getWorld(), loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
 | 
				
			||||||
				loc.getPitch());
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public boolean equals(Object o) {
 | 
						public boolean equals(Object o) {
 | 
				
			||||||
		if (o instanceof LocationSerializable || o instanceof Location) {
 | 
							if (o instanceof LocationSerializable || o instanceof Location) {
 | 
				
			||||||
			Location loc = (Location) o;
 | 
								Location loc = (Location) o;
 | 
				
			||||||
			return loc.getWorld().getName().equals(getWorld().getName())
 | 
								return loc.getWorld().getName().equals(getWorld().getName()) && loc.getX() == getX() && loc.getY() == getY() && loc.getZ() == getZ()
 | 
				
			||||||
					&& loc.getX() == getX() && loc.getY() == getY()
 | 
										&& loc.getYaw() == getYaw() && loc.getPitch() == getPitch();
 | 
				
			||||||
					&& loc.getZ() == getZ() && loc.getYaw() == getYaw()
 | 
					 | 
				
			||||||
					&& loc.getPitch() == getPitch();
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -53,15 +48,10 @@ public class LocationSerializable extends Location implements
 | 
				
			|||||||
	public static LocationSerializable deserialize(Map<String, Object> map) {
 | 
						public static LocationSerializable deserialize(Map<String, Object> map) {
 | 
				
			||||||
		World w = Bukkit.getWorld((String) M.g(map, "w", ""));
 | 
							World w = Bukkit.getWorld((String) M.g(map, "w", ""));
 | 
				
			||||||
		if (w == null) {
 | 
							if (w == null) {
 | 
				
			||||||
			MessageM.sendMessage(
 | 
								MessageM.sendMessage(null, "%EError deserializing LocationSerializable - world not found! (%A%w%%E)", "w-" + w);
 | 
				
			||||||
					null,
 | 
					 | 
				
			||||||
					"%EError deserializing LocationSerializable - world not found! (%A%w%%E)",
 | 
					 | 
				
			||||||
					"w-" + w);
 | 
					 | 
				
			||||||
			return null;
 | 
								return null;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return new LocationSerializable(w, (Double) M.g(map, "x", 0D),
 | 
							return new LocationSerializable(w, (Double) M.g(map, "x", 0D), (Double) M.g(map, "y", 0D), (Double) M.g(map, "z", 0D), ((Double) M.g(map, "a", 0D)).floatValue(),
 | 
				
			||||||
				(Double) M.g(map, "y", 0D), (Double) M.g(map, "z", 0D),
 | 
									((Double) M.g(map, "p", 0D)).floatValue());
 | 
				
			||||||
				((Double) M.g(map, "a", 0D)).floatValue(), ((Double) M.g(map,
 | 
					 | 
				
			||||||
						"p", 0D)).floatValue());
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,18 +11,15 @@ import org.bukkit.event.block.SignChangeEvent;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class SignsHandler {
 | 
					public class SignsHandler {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public static void createSign(SignChangeEvent event, String[] lines,
 | 
						public static void createSign(SignChangeEvent event, String[] lines, LocationSerializable location) {
 | 
				
			||||||
			LocationSerializable location) {
 | 
					 | 
				
			||||||
		if (lines[1] != null) {
 | 
							if (lines[1] != null) {
 | 
				
			||||||
			if (lines[1].equalsIgnoreCase("leave")) {
 | 
								if (lines[1].equalsIgnoreCase("leave")) {
 | 
				
			||||||
				boolean saved = false;
 | 
									boolean saved = false;
 | 
				
			||||||
				int number = 1;
 | 
									int number = 1;
 | 
				
			||||||
				while (!saved) {
 | 
									while (!saved) {
 | 
				
			||||||
					if (W.signs.getFile().get("leave_" + number) == null) {
 | 
										if (W.signs.getFile().get("leave_" + number) == null) {
 | 
				
			||||||
						W.signs.getFile().set("leave_" + number + ".arenaName",
 | 
											W.signs.getFile().set("leave_" + number + ".arenaName", "leave");
 | 
				
			||||||
								"leave");
 | 
											W.signs.getFile().set("leave_" + number + ".location", location);
 | 
				
			||||||
						W.signs.getFile().set("leave_" + number + ".location",
 | 
					 | 
				
			||||||
								location);
 | 
					 | 
				
			||||||
						W.signs.save();
 | 
											W.signs.save();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						saved = true;
 | 
											saved = true;
 | 
				
			||||||
@@ -35,10 +32,8 @@ public class SignsHandler {
 | 
				
			|||||||
				int number = 1;
 | 
									int number = 1;
 | 
				
			||||||
				while (!saved) {
 | 
									while (!saved) {
 | 
				
			||||||
					if (W.signs.getFile().get("shop_" + number) == null) {
 | 
										if (W.signs.getFile().get("shop_" + number) == null) {
 | 
				
			||||||
						W.signs.getFile().set("shop_" + number + ".arenaName",
 | 
											W.signs.getFile().set("shop_" + number + ".arenaName", "shop");
 | 
				
			||||||
								"shop");
 | 
											W.signs.getFile().set("shop_" + number + ".location", location);
 | 
				
			||||||
						W.signs.getFile().set("shop_" + number + ".location",
 | 
					 | 
				
			||||||
								location);
 | 
					 | 
				
			||||||
						W.signs.save();
 | 
											W.signs.save();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						saved = true;
 | 
											saved = true;
 | 
				
			||||||
@@ -52,14 +47,9 @@ public class SignsHandler {
 | 
				
			|||||||
					if (lines[1].equals(arena.arenaName)) {
 | 
										if (lines[1].equals(arena.arenaName)) {
 | 
				
			||||||
						int number = 1;
 | 
											int number = 1;
 | 
				
			||||||
						while (!saved) {
 | 
											while (!saved) {
 | 
				
			||||||
							if (W.signs.getFile().get(
 | 
												if (W.signs.getFile().get(arena.arenaName + "_" + number) == null) {
 | 
				
			||||||
									arena.arenaName + "_" + number) == null) {
 | 
													W.signs.getFile().set(arena.arenaName + "_" + number + ".arenaName", lines[1]);
 | 
				
			||||||
								W.signs.getFile().set(
 | 
													W.signs.getFile().set(arena.arenaName + "_" + number + ".location", location);
 | 
				
			||||||
										arena.arenaName + "_" + number
 | 
					 | 
				
			||||||
												+ ".arenaName", lines[1]);
 | 
					 | 
				
			||||||
								W.signs.getFile().set(
 | 
					 | 
				
			||||||
										arena.arenaName + "_" + number
 | 
					 | 
				
			||||||
												+ ".location", location);
 | 
					 | 
				
			||||||
								W.signs.save();
 | 
													W.signs.save();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
								saved = true;
 | 
													saved = true;
 | 
				
			||||||
@@ -71,8 +61,7 @@ public class SignsHandler {
 | 
				
			|||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (!saved) {
 | 
									if (!saved) {
 | 
				
			||||||
					MessageM.sendFMessage(event.getPlayer(),
 | 
										MessageM.sendFMessage(event.getPlayer(), ConfigC.error_noArena, "name-" + lines[1]);
 | 
				
			||||||
							ConfigC.error_noArena, "name-" + lines[1]);
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -80,9 +69,7 @@ public class SignsHandler {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	public static void removeSign(LocationSerializable location) {
 | 
						public static void removeSign(LocationSerializable location) {
 | 
				
			||||||
		for (String sign : W.signs.getFile().getKeys(false)) {
 | 
							for (String sign : W.signs.getFile().getKeys(false)) {
 | 
				
			||||||
			LocationSerializable loc = new LocationSerializable(
 | 
								LocationSerializable loc = new LocationSerializable((LocationSerializable) W.signs.getFile().get(sign + ".location"));
 | 
				
			||||||
					(LocationSerializable) W.signs.getFile().get(
 | 
					 | 
				
			||||||
							sign + ".location"));
 | 
					 | 
				
			||||||
			if (loc.equals(location)) {
 | 
								if (loc.equals(location)) {
 | 
				
			||||||
				W.signs.getFile().set(sign, null);
 | 
									W.signs.getFile().set(sign, null);
 | 
				
			||||||
				W.signs.save();
 | 
									W.signs.save();
 | 
				
			||||||
@@ -92,9 +79,7 @@ public class SignsHandler {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	public static boolean isSign(LocationSerializable location) {
 | 
						public static boolean isSign(LocationSerializable location) {
 | 
				
			||||||
		for (String sign : W.signs.getFile().getKeys(false)) {
 | 
							for (String sign : W.signs.getFile().getKeys(false)) {
 | 
				
			||||||
			LocationSerializable loc = new LocationSerializable(
 | 
								LocationSerializable loc = new LocationSerializable((LocationSerializable) W.signs.getFile().get(sign + ".location"));
 | 
				
			||||||
					(LocationSerializable) W.signs.getFile().get(
 | 
					 | 
				
			||||||
							sign + ".location"));
 | 
					 | 
				
			||||||
			if (loc.equals(location)) {
 | 
								if (loc.equals(location)) {
 | 
				
			||||||
				return true;
 | 
									return true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
@@ -107,34 +92,27 @@ public class SignsHandler {
 | 
				
			|||||||
	public static void updateSigns() {
 | 
						public static void updateSigns() {
 | 
				
			||||||
		W.signs.load();
 | 
							W.signs.load();
 | 
				
			||||||
		for (String sign : W.signs.getFile().getKeys(false)) {
 | 
							for (String sign : W.signs.getFile().getKeys(false)) {
 | 
				
			||||||
			LocationSerializable loc = new LocationSerializable(
 | 
								LocationSerializable loc = new LocationSerializable((LocationSerializable) W.signs.getFile().get(sign + ".location"));
 | 
				
			||||||
					(LocationSerializable) W.signs.getFile().get(
 | 
								if (loc.getBlock().getType().equals(Material.SIGN_POST) || loc.getBlock().getType().equals(Material.WALL_SIGN)) {
 | 
				
			||||||
							sign + ".location"));
 | 
					 | 
				
			||||||
			if (loc.getBlock().getType().equals(Material.SIGN_POST)
 | 
					 | 
				
			||||||
					|| loc.getBlock().getType().equals(Material.WALL_SIGN)) {
 | 
					 | 
				
			||||||
				Sign signblock = (Sign) loc.getBlock().getState();
 | 
									Sign signblock = (Sign) loc.getBlock().getState();
 | 
				
			||||||
				String[] lines = signblock.getLines();
 | 
									String[] lines = signblock.getLines();
 | 
				
			||||||
				if (sign.contains("leave")) {
 | 
									if (sign.contains("leave")) {
 | 
				
			||||||
					ArrayList<String> signLines = (ArrayList<String>) W.config
 | 
										ArrayList<String> signLines = (ArrayList<String>) W.config.getFile().getList(ConfigC.sign_LEAVE.location);
 | 
				
			||||||
							.getFile().getList(ConfigC.sign_LEAVE.location);
 | 
					 | 
				
			||||||
					int linecount = 0;
 | 
										int linecount = 0;
 | 
				
			||||||
					for (String line : signLines) {
 | 
										for (String line : signLines) {
 | 
				
			||||||
						if (linecount <= 3) {
 | 
											if (linecount <= 3) {
 | 
				
			||||||
							signblock.setLine(linecount,
 | 
												signblock.setLine(linecount, MessageM.replaceAll(line));
 | 
				
			||||||
									MessageM.replaceAll(line));
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						linecount = linecount + 1;
 | 
											linecount = linecount + 1;
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
					signblock.update();
 | 
										signblock.update();
 | 
				
			||||||
				} else if (sign.contains("shop")) {
 | 
									} else if (sign.contains("shop")) {
 | 
				
			||||||
					ArrayList<String> signLines = (ArrayList<String>) W.config
 | 
										ArrayList<String> signLines = (ArrayList<String>) W.config.getFile().getList(ConfigC.sign_SHOP.location);
 | 
				
			||||||
							.getFile().getList(ConfigC.sign_SHOP.location);
 | 
					 | 
				
			||||||
					int linecount = 0;
 | 
										int linecount = 0;
 | 
				
			||||||
					for (String line : signLines) {
 | 
										for (String line : signLines) {
 | 
				
			||||||
						if (linecount <= 3) {
 | 
											if (linecount <= 3) {
 | 
				
			||||||
							signblock.setLine(linecount,
 | 
												signblock.setLine(linecount, MessageM.replaceAll(line));
 | 
				
			||||||
									MessageM.replaceAll(line));
 | 
					 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						linecount = linecount + 1;
 | 
											linecount = linecount + 1;
 | 
				
			||||||
@@ -144,85 +122,47 @@ public class SignsHandler {
 | 
				
			|||||||
					for (Arena arena : W.arenaList) {
 | 
										for (Arena arena : W.arenaList) {
 | 
				
			||||||
						if (lines[1].endsWith(arena.arenaName)) {
 | 
											if (lines[1].endsWith(arena.arenaName)) {
 | 
				
			||||||
							if (arena.gameState.equals(ArenaState.WAITING)) {
 | 
												if (arena.gameState.equals(ArenaState.WAITING)) {
 | 
				
			||||||
								ArrayList<String> signLines = (ArrayList<String>) W.config
 | 
													ArrayList<String> signLines = (ArrayList<String>) W.config.getFile().getList(ConfigC.sign_WAITING.location);
 | 
				
			||||||
										.getFile().getList(
 | 
					 | 
				
			||||||
												ConfigC.sign_WAITING.location);
 | 
					 | 
				
			||||||
								int linecount = 0;
 | 
													int linecount = 0;
 | 
				
			||||||
								if (signLines != null) {
 | 
													if (signLines != null) {
 | 
				
			||||||
									for (String line : signLines) {
 | 
														for (String line : signLines) {
 | 
				
			||||||
										if (linecount <= 3) {
 | 
															if (linecount <= 3) {
 | 
				
			||||||
											signblock
 | 
																signblock.setLine(
 | 
				
			||||||
													.setLine(
 | 
					 | 
				
			||||||
													linecount,
 | 
																		linecount,
 | 
				
			||||||
															MessageM.replaceAll(
 | 
																		MessageM.replaceAll(line, "arenaname-" + arena.arenaName, "players-" + arena.playersInArena.size(), "maxplayers-"
 | 
				
			||||||
																	line,
 | 
																				+ arena.maxPlayers, "timeleft-" + arena.timer));
 | 
				
			||||||
																	"arenaname-"
 | 
					 | 
				
			||||||
																			+ arena.arenaName,
 | 
					 | 
				
			||||||
																	"players-"
 | 
					 | 
				
			||||||
																			+ arena.playersInArena
 | 
					 | 
				
			||||||
																					.size(),
 | 
					 | 
				
			||||||
																	"maxplayers-"
 | 
					 | 
				
			||||||
																			+ arena.maxPlayers,
 | 
					 | 
				
			||||||
																	"timeleft-"
 | 
					 | 
				
			||||||
																			+ arena.timer));
 | 
					 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
										linecount = linecount + 1;
 | 
															linecount = linecount + 1;
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
								signblock.update();
 | 
													signblock.update();
 | 
				
			||||||
							} else if (arena.gameState
 | 
												} else if (arena.gameState.equals(ArenaState.STARTING)) {
 | 
				
			||||||
									.equals(ArenaState.STARTING)) {
 | 
													ArrayList<String> signLines = (ArrayList<String>) W.config.getFile().getList(ConfigC.sign_STARTING.location);
 | 
				
			||||||
								ArrayList<String> signLines = (ArrayList<String>) W.config
 | 
					 | 
				
			||||||
										.getFile().getList(
 | 
					 | 
				
			||||||
												ConfigC.sign_STARTING.location);
 | 
					 | 
				
			||||||
								int linecount = 0;
 | 
													int linecount = 0;
 | 
				
			||||||
								if (signLines != null) {
 | 
													if (signLines != null) {
 | 
				
			||||||
									for (String line : signLines) {
 | 
														for (String line : signLines) {
 | 
				
			||||||
										if (linecount <= 3) {
 | 
															if (linecount <= 3) {
 | 
				
			||||||
											signblock
 | 
																signblock.setLine(
 | 
				
			||||||
													.setLine(
 | 
					 | 
				
			||||||
													linecount,
 | 
																		linecount,
 | 
				
			||||||
															MessageM.replaceAll(
 | 
																		MessageM.replaceAll(line, "arenaname-" + arena.arenaName, "players-" + arena.playersInArena.size(), "maxplayers-"
 | 
				
			||||||
																	line,
 | 
																				+ arena.maxPlayers, "timeleft-" + arena.timer));
 | 
				
			||||||
																	"arenaname-"
 | 
					 | 
				
			||||||
																			+ arena.arenaName,
 | 
					 | 
				
			||||||
																	"players-"
 | 
					 | 
				
			||||||
																			+ arena.playersInArena
 | 
					 | 
				
			||||||
																					.size(),
 | 
					 | 
				
			||||||
																	"maxplayers-"
 | 
					 | 
				
			||||||
																			+ arena.maxPlayers,
 | 
					 | 
				
			||||||
																	"timeleft-"
 | 
					 | 
				
			||||||
																			+ arena.timer));
 | 
					 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
										linecount = linecount + 1;
 | 
															linecount = linecount + 1;
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
								signblock.update();
 | 
													signblock.update();
 | 
				
			||||||
							} else if (arena.gameState
 | 
												} else if (arena.gameState.equals(ArenaState.INGAME)) {
 | 
				
			||||||
									.equals(ArenaState.INGAME)) {
 | 
													ArrayList<String> signLines = (ArrayList<String>) W.config.getFile().getList(ConfigC.sign_INGAME.location);
 | 
				
			||||||
								ArrayList<String> signLines = (ArrayList<String>) W.config
 | 
					 | 
				
			||||||
										.getFile().getList(
 | 
					 | 
				
			||||||
												ConfigC.sign_INGAME.location);
 | 
					 | 
				
			||||||
								int linecount = 0;
 | 
													int linecount = 0;
 | 
				
			||||||
								if (signLines != null) {
 | 
													if (signLines != null) {
 | 
				
			||||||
									for (String line : signLines) {
 | 
														for (String line : signLines) {
 | 
				
			||||||
										if (linecount <= 3) {
 | 
															if (linecount <= 3) {
 | 
				
			||||||
											signblock
 | 
																signblock.setLine(
 | 
				
			||||||
													.setLine(
 | 
					 | 
				
			||||||
													linecount,
 | 
																		linecount,
 | 
				
			||||||
															MessageM.replaceAll(
 | 
																		MessageM.replaceAll(line, "arenaname-" + arena.arenaName, "players-" + arena.playersInArena.size(), "maxplayers-"
 | 
				
			||||||
																	line,
 | 
																				+ arena.maxPlayers, "timeleft-" + arena.timer));
 | 
				
			||||||
																	"arenaname-"
 | 
					 | 
				
			||||||
																			+ arena.arenaName,
 | 
					 | 
				
			||||||
																	"players-"
 | 
					 | 
				
			||||||
																			+ arena.playersInArena
 | 
					 | 
				
			||||||
																					.size(),
 | 
					 | 
				
			||||||
																	"maxplayers-"
 | 
					 | 
				
			||||||
																			+ arena.maxPlayers,
 | 
					 | 
				
			||||||
																	"timeleft-"
 | 
					 | 
				
			||||||
																			+ arena.timer));
 | 
					 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
										linecount = linecount + 1;
 | 
															linecount = linecount + 1;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,15 +28,12 @@ public class SolidBlockHandler {
 | 
				
			|||||||
			if (!pl.equals(player)) {
 | 
								if (!pl.equals(player)) {
 | 
				
			||||||
				if (W.hiddenLocWater.get(player) != null) {
 | 
									if (W.hiddenLocWater.get(player) != null) {
 | 
				
			||||||
					if (W.hiddenLocWater.get(player)) {
 | 
										if (W.hiddenLocWater.get(player)) {
 | 
				
			||||||
						pl.sendBlockChange(pBlock.getLocation(),
 | 
											pl.sendBlockChange(pBlock.getLocation(), Material.STATIONARY_WATER, (byte) 0);
 | 
				
			||||||
								Material.STATIONARY_WATER, (byte) 0);
 | 
					 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
						pl.sendBlockChange(pBlock.getLocation(), Material.AIR,
 | 
											pl.sendBlockChange(pBlock.getLocation(), Material.AIR, (byte) 0);
 | 
				
			||||||
								(byte) 0);
 | 
					 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					pl.sendBlockChange(pBlock.getLocation(), Material.AIR,
 | 
										pl.sendBlockChange(pBlock.getLocation(), Material.AIR, (byte) 0);
 | 
				
			||||||
							(byte) 0);
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				W.hiddenLocWater.remove(player);
 | 
									W.hiddenLocWater.remove(player);
 | 
				
			||||||
@@ -50,8 +47,7 @@ public class SolidBlockHandler {
 | 
				
			|||||||
			playerShow.showPlayer(player);
 | 
								playerShow.showPlayer(player);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		MiscDisguise disguise = new MiscDisguise(DisguiseType.FALLING_BLOCK,
 | 
							MiscDisguise disguise = new MiscDisguise(DisguiseType.FALLING_BLOCK, block.getTypeId(), block.getDurability());
 | 
				
			||||||
				block.getTypeId(), block.getDurability());
 | 
					 | 
				
			||||||
		DisguiseAPI.disguiseToAll(player, disguise);
 | 
							DisguiseAPI.disguiseToAll(player, disguise);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		MessageM.sendFMessage(player, ConfigC.normal_ingameNoMoreSolid);
 | 
							MessageM.sendFMessage(player, ConfigC.normal_ingameNoMoreSolid);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,641 +0,0 @@
 | 
				
			|||||||
/*
 | 
					 | 
				
			||||||
 * Updater for Bukkit.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * This class provides the means to safetly and easily update a plugin, or check to see if it is updated using dev.bukkit.org
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
package nl.Steffion.BlockHunt;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import java.io.BufferedInputStream;
 | 
					 | 
				
			||||||
import java.io.BufferedOutputStream;
 | 
					 | 
				
			||||||
import java.io.BufferedReader;
 | 
					 | 
				
			||||||
import java.io.File;
 | 
					 | 
				
			||||||
import java.io.FileOutputStream;
 | 
					 | 
				
			||||||
import java.io.IOException;
 | 
					 | 
				
			||||||
import java.io.InputStream;
 | 
					 | 
				
			||||||
import java.io.InputStreamReader;
 | 
					 | 
				
			||||||
import java.net.MalformedURLException;
 | 
					 | 
				
			||||||
import java.net.URL;
 | 
					 | 
				
			||||||
import java.net.URLConnection;
 | 
					 | 
				
			||||||
import java.util.Enumeration;
 | 
					 | 
				
			||||||
import java.util.zip.ZipEntry;
 | 
					 | 
				
			||||||
import java.util.zip.ZipFile;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import javax.xml.stream.XMLEventReader;
 | 
					 | 
				
			||||||
import javax.xml.stream.XMLInputFactory;
 | 
					 | 
				
			||||||
import javax.xml.stream.XMLStreamException;
 | 
					 | 
				
			||||||
import javax.xml.stream.events.XMLEvent;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import nl.Steffion.BlockHunt.Managers.MessageM;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import org.bukkit.configuration.file.YamlConfiguration;
 | 
					 | 
				
			||||||
import org.bukkit.plugin.Plugin;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * Check dev.bukkit.org to find updates for a given plugin, and download the
 | 
					 | 
				
			||||||
 * updates if needed.
 | 
					 | 
				
			||||||
 * <p>
 | 
					 | 
				
			||||||
 * <b>VERY, VERY IMPORTANT</b>: Because there are no standards for adding
 | 
					 | 
				
			||||||
 * auto-update toggles in your plugin's config, this system provides NO CHECK
 | 
					 | 
				
			||||||
 * WITH YOUR CONFIG to make sure the user has allowed auto-updating. <br>
 | 
					 | 
				
			||||||
 * It is a <b>BUKKIT POLICY</b> that you include a boolean value in your config
 | 
					 | 
				
			||||||
 * that prevents the auto-updater from running <b>AT ALL</b>. <br>
 | 
					 | 
				
			||||||
 * If you fail to include this option in your config, your plugin will be
 | 
					 | 
				
			||||||
 * <b>REJECTED</b> when you attempt to submit it to dev.bukkit.org.
 | 
					 | 
				
			||||||
 * <p>
 | 
					 | 
				
			||||||
 * An example of a good configuration option would be something similar to
 | 
					 | 
				
			||||||
 * 'auto-update: true' - if this value is set to false you may NOT run the
 | 
					 | 
				
			||||||
 * auto-updater. <br>
 | 
					 | 
				
			||||||
 * If you are unsure about these rules, please read the plugin submission
 | 
					 | 
				
			||||||
 * guidelines: http://goo.gl/8iU5l
 | 
					 | 
				
			||||||
 * 
 | 
					 | 
				
			||||||
 * @author H31IX
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class Updater {
 | 
					 | 
				
			||||||
	private Plugin plugin;
 | 
					 | 
				
			||||||
	private UpdateType type;
 | 
					 | 
				
			||||||
	private String versionTitle;
 | 
					 | 
				
			||||||
	private String versionLink;
 | 
					 | 
				
			||||||
	private long totalSize; // Holds the total size of the file
 | 
					 | 
				
			||||||
	// private double downloadedSize; TODO: Holds the number of bytes downloaded
 | 
					 | 
				
			||||||
	private int sizeLine; // Used for detecting file size
 | 
					 | 
				
			||||||
	private int multiplier; // Used for determining when to broadcast download
 | 
					 | 
				
			||||||
							// updates
 | 
					 | 
				
			||||||
	private boolean announce; // Whether to announce file downloads
 | 
					 | 
				
			||||||
	private URL url; // Connecting to RSS
 | 
					 | 
				
			||||||
	private File file; // The plugin's file
 | 
					 | 
				
			||||||
	private Thread thread; // Updater thread
 | 
					 | 
				
			||||||
	private static final String DBOUrl = "http://dev.bukkit.org/bukkit-plugins/"; // Slugs
 | 
					 | 
				
			||||||
																					// will
 | 
					 | 
				
			||||||
																					// be
 | 
					 | 
				
			||||||
																					// appended
 | 
					 | 
				
			||||||
																					// to
 | 
					 | 
				
			||||||
																					// this
 | 
					 | 
				
			||||||
																					// to
 | 
					 | 
				
			||||||
																					// get
 | 
					 | 
				
			||||||
																					// to
 | 
					 | 
				
			||||||
																					// the
 | 
					 | 
				
			||||||
																					// project's
 | 
					 | 
				
			||||||
																					// RSS
 | 
					 | 
				
			||||||
																					// feed
 | 
					 | 
				
			||||||
	private String[] noUpdateTag = { "-DEV", "-PRE", "-SNAPSHOT" }; // If the
 | 
					 | 
				
			||||||
																	// version
 | 
					 | 
				
			||||||
																	// number
 | 
					 | 
				
			||||||
																	// contains
 | 
					 | 
				
			||||||
																	// one of
 | 
					 | 
				
			||||||
																	// these,
 | 
					 | 
				
			||||||
																	// don't
 | 
					 | 
				
			||||||
																	// update.
 | 
					 | 
				
			||||||
	private static final int BYTE_SIZE = 1024; // Used for downloading files
 | 
					 | 
				
			||||||
	private String updateFolder = YamlConfiguration.loadConfiguration(
 | 
					 | 
				
			||||||
			new File("bukkit.yml")).getString("settings.update-folder"); // The
 | 
					 | 
				
			||||||
																			// folder
 | 
					 | 
				
			||||||
																			// that
 | 
					 | 
				
			||||||
																			// downloads
 | 
					 | 
				
			||||||
																			// will
 | 
					 | 
				
			||||||
																			// be
 | 
					 | 
				
			||||||
																			// placed
 | 
					 | 
				
			||||||
																			// in
 | 
					 | 
				
			||||||
	private Updater.UpdateResult result = Updater.UpdateResult.SUCCESS; // Used
 | 
					 | 
				
			||||||
																		// for
 | 
					 | 
				
			||||||
																		// determining
 | 
					 | 
				
			||||||
																		// the
 | 
					 | 
				
			||||||
																		// outcome
 | 
					 | 
				
			||||||
																		// of
 | 
					 | 
				
			||||||
																		// the
 | 
					 | 
				
			||||||
																		// update
 | 
					 | 
				
			||||||
																		// process
 | 
					 | 
				
			||||||
	// Strings for reading RSS
 | 
					 | 
				
			||||||
	private static final String TITLE = "title";
 | 
					 | 
				
			||||||
	private static final String LINK = "link";
 | 
					 | 
				
			||||||
	private static final String ITEM = "item";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Gives the dev the result of the update process. Can be obtained by called
 | 
					 | 
				
			||||||
	 * getResult().
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	public enum UpdateResult {
 | 
					 | 
				
			||||||
		/**
 | 
					 | 
				
			||||||
		 * The updater found an update, and has readied it to be loaded the next
 | 
					 | 
				
			||||||
		 * time the server restarts/reloads.
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		SUCCESS,
 | 
					 | 
				
			||||||
		/**
 | 
					 | 
				
			||||||
		 * The updater did not find an update, and nothing was downloaded.
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		NO_UPDATE,
 | 
					 | 
				
			||||||
		/**
 | 
					 | 
				
			||||||
		 * The updater found an update, but was unable to download it.
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		FAIL_DOWNLOAD,
 | 
					 | 
				
			||||||
		/**
 | 
					 | 
				
			||||||
		 * For some reason, the updater was unable to contact dev.bukkit.org to
 | 
					 | 
				
			||||||
		 * download the file.
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		FAIL_DBO,
 | 
					 | 
				
			||||||
		/**
 | 
					 | 
				
			||||||
		 * When running the version check, the file on DBO did not contain the a
 | 
					 | 
				
			||||||
		 * version in the format 'vVersion' such as 'v1.0'.
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		FAIL_NOVERSION,
 | 
					 | 
				
			||||||
		/**
 | 
					 | 
				
			||||||
		 * The slug provided by the plugin running the updater was invalid and
 | 
					 | 
				
			||||||
		 * doesn't exist on DBO.
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		FAIL_BADSLUG,
 | 
					 | 
				
			||||||
		/**
 | 
					 | 
				
			||||||
		 * The updater found an update, but because of the UpdateType being set
 | 
					 | 
				
			||||||
		 * to NO_DOWNLOAD, it wasn't downloaded.
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		UPDATE_AVAILABLE
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Allows the dev to specify the type of update that will be run.
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	public enum UpdateType {
 | 
					 | 
				
			||||||
		/**
 | 
					 | 
				
			||||||
		 * Run a version check, and then if the file is out of date, download
 | 
					 | 
				
			||||||
		 * the newest version.
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		DEFAULT,
 | 
					 | 
				
			||||||
		/**
 | 
					 | 
				
			||||||
		 * Don't run a version check, just find the latest update and download
 | 
					 | 
				
			||||||
		 * it.
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		NO_VERSION_CHECK,
 | 
					 | 
				
			||||||
		/**
 | 
					 | 
				
			||||||
		 * Get information about the version and the download size, but don't
 | 
					 | 
				
			||||||
		 * actually download anything.
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		NO_DOWNLOAD
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Initialize the updater
 | 
					 | 
				
			||||||
	 * 
 | 
					 | 
				
			||||||
	 * @param plugin
 | 
					 | 
				
			||||||
	 *            The plugin that is checking for an update.
 | 
					 | 
				
			||||||
	 * @param slug
 | 
					 | 
				
			||||||
	 *            The dev.bukkit.org slug of the project
 | 
					 | 
				
			||||||
	 *            (http://dev.bukkit.org/server-mods/SLUG_IS_HERE)
 | 
					 | 
				
			||||||
	 * @param file
 | 
					 | 
				
			||||||
	 *            The file that the plugin is running from, get this by doing
 | 
					 | 
				
			||||||
	 *            this.getFile() from within your main class.
 | 
					 | 
				
			||||||
	 * @param type
 | 
					 | 
				
			||||||
	 *            Specify the type of update this will be. See
 | 
					 | 
				
			||||||
	 *            {@link UpdateType}
 | 
					 | 
				
			||||||
	 * @param announce
 | 
					 | 
				
			||||||
	 *            True if the program should announce the progress of new
 | 
					 | 
				
			||||||
	 *            updates in console
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	public Updater (Plugin plugin, String slug, File file, UpdateType type,
 | 
					 | 
				
			||||||
			boolean announce) {
 | 
					 | 
				
			||||||
		this.plugin = plugin;
 | 
					 | 
				
			||||||
		this.type = type;
 | 
					 | 
				
			||||||
		this.announce = announce;
 | 
					 | 
				
			||||||
		this.file = file;
 | 
					 | 
				
			||||||
		try {
 | 
					 | 
				
			||||||
			// Obtain the results of the project's file feed
 | 
					 | 
				
			||||||
			url = new URL(DBOUrl + slug + "/files.rss");
 | 
					 | 
				
			||||||
		} catch (MalformedURLException ex) {
 | 
					 | 
				
			||||||
			// Invalid slug
 | 
					 | 
				
			||||||
			MessageM.sendMessage(null, "%TAG%WThe author of this plugin ("
 | 
					 | 
				
			||||||
					+ plugin.getDescription().getAuthors().get(0)
 | 
					 | 
				
			||||||
					+ ") has misconfigured their Auto Update system");
 | 
					 | 
				
			||||||
			MessageM.sendMessage(null, "%TAG%WThe project slug given ('" + slug
 | 
					 | 
				
			||||||
					+ "') is invalid. Please nag the author about this.");
 | 
					 | 
				
			||||||
			result = Updater.UpdateResult.FAIL_BADSLUG; // Bad slug! Bad!
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		thread = new Thread(new UpdateRunnable());
 | 
					 | 
				
			||||||
		thread.start();
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Get the result of the update process.
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	public Updater.UpdateResult getResult() {
 | 
					 | 
				
			||||||
		waitForThread();
 | 
					 | 
				
			||||||
		return result;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Get the total bytes of the file (can only be used after running a version
 | 
					 | 
				
			||||||
	 * check or a normal run).
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	public long getFileSize() {
 | 
					 | 
				
			||||||
		waitForThread();
 | 
					 | 
				
			||||||
		return totalSize;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Get the version string latest file avaliable online.
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	public String getLatestVersionString() {
 | 
					 | 
				
			||||||
		waitForThread();
 | 
					 | 
				
			||||||
		return versionTitle;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * As the result of Updater output depends on the thread's completion, it is
 | 
					 | 
				
			||||||
	 * necessary to wait for the thread to finish before alloowing anyone to
 | 
					 | 
				
			||||||
	 * check the result.
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	public void waitForThread() {
 | 
					 | 
				
			||||||
		if (thread.isAlive()) {
 | 
					 | 
				
			||||||
			try {
 | 
					 | 
				
			||||||
				thread.join();
 | 
					 | 
				
			||||||
			} catch (InterruptedException e) {
 | 
					 | 
				
			||||||
				e.printStackTrace();
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Save an update from dev.bukkit.org into the server's update folder.
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	private void saveFile(File folder, String file, String u) {
 | 
					 | 
				
			||||||
		if (!folder.exists()) {
 | 
					 | 
				
			||||||
			folder.mkdir();
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		BufferedInputStream in = null;
 | 
					 | 
				
			||||||
		FileOutputStream fout = null;
 | 
					 | 
				
			||||||
		try {
 | 
					 | 
				
			||||||
			// Download the file
 | 
					 | 
				
			||||||
			URL url = new URL(u);
 | 
					 | 
				
			||||||
			int fileLength = url.openConnection().getContentLength();
 | 
					 | 
				
			||||||
			in = new BufferedInputStream(url.openStream());
 | 
					 | 
				
			||||||
			fout = new FileOutputStream(folder.getAbsolutePath() + "/" + file);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			byte[] data = new byte[BYTE_SIZE];
 | 
					 | 
				
			||||||
			int count;
 | 
					 | 
				
			||||||
			if (announce)
 | 
					 | 
				
			||||||
				MessageM.sendMessage(null,
 | 
					 | 
				
			||||||
						"%TAG%NAbout to download a new update: " + versionTitle);
 | 
					 | 
				
			||||||
			long downloaded = 0;
 | 
					 | 
				
			||||||
			while ((count = in.read(data, 0, BYTE_SIZE)) != -1) {
 | 
					 | 
				
			||||||
				downloaded += count;
 | 
					 | 
				
			||||||
				fout.write(data, 0, count);
 | 
					 | 
				
			||||||
				int percent = (int) (downloaded * 100 / fileLength);
 | 
					 | 
				
			||||||
				if (announce & (percent % 10 == 0)) {
 | 
					 | 
				
			||||||
					MessageM.sendMessage(null, "%TAG%NDownloading update: "
 | 
					 | 
				
			||||||
							+ percent + "% of " + fileLength + " bytes.");
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			// Just a quick check to make sure we didn't leave any files from
 | 
					 | 
				
			||||||
			// last time...
 | 
					 | 
				
			||||||
			for (File xFile : new File("plugins/" + updateFolder).listFiles()) {
 | 
					 | 
				
			||||||
				if (xFile.getName().endsWith(".zip")) {
 | 
					 | 
				
			||||||
					xFile.delete();
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			// Check to see if it's a zip file, if it is, unzip it.
 | 
					 | 
				
			||||||
			File dFile = new File(folder.getAbsolutePath() + "/" + file);
 | 
					 | 
				
			||||||
			if (dFile.getName().endsWith(".zip")) {
 | 
					 | 
				
			||||||
				// Unzip
 | 
					 | 
				
			||||||
				unzip(dFile.getCanonicalPath());
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			if (announce)
 | 
					 | 
				
			||||||
				MessageM.sendMessage(null, "%TAG%NFinished updating.");
 | 
					 | 
				
			||||||
		} catch (Exception ex) {
 | 
					 | 
				
			||||||
			MessageM.sendMessage(null,
 | 
					 | 
				
			||||||
					"%TAG%WThe auto-updater tried to download a new update, but was unsuccessful.");
 | 
					 | 
				
			||||||
			result = Updater.UpdateResult.FAIL_DOWNLOAD;
 | 
					 | 
				
			||||||
		} finally {
 | 
					 | 
				
			||||||
			try {
 | 
					 | 
				
			||||||
				if (in != null) {
 | 
					 | 
				
			||||||
					in.close();
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				if (fout != null) {
 | 
					 | 
				
			||||||
					fout.close();
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			} catch (Exception ex) {
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Part of Zip-File-Extractor, modified by H31IX for use with Bukkit
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	private void unzip(String file) {
 | 
					 | 
				
			||||||
		try {
 | 
					 | 
				
			||||||
			File fSourceZip = new File(file);
 | 
					 | 
				
			||||||
			String zipPath = file.substring(0, file.length() - 4);
 | 
					 | 
				
			||||||
			ZipFile zipFile = new ZipFile(fSourceZip);
 | 
					 | 
				
			||||||
			Enumeration<? extends ZipEntry> e = zipFile.entries();
 | 
					 | 
				
			||||||
			while (e.hasMoreElements()) {
 | 
					 | 
				
			||||||
				ZipEntry entry = (ZipEntry) e.nextElement();
 | 
					 | 
				
			||||||
				File destinationFilePath = new File(zipPath, entry.getName());
 | 
					 | 
				
			||||||
				destinationFilePath.getParentFile().mkdirs();
 | 
					 | 
				
			||||||
				if (entry.isDirectory()) {
 | 
					 | 
				
			||||||
					continue;
 | 
					 | 
				
			||||||
				} else {
 | 
					 | 
				
			||||||
					BufferedInputStream bis = new BufferedInputStream(
 | 
					 | 
				
			||||||
							zipFile.getInputStream(entry));
 | 
					 | 
				
			||||||
					int b;
 | 
					 | 
				
			||||||
					byte buffer[] = new byte[BYTE_SIZE];
 | 
					 | 
				
			||||||
					FileOutputStream fos = new FileOutputStream(
 | 
					 | 
				
			||||||
							destinationFilePath);
 | 
					 | 
				
			||||||
					BufferedOutputStream bos = new BufferedOutputStream(fos,
 | 
					 | 
				
			||||||
							BYTE_SIZE);
 | 
					 | 
				
			||||||
					while ((b = bis.read(buffer, 0, BYTE_SIZE)) != -1) {
 | 
					 | 
				
			||||||
						bos.write(buffer, 0, b);
 | 
					 | 
				
			||||||
					}
 | 
					 | 
				
			||||||
					bos.flush();
 | 
					 | 
				
			||||||
					bos.close();
 | 
					 | 
				
			||||||
					bis.close();
 | 
					 | 
				
			||||||
					String name = destinationFilePath.getName();
 | 
					 | 
				
			||||||
					if (name.endsWith(".jar") && pluginFile(name)) {
 | 
					 | 
				
			||||||
						destinationFilePath.renameTo(new File("plugins/"
 | 
					 | 
				
			||||||
								+ updateFolder + "/" + name));
 | 
					 | 
				
			||||||
					}
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				entry = null;
 | 
					 | 
				
			||||||
				destinationFilePath = null;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			e = null;
 | 
					 | 
				
			||||||
			zipFile.close();
 | 
					 | 
				
			||||||
			zipFile = null;
 | 
					 | 
				
			||||||
			// Move any plugin data folders that were included to the right
 | 
					 | 
				
			||||||
			// place, Bukkit won't do this for us.
 | 
					 | 
				
			||||||
			for (File dFile : new File(zipPath).listFiles()) {
 | 
					 | 
				
			||||||
				if (dFile.isDirectory()) {
 | 
					 | 
				
			||||||
					if (pluginFile(dFile.getName())) {
 | 
					 | 
				
			||||||
						File oFile = new File("plugins/" + dFile.getName()); // Get
 | 
					 | 
				
			||||||
																				// current
 | 
					 | 
				
			||||||
																				// dir
 | 
					 | 
				
			||||||
						File[] contents = oFile.listFiles(); // List of existing
 | 
					 | 
				
			||||||
																// files in the
 | 
					 | 
				
			||||||
																// current dir
 | 
					 | 
				
			||||||
						for (File cFile : dFile.listFiles()) // Loop through all
 | 
					 | 
				
			||||||
																// the files in
 | 
					 | 
				
			||||||
																// the new dir
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							boolean found = false;
 | 
					 | 
				
			||||||
							for (File xFile : contents) // Loop through contents
 | 
					 | 
				
			||||||
														// to see if it exists
 | 
					 | 
				
			||||||
							{
 | 
					 | 
				
			||||||
								if (xFile.getName().equals(cFile.getName())) {
 | 
					 | 
				
			||||||
									found = true;
 | 
					 | 
				
			||||||
									break;
 | 
					 | 
				
			||||||
								}
 | 
					 | 
				
			||||||
							}
 | 
					 | 
				
			||||||
							if (!found) {
 | 
					 | 
				
			||||||
								// Move the new file into the current dir
 | 
					 | 
				
			||||||
								cFile.renameTo(new File(oFile
 | 
					 | 
				
			||||||
										.getCanonicalFile()
 | 
					 | 
				
			||||||
										+ "/"
 | 
					 | 
				
			||||||
										+ cFile.getName()));
 | 
					 | 
				
			||||||
							} else {
 | 
					 | 
				
			||||||
								// This file already exists, so we don't need it
 | 
					 | 
				
			||||||
								// anymore.
 | 
					 | 
				
			||||||
								cFile.delete();
 | 
					 | 
				
			||||||
							}
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					}
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				dFile.delete();
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			new File(zipPath).delete();
 | 
					 | 
				
			||||||
			fSourceZip.delete();
 | 
					 | 
				
			||||||
		} catch (IOException ex) {
 | 
					 | 
				
			||||||
			ex.printStackTrace();
 | 
					 | 
				
			||||||
			MessageM.sendMessage(
 | 
					 | 
				
			||||||
					null,
 | 
					 | 
				
			||||||
					"%TAG%WThe auto-updater tried to unzip a new update file, but was unsuccessful.");
 | 
					 | 
				
			||||||
			result = Updater.UpdateResult.FAIL_DOWNLOAD;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		new File(file).delete();
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Check if the name of a jar is one of the plugins currently installed,
 | 
					 | 
				
			||||||
	 * used for extracting the correct files out of a zip.
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	public boolean pluginFile(String name) {
 | 
					 | 
				
			||||||
		for (File file : new File("plugins").listFiles()) {
 | 
					 | 
				
			||||||
			if (file.getName().equals(name)) {
 | 
					 | 
				
			||||||
				return true;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		return false;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Obtain the direct download file url from the file's page.
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	private String getFile(String link) {
 | 
					 | 
				
			||||||
		String download = null;
 | 
					 | 
				
			||||||
		try {
 | 
					 | 
				
			||||||
			// Open a connection to the page
 | 
					 | 
				
			||||||
			URL url = new URL(link);
 | 
					 | 
				
			||||||
			URLConnection urlConn = url.openConnection();
 | 
					 | 
				
			||||||
			InputStreamReader inStream = new InputStreamReader(
 | 
					 | 
				
			||||||
					urlConn.getInputStream());
 | 
					 | 
				
			||||||
			BufferedReader buff = new BufferedReader(inStream);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			int counter = 0;
 | 
					 | 
				
			||||||
			String line;
 | 
					 | 
				
			||||||
			while ((line = buff.readLine()) != null) {
 | 
					 | 
				
			||||||
				counter++;
 | 
					 | 
				
			||||||
				// Search for the download link
 | 
					 | 
				
			||||||
				if (line.contains("<li class=\"user-action user-action-download\">")) {
 | 
					 | 
				
			||||||
					// Get the raw link
 | 
					 | 
				
			||||||
					download = line.split("<a href=\"")[1]
 | 
					 | 
				
			||||||
							.split("\">Download</a>")[0];
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				// Search for size
 | 
					 | 
				
			||||||
				else if (line.contains("<dt>Size</dt>")) {
 | 
					 | 
				
			||||||
					sizeLine = counter + 1;
 | 
					 | 
				
			||||||
				} else if (counter == sizeLine) {
 | 
					 | 
				
			||||||
					String size = line.replaceAll("<dd>", "").replaceAll(
 | 
					 | 
				
			||||||
							"</dd>", "");
 | 
					 | 
				
			||||||
					multiplier = size.contains("MiB") ? 1048576 : 1024;
 | 
					 | 
				
			||||||
					size = size.replace(" KiB", "").replace(" MiB", "");
 | 
					 | 
				
			||||||
					totalSize = (long) (Double.parseDouble(size) * multiplier);
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			urlConn = null;
 | 
					 | 
				
			||||||
			inStream = null;
 | 
					 | 
				
			||||||
			buff.close();
 | 
					 | 
				
			||||||
			buff = null;
 | 
					 | 
				
			||||||
		} catch (Exception ex) {
 | 
					 | 
				
			||||||
			ex.printStackTrace();
 | 
					 | 
				
			||||||
			MessageM.sendMessage(null,
 | 
					 | 
				
			||||||
					"%TAG%WThe auto-updater tried to contact dev.bukkit.org, but was unsuccessful.");
 | 
					 | 
				
			||||||
			result = Updater.UpdateResult.FAIL_DBO;
 | 
					 | 
				
			||||||
			return null;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		return download;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Check to see if the program should continue by evaluation whether the
 | 
					 | 
				
			||||||
	 * plugin is already updated, or shouldn't be updated
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	private boolean versionCheck(String title) {
 | 
					 | 
				
			||||||
		if (type != UpdateType.NO_VERSION_CHECK) {
 | 
					 | 
				
			||||||
			String version = plugin.getDescription().getVersion();
 | 
					 | 
				
			||||||
			if (title.split(" v").length == 2) {
 | 
					 | 
				
			||||||
				String remoteVersion = title.split(" v")[1].split(" ")[0]; // Get
 | 
					 | 
				
			||||||
																			// the
 | 
					 | 
				
			||||||
																			// newest
 | 
					 | 
				
			||||||
																			// file's
 | 
					 | 
				
			||||||
																			// version
 | 
					 | 
				
			||||||
																			// number
 | 
					 | 
				
			||||||
				int remVer = -1, curVer = 0;
 | 
					 | 
				
			||||||
				try {
 | 
					 | 
				
			||||||
					remVer = calVer(remoteVersion);
 | 
					 | 
				
			||||||
					curVer = calVer(version);
 | 
					 | 
				
			||||||
				} catch (NumberFormatException nfe) {
 | 
					 | 
				
			||||||
					remVer = -1;
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				if (hasTag(version) || version.equalsIgnoreCase(remoteVersion)
 | 
					 | 
				
			||||||
						|| curVer >= remVer) {
 | 
					 | 
				
			||||||
					// We already have the latest version, or this build is
 | 
					 | 
				
			||||||
					// tagged for no-update
 | 
					 | 
				
			||||||
					result = Updater.UpdateResult.NO_UPDATE;
 | 
					 | 
				
			||||||
					return false;
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				// The file's name did not contain the string 'vVersion'
 | 
					 | 
				
			||||||
				MessageM.sendMessage(null, "%TAG%WThe author of this plugin ("
 | 
					 | 
				
			||||||
						+ plugin.getDescription().getAuthors().get(0)
 | 
					 | 
				
			||||||
						+ ") has misconfigured their Auto Update system");
 | 
					 | 
				
			||||||
				MessageM.sendMessage(
 | 
					 | 
				
			||||||
						null,
 | 
					 | 
				
			||||||
						"%TAG%WFiles uploaded to BukkitDev should contain the version number, seperated from the name by a 'v', such as PluginName v1.0");
 | 
					 | 
				
			||||||
				result = Updater.UpdateResult.FAIL_NOVERSION;
 | 
					 | 
				
			||||||
				return false;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		return true;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Used to calculate the version string as an Integer
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	private Integer calVer(String s) throws NumberFormatException {
 | 
					 | 
				
			||||||
		if (s.contains(".")) {
 | 
					 | 
				
			||||||
			StringBuilder sb = new StringBuilder();
 | 
					 | 
				
			||||||
			for (int i = 0; i < s.length(); i++) {
 | 
					 | 
				
			||||||
				Character c = s.charAt(i);
 | 
					 | 
				
			||||||
				if (Character.isLetterOrDigit(c)) {
 | 
					 | 
				
			||||||
					sb.append(c);
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			return Integer.parseInt(sb.toString());
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		return Integer.parseInt(s);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Evaluate whether the version number is marked showing that it should not
 | 
					 | 
				
			||||||
	 * be updated by this program
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	private boolean hasTag(String version) {
 | 
					 | 
				
			||||||
		for (String string : noUpdateTag) {
 | 
					 | 
				
			||||||
			if (version.contains(string)) {
 | 
					 | 
				
			||||||
				return true;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		return false;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Part of RSS Reader by Vogella, modified by H31IX for use with Bukkit
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	private boolean readFeed() {
 | 
					 | 
				
			||||||
		try {
 | 
					 | 
				
			||||||
			// Set header values intial to the empty string
 | 
					 | 
				
			||||||
			String title = "";
 | 
					 | 
				
			||||||
			String link = "";
 | 
					 | 
				
			||||||
			// First create a new XMLInputFactory
 | 
					 | 
				
			||||||
			XMLInputFactory inputFactory = XMLInputFactory.newInstance();
 | 
					 | 
				
			||||||
			// Setup a new eventReader
 | 
					 | 
				
			||||||
			InputStream in = read();
 | 
					 | 
				
			||||||
			if (in != null) {
 | 
					 | 
				
			||||||
				XMLEventReader eventReader = inputFactory
 | 
					 | 
				
			||||||
						.createXMLEventReader(in);
 | 
					 | 
				
			||||||
				// Read the XML document
 | 
					 | 
				
			||||||
				while (eventReader.hasNext()) {
 | 
					 | 
				
			||||||
					XMLEvent event = eventReader.nextEvent();
 | 
					 | 
				
			||||||
					if (event.isStartElement()) {
 | 
					 | 
				
			||||||
						if (event.asStartElement().getName().getLocalPart()
 | 
					 | 
				
			||||||
								.equals(TITLE)) {
 | 
					 | 
				
			||||||
							event = eventReader.nextEvent();
 | 
					 | 
				
			||||||
							title = event.asCharacters().getData();
 | 
					 | 
				
			||||||
							continue;
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
						if (event.asStartElement().getName().getLocalPart()
 | 
					 | 
				
			||||||
								.equals(LINK)) {
 | 
					 | 
				
			||||||
							event = eventReader.nextEvent();
 | 
					 | 
				
			||||||
							link = event.asCharacters().getData();
 | 
					 | 
				
			||||||
							continue;
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					} else if (event.isEndElement()) {
 | 
					 | 
				
			||||||
						if (event.asEndElement().getName().getLocalPart()
 | 
					 | 
				
			||||||
								.equals(ITEM)) {
 | 
					 | 
				
			||||||
							// Store the title and link of the first entry we
 | 
					 | 
				
			||||||
							// get - the first file on the list is all we need
 | 
					 | 
				
			||||||
							versionTitle = title;
 | 
					 | 
				
			||||||
							versionLink = link;
 | 
					 | 
				
			||||||
							// All done, we don't need to know about older
 | 
					 | 
				
			||||||
							// files.
 | 
					 | 
				
			||||||
							break;
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					}
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				return true;
 | 
					 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				return false;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		} catch (XMLStreamException e) {
 | 
					 | 
				
			||||||
			MessageM.sendMessage(null,
 | 
					 | 
				
			||||||
					"%TAG%WCould not reach dev.bukkit.org for update checking. Is it offline?");
 | 
					 | 
				
			||||||
			return false;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
					 | 
				
			||||||
	 * Open the RSS feed
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	private InputStream read() {
 | 
					 | 
				
			||||||
		try {
 | 
					 | 
				
			||||||
			return url.openStream();
 | 
					 | 
				
			||||||
		} catch (IOException e) {
 | 
					 | 
				
			||||||
			MessageM.sendMessage(
 | 
					 | 
				
			||||||
					null,
 | 
					 | 
				
			||||||
					"%TAG%WCould not reach BukkitDev file stream for update checking. Is dev.bukkit.org offline?");
 | 
					 | 
				
			||||||
			return null;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	private class UpdateRunnable implements Runnable {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		public void run() {
 | 
					 | 
				
			||||||
			if (url != null) {
 | 
					 | 
				
			||||||
				// Obtain the results of the project's file feed
 | 
					 | 
				
			||||||
				if (readFeed()) {
 | 
					 | 
				
			||||||
					if (versionCheck(versionTitle)) {
 | 
					 | 
				
			||||||
						String fileLink = getFile(versionLink);
 | 
					 | 
				
			||||||
						if (fileLink != null && type != UpdateType.NO_DOWNLOAD) {
 | 
					 | 
				
			||||||
							String name = file.getName();
 | 
					 | 
				
			||||||
							// If it's a zip file, it shouldn't be downloaded as
 | 
					 | 
				
			||||||
							// the plugin's name
 | 
					 | 
				
			||||||
							if (fileLink.endsWith(".zip")) {
 | 
					 | 
				
			||||||
								String[] split = fileLink.split("/");
 | 
					 | 
				
			||||||
								name = split[split.length - 1];
 | 
					 | 
				
			||||||
							}
 | 
					 | 
				
			||||||
							saveFile(new File("plugins/" + updateFolder), name,
 | 
					 | 
				
			||||||
									fileLink);
 | 
					 | 
				
			||||||
						} else {
 | 
					 | 
				
			||||||
							result = UpdateResult.UPDATE_AVAILABLE;
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					}
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,651 +0,0 @@
 | 
				
			|||||||
/*
 | 
					 | 
				
			||||||
 * Copyright 2011-2013 Tyler Blair. All rights reserved.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * Redistribution and use in source and binary forms, with or without modification, are
 | 
					 | 
				
			||||||
 * permitted provided that the following conditions are met:
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 *    1. Redistributions of source code must retain the above copyright notice, this list of
 | 
					 | 
				
			||||||
 *       conditions and the following disclaimer.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 *    2. Redistributions in binary form must reproduce the above copyright notice, this list
 | 
					 | 
				
			||||||
 *       of conditions and the following disclaimer in the documentation and/or other materials
 | 
					 | 
				
			||||||
 *       provided with the distribution.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
 | 
					 | 
				
			||||||
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 | 
					 | 
				
			||||||
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
 | 
					 | 
				
			||||||
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
					 | 
				
			||||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 | 
					 | 
				
			||||||
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 | 
					 | 
				
			||||||
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 | 
					 | 
				
			||||||
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 | 
					 | 
				
			||||||
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * The views and conclusions contained in the software and documentation are those of the
 | 
					 | 
				
			||||||
 * authors and contributors and should not be interpreted as representing official policies,
 | 
					 | 
				
			||||||
 * either expressed or implied, of anybody else.
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
package nl.Steffion.BlockHunt.mcstats;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import org.bukkit.Bukkit;
 | 
					 | 
				
			||||||
import org.bukkit.configuration.file.YamlConfiguration;
 | 
					 | 
				
			||||||
import org.bukkit.configuration.InvalidConfigurationException;
 | 
					 | 
				
			||||||
import org.bukkit.plugin.Plugin;
 | 
					 | 
				
			||||||
import org.bukkit.plugin.PluginDescriptionFile;
 | 
					 | 
				
			||||||
import org.bukkit.scheduler.BukkitTask;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import java.io.BufferedReader;
 | 
					 | 
				
			||||||
import java.io.File;
 | 
					 | 
				
			||||||
import java.io.IOException;
 | 
					 | 
				
			||||||
import java.io.InputStreamReader;
 | 
					 | 
				
			||||||
import java.io.OutputStreamWriter;
 | 
					 | 
				
			||||||
import java.io.UnsupportedEncodingException;
 | 
					 | 
				
			||||||
import java.net.Proxy;
 | 
					 | 
				
			||||||
import java.net.URL;
 | 
					 | 
				
			||||||
import java.net.URLConnection;
 | 
					 | 
				
			||||||
import java.net.URLEncoder;
 | 
					 | 
				
			||||||
import java.util.Collections;
 | 
					 | 
				
			||||||
import java.util.HashSet;
 | 
					 | 
				
			||||||
import java.util.Iterator;
 | 
					 | 
				
			||||||
import java.util.LinkedHashSet;
 | 
					 | 
				
			||||||
import java.util.Set;
 | 
					 | 
				
			||||||
import java.util.UUID;
 | 
					 | 
				
			||||||
import java.util.logging.Level;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * <p> The metrics class obtains data about a plugin and submits statistics about it to the metrics backend. </p> <p>
 | 
					 | 
				
			||||||
 * Public methods provided by this class: </p>
 | 
					 | 
				
			||||||
 * <code>
 | 
					 | 
				
			||||||
 * Graph createGraph(String name); <br/>
 | 
					 | 
				
			||||||
 * void addCustomData(BukkitMetrics.Plotter plotter); <br/>
 | 
					 | 
				
			||||||
 * void start(); <br/>
 | 
					 | 
				
			||||||
 * </code>
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
public class Metrics {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * The current revision number
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private final static int REVISION = 6;
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * The base url of the metrics domain
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private static final String BASE_URL = "http://mcstats.org";
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * The url used to report a server's status
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private static final String REPORT_URL = "/report/%s";
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * The separator to use for custom data. This MUST NOT change unless you are hosting your own version of metrics and
 | 
					 | 
				
			||||||
     * want to change it.
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private static final String CUSTOM_DATA_SEPARATOR = "~~";
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Interval of time to ping (in minutes)
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private static final int PING_INTERVAL = 10;
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * The plugin this metrics submits for
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private final Plugin plugin;
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * All of the custom graphs to submit to metrics
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private final Set<Graph> graphs = Collections.synchronizedSet(new HashSet<Graph>());
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * The default graph, used for addCustomData when you don't want a specific graph
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private final Graph defaultGraph = new Graph("Default");
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * The plugin configuration file
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public final YamlConfiguration configuration;
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * The plugin configuration file
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private final File configurationFile;
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Unique server id
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private final String guid;
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Debug mode
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private final boolean debug;
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Lock for synchronization
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private final Object optOutLock = new Object();
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * The scheduled task
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private volatile BukkitTask task = null;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public Metrics(final Plugin plugin) throws IOException {
 | 
					 | 
				
			||||||
        if (plugin == null) {
 | 
					 | 
				
			||||||
            throw new IllegalArgumentException("Plugin cannot be null");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        this.plugin = plugin;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // load the config
 | 
					 | 
				
			||||||
        configurationFile = getConfigFile();
 | 
					 | 
				
			||||||
        configuration = YamlConfiguration.loadConfiguration(configurationFile);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // add some defaults
 | 
					 | 
				
			||||||
        configuration.addDefault("opt-out", false);
 | 
					 | 
				
			||||||
        configuration.addDefault("guid", UUID.randomUUID().toString());
 | 
					 | 
				
			||||||
        configuration.addDefault("debug", false);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Do we need to create the file?
 | 
					 | 
				
			||||||
        if (configuration.get("guid", null) == null) {
 | 
					 | 
				
			||||||
            configuration.options().header("http://mcstats.org").copyDefaults(true);
 | 
					 | 
				
			||||||
            configuration.save(configurationFile);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Load the guid then
 | 
					 | 
				
			||||||
        guid = configuration.getString("guid");
 | 
					 | 
				
			||||||
        debug = configuration.getBoolean("debug", false);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics
 | 
					 | 
				
			||||||
     * website. Plotters can be added to the graph object returned.
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @param name The name of the graph
 | 
					 | 
				
			||||||
     * @return Graph object created. Will never return NULL under normal circumstances unless bad parameters are given
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public Graph createGraph(final String name) {
 | 
					 | 
				
			||||||
        if (name == null) {
 | 
					 | 
				
			||||||
            throw new IllegalArgumentException("Graph name cannot be null");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Construct the graph object
 | 
					 | 
				
			||||||
        final Graph graph = new Graph(name);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Now we can add our graph
 | 
					 | 
				
			||||||
        graphs.add(graph);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // and return back
 | 
					 | 
				
			||||||
        return graph;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Add a Graph object to BukkitMetrics that represents data for the plugin that should be sent to the backend
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @param graph The name of the graph
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public void addGraph(final Graph graph) {
 | 
					 | 
				
			||||||
        if (graph == null) {
 | 
					 | 
				
			||||||
            throw new IllegalArgumentException("Graph cannot be null");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        graphs.add(graph);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Adds a custom data plotter to the default graph
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @param plotter The plotter to use to plot custom data
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public void addCustomData(final Plotter plotter) {
 | 
					 | 
				
			||||||
        if (plotter == null) {
 | 
					 | 
				
			||||||
            throw new IllegalArgumentException("Plotter cannot be null");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Add the plotter to the graph o/
 | 
					 | 
				
			||||||
        defaultGraph.addPlotter(plotter);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Ensure the default graph is included in the submitted graphs
 | 
					 | 
				
			||||||
        graphs.add(defaultGraph);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Start measuring statistics. This will immediately create an async repeating task as the plugin and send the
 | 
					 | 
				
			||||||
     * initial data to the metrics backend, and then after that it will post in increments of PING_INTERVAL * 1200
 | 
					 | 
				
			||||||
     * ticks.
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @return True if statistics measuring is running, otherwise false.
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public boolean start() {
 | 
					 | 
				
			||||||
        synchronized (optOutLock) {
 | 
					 | 
				
			||||||
            // Did we opt out?
 | 
					 | 
				
			||||||
            if (isOptOut()) {
 | 
					 | 
				
			||||||
                return false;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            // Is metrics already running?
 | 
					 | 
				
			||||||
            if (task != null) {
 | 
					 | 
				
			||||||
                return true;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            // Begin hitting the server with glorious data
 | 
					 | 
				
			||||||
            task = plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, new Runnable() {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                private boolean firstPost = true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                public void run() {
 | 
					 | 
				
			||||||
                    try {
 | 
					 | 
				
			||||||
                        // This has to be synchronized or it can collide with the disable method.
 | 
					 | 
				
			||||||
                        synchronized (optOutLock) {
 | 
					 | 
				
			||||||
                            // Disable Task, if it is running and the server owner decided to opt-out
 | 
					 | 
				
			||||||
                            if (isOptOut() && task != null) {
 | 
					 | 
				
			||||||
                                task.cancel();
 | 
					 | 
				
			||||||
                                task = null;
 | 
					 | 
				
			||||||
                                // Tell all plotters to stop gathering information.
 | 
					 | 
				
			||||||
                                for (Graph graph : graphs) {
 | 
					 | 
				
			||||||
                                    graph.onOptOut();
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        // We use the inverse of firstPost because if it is the first time we are posting,
 | 
					 | 
				
			||||||
                        // it is not a interval ping, so it evaluates to FALSE
 | 
					 | 
				
			||||||
                        // Each time thereafter it will evaluate to TRUE, i.e PING!
 | 
					 | 
				
			||||||
                        postPlugin(!firstPost);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        // After the first post we set firstPost to false
 | 
					 | 
				
			||||||
                        // Each post thereafter will be a ping
 | 
					 | 
				
			||||||
                        firstPost = false;
 | 
					 | 
				
			||||||
                    } catch (IOException e) {
 | 
					 | 
				
			||||||
                        if (debug) {
 | 
					 | 
				
			||||||
                            Bukkit.getLogger().log(Level.INFO, "[Metrics] " + e.getMessage());
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }, 0, PING_INTERVAL * 1200);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            return true;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Has the server owner denied plugin metrics?
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @return true if metrics should be opted out of it
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public boolean isOptOut() {
 | 
					 | 
				
			||||||
        synchronized (optOutLock) {
 | 
					 | 
				
			||||||
            try {
 | 
					 | 
				
			||||||
                // Reload the metrics file
 | 
					 | 
				
			||||||
                configuration.load(getConfigFile());
 | 
					 | 
				
			||||||
            } catch (IOException ex) {
 | 
					 | 
				
			||||||
                if (debug) {
 | 
					 | 
				
			||||||
                    Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                return true;
 | 
					 | 
				
			||||||
            } catch (InvalidConfigurationException ex) {
 | 
					 | 
				
			||||||
                if (debug) {
 | 
					 | 
				
			||||||
                    Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                return true;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return configuration.getBoolean("opt-out", false);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Enables metrics for the server by setting "opt-out" to false in the config file and starting the metrics task.
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @throws java.io.IOException
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public void enable() throws IOException {
 | 
					 | 
				
			||||||
        // This has to be synchronized or it can collide with the check in the task.
 | 
					 | 
				
			||||||
        synchronized (optOutLock) {
 | 
					 | 
				
			||||||
            // Check if the server owner has already set opt-out, if not, set it.
 | 
					 | 
				
			||||||
            if (isOptOut()) {
 | 
					 | 
				
			||||||
                configuration.set("opt-out", false);
 | 
					 | 
				
			||||||
                configuration.save(configurationFile);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            // Enable Task, if it is not running
 | 
					 | 
				
			||||||
            if (task == null) {
 | 
					 | 
				
			||||||
                start();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Disables metrics for the server by setting "opt-out" to true in the config file and canceling the metrics task.
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @throws java.io.IOException
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public void disable() throws IOException {
 | 
					 | 
				
			||||||
        // This has to be synchronized or it can collide with the check in the task.
 | 
					 | 
				
			||||||
        synchronized (optOutLock) {
 | 
					 | 
				
			||||||
            // Check if the server owner has already set opt-out, if not, set it.
 | 
					 | 
				
			||||||
            if (!isOptOut()) {
 | 
					 | 
				
			||||||
                configuration.set("opt-out", true);
 | 
					 | 
				
			||||||
                configuration.save(configurationFile);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            // Disable Task, if it is running
 | 
					 | 
				
			||||||
            if (task != null) {
 | 
					 | 
				
			||||||
                task.cancel();
 | 
					 | 
				
			||||||
                task = null;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Gets the File object of the config file that should be used to store data such as the GUID and opt-out status
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @return the File object for the config file
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public File getConfigFile() {
 | 
					 | 
				
			||||||
        // I believe the easiest way to get the base folder (e.g craftbukkit set via -P) for plugins to use
 | 
					 | 
				
			||||||
        // is to abuse the plugin object we already have
 | 
					 | 
				
			||||||
        // plugin.getDataFolder() => base/plugins/PluginA/
 | 
					 | 
				
			||||||
        // pluginsFolder => base/plugins/
 | 
					 | 
				
			||||||
        // The base is not necessarily relative to the startup directory.
 | 
					 | 
				
			||||||
        File pluginsFolder = plugin.getDataFolder().getParentFile();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // return => base/plugins/PluginMetrics/config.yml
 | 
					 | 
				
			||||||
        return new File(new File(pluginsFolder, "PluginMetrics"), "config.yml");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Generic method that posts a plugin to the metrics website
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private void postPlugin(final boolean isPing) throws IOException {
 | 
					 | 
				
			||||||
        // Server software specific section
 | 
					 | 
				
			||||||
        PluginDescriptionFile description = plugin.getDescription();
 | 
					 | 
				
			||||||
        String pluginName = description.getName();
 | 
					 | 
				
			||||||
        boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
 | 
					 | 
				
			||||||
        String pluginVersion = description.getVersion();
 | 
					 | 
				
			||||||
        String serverVersion = Bukkit.getVersion();
 | 
					 | 
				
			||||||
        int playersOnline = Bukkit.getServer().getOnlinePlayers().length;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // END server software specific section -- all code below does not use any code outside of this class / Java
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Construct the post data
 | 
					 | 
				
			||||||
        final StringBuilder data = new StringBuilder();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // The plugin's description file containg all of the plugin data such as name, version, author, etc
 | 
					 | 
				
			||||||
        data.append(encode("guid")).append('=').append(encode(guid));
 | 
					 | 
				
			||||||
        encodeDataPair(data, "version", pluginVersion);
 | 
					 | 
				
			||||||
        encodeDataPair(data, "server", serverVersion);
 | 
					 | 
				
			||||||
        encodeDataPair(data, "players", Integer.toString(playersOnline));
 | 
					 | 
				
			||||||
        encodeDataPair(data, "revision", String.valueOf(REVISION));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // New data as of R6
 | 
					 | 
				
			||||||
        String osname = System.getProperty("os.name");
 | 
					 | 
				
			||||||
        String osarch = System.getProperty("os.arch");
 | 
					 | 
				
			||||||
        String osversion = System.getProperty("os.version");
 | 
					 | 
				
			||||||
        String java_version = System.getProperty("java.version");
 | 
					 | 
				
			||||||
        int coreCount = Runtime.getRuntime().availableProcessors();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // normalize os arch .. amd64 -> x86_64
 | 
					 | 
				
			||||||
        if (osarch.equals("amd64")) {
 | 
					 | 
				
			||||||
            osarch = "x86_64";
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        encodeDataPair(data, "osname", osname);
 | 
					 | 
				
			||||||
        encodeDataPair(data, "osarch", osarch);
 | 
					 | 
				
			||||||
        encodeDataPair(data, "osversion", osversion);
 | 
					 | 
				
			||||||
        encodeDataPair(data, "cores", Integer.toString(coreCount));
 | 
					 | 
				
			||||||
        encodeDataPair(data, "online-mode", Boolean.toString(onlineMode));
 | 
					 | 
				
			||||||
        encodeDataPair(data, "java_version", java_version);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // If we're pinging, append it
 | 
					 | 
				
			||||||
        if (isPing) {
 | 
					 | 
				
			||||||
            encodeDataPair(data, "ping", "true");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Acquire a lock on the graphs, which lets us make the assumption we also lock everything
 | 
					 | 
				
			||||||
        // inside of the graph (e.g plotters)
 | 
					 | 
				
			||||||
        synchronized (graphs) {
 | 
					 | 
				
			||||||
            final Iterator<Graph> iter = graphs.iterator();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            while (iter.hasNext()) {
 | 
					 | 
				
			||||||
                final Graph graph = iter.next();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                for (Plotter plotter : graph.getPlotters()) {
 | 
					 | 
				
			||||||
                    // The key name to send to the metrics server
 | 
					 | 
				
			||||||
                    // The format is C-GRAPHNAME-PLOTTERNAME where separator - is defined at the top
 | 
					 | 
				
			||||||
                    // Legacy (R4) submitters use the format Custom%s, or CustomPLOTTERNAME
 | 
					 | 
				
			||||||
                    final String key = String.format("C%s%s%s%s", CUSTOM_DATA_SEPARATOR, graph.getName(), CUSTOM_DATA_SEPARATOR, plotter.getColumnName());
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    // The value to send, which for the foreseeable future is just the string
 | 
					 | 
				
			||||||
                    // value of plotter.getValue()
 | 
					 | 
				
			||||||
                    final String value = Integer.toString(plotter.getValue());
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    // Add it to the http post data :)
 | 
					 | 
				
			||||||
                    encodeDataPair(data, key, value);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Create the url
 | 
					 | 
				
			||||||
        URL url = new URL(BASE_URL + String.format(REPORT_URL, encode(pluginName)));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Connect to the website
 | 
					 | 
				
			||||||
        URLConnection connection;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Mineshafter creates a socks proxy, so we can safely bypass it
 | 
					 | 
				
			||||||
        // It does not reroute POST requests so we need to go around it
 | 
					 | 
				
			||||||
        if (isMineshafterPresent()) {
 | 
					 | 
				
			||||||
            connection = url.openConnection(Proxy.NO_PROXY);
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            connection = url.openConnection();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        connection.setDoOutput(true);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Write the data
 | 
					 | 
				
			||||||
        final OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
 | 
					 | 
				
			||||||
        writer.write(data.toString());
 | 
					 | 
				
			||||||
        writer.flush();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Now read the response
 | 
					 | 
				
			||||||
        final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
 | 
					 | 
				
			||||||
        final String response = reader.readLine();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // close resources
 | 
					 | 
				
			||||||
        writer.close();
 | 
					 | 
				
			||||||
        reader.close();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (response == null || response.startsWith("ERR")) {
 | 
					 | 
				
			||||||
            throw new IOException(response); //Throw the exception
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            // Is this the first update this hour?
 | 
					 | 
				
			||||||
            if (response.contains("OK This is your first update this hour")) {
 | 
					 | 
				
			||||||
                synchronized (graphs) {
 | 
					 | 
				
			||||||
                    final Iterator<Graph> iter = graphs.iterator();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    while (iter.hasNext()) {
 | 
					 | 
				
			||||||
                        final Graph graph = iter.next();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        for (Plotter plotter : graph.getPlotters()) {
 | 
					 | 
				
			||||||
                            plotter.reset();
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Check if mineshafter is present. If it is, we need to bypass it to send POST requests
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @return true if mineshafter is installed on the server
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private boolean isMineshafterPresent() {
 | 
					 | 
				
			||||||
        try {
 | 
					 | 
				
			||||||
            Class.forName("mineshafter.MineServer");
 | 
					 | 
				
			||||||
            return true;
 | 
					 | 
				
			||||||
        } catch (Exception e) {
 | 
					 | 
				
			||||||
            return false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * <p>Encode a key/value data pair to be used in a HTTP post request. This INCLUDES a & so the first key/value pair
 | 
					 | 
				
			||||||
     * MUST be included manually, e.g:</p>
 | 
					 | 
				
			||||||
     * <code>
 | 
					 | 
				
			||||||
     * StringBuffer data = new StringBuffer();
 | 
					 | 
				
			||||||
     * data.append(encode("guid")).append('=').append(encode(guid));
 | 
					 | 
				
			||||||
     * encodeDataPair(data, "version", description.getVersion());
 | 
					 | 
				
			||||||
     * </code>
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @param buffer the stringbuilder to append the data pair onto
 | 
					 | 
				
			||||||
     * @param key the key value
 | 
					 | 
				
			||||||
     * @param value the value
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private static void encodeDataPair(final StringBuilder buffer, final String key, final String value) throws UnsupportedEncodingException {
 | 
					 | 
				
			||||||
        buffer.append('&').append(encode(key)).append('=').append(encode(value));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Encode text as UTF-8
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @param text the text to encode
 | 
					 | 
				
			||||||
     * @return the encoded text, as UTF-8
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    private static String encode(final String text) throws UnsupportedEncodingException {
 | 
					 | 
				
			||||||
        return URLEncoder.encode(text, "UTF-8");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Represents a custom graph on the website
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public static class Graph {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * The graph's name, alphanumeric and spaces only :) If it does not comply to the above when submitted, it is
 | 
					 | 
				
			||||||
         * rejected
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        private final String name;
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * The set of plotters that are contained within this graph
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        private final Set<Plotter> plotters = new LinkedHashSet<Plotter>();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        private Graph(final String name) {
 | 
					 | 
				
			||||||
            this.name = name;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * Gets the graph's name
 | 
					 | 
				
			||||||
         *
 | 
					 | 
				
			||||||
         * @return the Graph's name
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        public String getName() {
 | 
					 | 
				
			||||||
            return name;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * Add a plotter to the graph, which will be used to plot entries
 | 
					 | 
				
			||||||
         *
 | 
					 | 
				
			||||||
         * @param plotter the plotter to add to the graph
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        public void addPlotter(final Plotter plotter) {
 | 
					 | 
				
			||||||
            plotters.add(plotter);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * Remove a plotter from the graph
 | 
					 | 
				
			||||||
         *
 | 
					 | 
				
			||||||
         * @param plotter the plotter to remove from the graph
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        public void removePlotter(final Plotter plotter) {
 | 
					 | 
				
			||||||
            plotters.remove(plotter);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * Gets an <b>unmodifiable</b> set of the plotter objects in the graph
 | 
					 | 
				
			||||||
         *
 | 
					 | 
				
			||||||
         * @return an unmodifiable {@link java.util.Set} of the plotter objects
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        public Set<Plotter> getPlotters() {
 | 
					 | 
				
			||||||
            return Collections.unmodifiableSet(plotters);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        @Override
 | 
					 | 
				
			||||||
        public int hashCode() {
 | 
					 | 
				
			||||||
            return name.hashCode();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        @Override
 | 
					 | 
				
			||||||
        public boolean equals(final Object object) {
 | 
					 | 
				
			||||||
            if (!(object instanceof Graph)) {
 | 
					 | 
				
			||||||
                return false;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            final Graph graph = (Graph) object;
 | 
					 | 
				
			||||||
            return graph.name.equals(name);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * Called when the server owner decides to opt-out of BukkitMetrics while the server is running.
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        protected void onOptOut() {
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Interface used to collect custom data for a plugin
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public static abstract class Plotter {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * The plot's name
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        private final String name;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * Construct a plotter with the default plot name
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        public Plotter() {
 | 
					 | 
				
			||||||
            this("Default");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * Construct a plotter with a specific plot name
 | 
					 | 
				
			||||||
         *
 | 
					 | 
				
			||||||
         * @param name the name of the plotter to use, which will show up on the website
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        public Plotter(final String name) {
 | 
					 | 
				
			||||||
            this.name = name;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * Get the current value for the plotted point. Since this function defers to an external function it may or may
 | 
					 | 
				
			||||||
         * not return immediately thus cannot be guaranteed to be thread friendly or safe. This function can be called
 | 
					 | 
				
			||||||
         * from any thread so care should be taken when accessing resources that need to be synchronized.
 | 
					 | 
				
			||||||
         *
 | 
					 | 
				
			||||||
         * @return the current value for the point to be plotted.
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        public abstract int getValue();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * Get the column name for the plotted point
 | 
					 | 
				
			||||||
         *
 | 
					 | 
				
			||||||
         * @return the plotted point's column name
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        public String getColumnName() {
 | 
					 | 
				
			||||||
            return name;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					 | 
				
			||||||
         * Called after the website graphs have been updated
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        public void reset() {
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        @Override
 | 
					 | 
				
			||||||
        public int hashCode() {
 | 
					 | 
				
			||||||
            return getColumnName().hashCode();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        @Override
 | 
					 | 
				
			||||||
        public boolean equals(final Object object) {
 | 
					 | 
				
			||||||
            if (!(object instanceof Plotter)) {
 | 
					 | 
				
			||||||
                return false;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            final Plotter plotter = (Plotter) object;
 | 
					 | 
				
			||||||
            return plotter.name.equals(name) && plotter.getValue() == getValue();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user