Restructure for redevelopment
(cherry picked from commit 37b9b14)
This commit is contained in:
		
							
								
								
									
										22
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								pom.xml
									
									
									
									
									
								
							| @@ -76,16 +76,24 @@ | |||||||
|   <build> |   <build> | ||||||
|     <resources> |     <resources> | ||||||
|       <resource> |       <resource> | ||||||
|         <targetPath>.</targetPath> |           <targetPath>.</targetPath> | ||||||
|         <filtering>true</filtering> |           <filtering>true</filtering> | ||||||
|         <directory>${basedir}/src</directory> |           <directory>${basedir}/src/main/resources</directory> | ||||||
|         <includes> |           <includes> | ||||||
|           <include>plugin.yml</include> |               <include>*.yml</include> | ||||||
|         </includes> |           </includes> | ||||||
|       </resource> |       </resource> | ||||||
|  |         <resource> | ||||||
|  |             <targetPath>.</targetPath> | ||||||
|  |             <directory>src/main/resources/lang</directory> | ||||||
|  |             <filtering>false</filtering> | ||||||
|  |             <includes> | ||||||
|  |                 <include>*.properties</include> | ||||||
|  |             </includes> | ||||||
|  |         </resource> | ||||||
|     </resources> |     </resources> | ||||||
|  |  | ||||||
|     <sourceDirectory>src</sourceDirectory> |     <sourceDirectory>src/main/java</sourceDirectory> | ||||||
|     <plugins> |     <plugins> | ||||||
|       <plugin> |       <plugin> | ||||||
|         <groupId>org.apache.maven.plugins</groupId> |         <groupId>org.apache.maven.plugins</groupId> | ||||||
|   | |||||||
| @@ -5,10 +5,9 @@ import java.util.HashMap; | |||||||
| import java.util.List; | import java.util.List; | ||||||
| import java.util.Map; | import java.util.Map; | ||||||
| 
 | 
 | ||||||
| import nl.Steffion.BlockHunt.Serializables.LocationSerializable; |  | ||||||
| import nl.Steffion.BlockHunt.Serializables.M; |  | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
|  | import org.bukkit.Location; | ||||||
| import org.bukkit.configuration.serialization.ConfigurationSerializable; | import org.bukkit.configuration.serialization.ConfigurationSerializable; | ||||||
| import org.bukkit.configuration.serialization.SerializableAs; | import org.bukkit.configuration.serialization.SerializableAs; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -18,8 +17,8 @@ import org.bukkit.scoreboard.Scoreboard; | |||||||
| @SerializableAs("BlockHuntArena") | @SerializableAs("BlockHuntArena") | ||||||
| public class Arena implements ConfigurationSerializable { | public class Arena implements ConfigurationSerializable { | ||||||
| 	public String arenaName; | 	public String arenaName; | ||||||
| 	public LocationSerializable pos1; | 	public Location pos1; | ||||||
| 	public LocationSerializable pos2; | 	public Location pos2; | ||||||
| 	public int maxPlayers; | 	public int maxPlayers; | ||||||
| 	public int minPlayers; | 	public int minPlayers; | ||||||
| 	public int amountSeekersOnStart; | 	public int amountSeekersOnStart; | ||||||
| @@ -34,10 +33,10 @@ public class Arena implements ConfigurationSerializable { | |||||||
| 	public boolean seekersTakeFallDamage; | 	public boolean seekersTakeFallDamage; | ||||||
| 	public boolean hidersTakeFallDamage; | 	public boolean hidersTakeFallDamage; | ||||||
| 	public ArrayList<ItemStack> disguiseBlocks; | 	public ArrayList<ItemStack> disguiseBlocks; | ||||||
| 	public LocationSerializable lobbyWarp; | 	public Location lobbyWarp; | ||||||
| 	public LocationSerializable hidersWarp; | 	public Location hidersWarp; | ||||||
| 	public LocationSerializable seekersWarp; | 	public Location seekersWarp; | ||||||
| 	public LocationSerializable spawnWarp; | 	public Location spawnWarp; | ||||||
| 	public List<String> seekersWinCommands; | 	public List<String> seekersWinCommands; | ||||||
| 	public List<String> hidersWinCommands; | 	public List<String> hidersWinCommands; | ||||||
| 	public List<String> allowedCommands; | 	public List<String> allowedCommands; | ||||||
| @@ -51,10 +50,10 @@ 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, LocationSerializable pos2, int maxPlayers, int minPlayers, int amountSeekersOnStart, | 	public Arena(String arenaName, Location pos1, Location pos2, int maxPlayers, int minPlayers, int amountSeekersOnStart, | ||||||
| 			int timeInLobbyUntilStart, int waitingTimeSeeker, int gameTime, int timeUntilHidersSword, int blockAnnouncerTime, | 			int timeInLobbyUntilStart, int waitingTimeSeeker, int gameTime, int timeUntilHidersSword, int blockAnnouncerTime, | ||||||
| 			boolean seekersCanHurtSeekers, boolean hidersCanHurtSeekers, boolean hidersCanHurtHiders, boolean seekersTakeFallDamage, boolean hidersTakeFallDamage, | 			boolean seekersCanHurtSeekers, boolean hidersCanHurtSeekers, boolean hidersCanHurtHiders, boolean seekersTakeFallDamage, boolean hidersTakeFallDamage, | ||||||
| 			ArrayList<ItemStack> disguiseBlocks, LocationSerializable lobbyWarp, LocationSerializable hidersWarp, LocationSerializable seekersWarp, LocationSerializable spawnWarp, | 			ArrayList<ItemStack> disguiseBlocks, Location lobbyWarp, Location hidersWarp, Location seekersWarp, Location spawnWarp, | ||||||
| 			List<String> seekersWinCommands, List<String> hidersWinCommands, List<String> allowedCommands, int seekersTokenWin, int hidersTokenWin, int killTokens, | 			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) { | 			List<Player> playersInArena, ArenaState gameState, int timer, List<Player> seekers, Scoreboard scoreboard) { | ||||||
| 		this.arenaName = arenaName; | 		this.arenaName = arenaName; | ||||||
| @@ -68,6 +67,11 @@ public class Arena implements ConfigurationSerializable { | |||||||
| 		this.gameTime = gameTime; | 		this.gameTime = gameTime; | ||||||
| 		this.timeUntilHidersSword = timeUntilHidersSword; | 		this.timeUntilHidersSword = timeUntilHidersSword; | ||||||
| 		this.blockAnnouncerTime = blockAnnouncerTime; | 		this.blockAnnouncerTime = blockAnnouncerTime; | ||||||
|  | 		this.seekersCanHurtSeekers = seekersCanHurtSeekers; | ||||||
|  | 		this.hidersCanHurtHiders = hidersCanHurtHiders; | ||||||
|  | 		this.hidersCanHurtSeekers = hidersCanHurtSeekers; | ||||||
|  | 		this.seekersTakeFallDamage = seekersTakeFallDamage; | ||||||
|  | 		this.hidersTakeFallDamage = hidersTakeFallDamage; | ||||||
| 		this.disguiseBlocks = disguiseBlocks; | 		this.disguiseBlocks = disguiseBlocks; | ||||||
| 		this.lobbyWarp = lobbyWarp; | 		this.lobbyWarp = lobbyWarp; | ||||||
| 		this.hidersWarp = hidersWarp; | 		this.hidersWarp = hidersWarp; | ||||||
| @@ -139,15 +143,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(Bukkit.getWorld("world"), 0, 0, 0, 0, 0); |         Location loc = new Location(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) map.getOrDefault("arenaName", "UNKNOWN_NAME"), (Location) map.getOrDefault("pos1", loc), (Location) map.getOrDefault( "pos2", loc), | ||||||
| 				(Integer) M.g(map, "maxPlayers", 12), (Integer) M.g(map, "minPlayers", 3), (Integer) M.g(map, "amountSeekersOnStart", 1), (Integer) M.g(map, "timeInLobbyUntilStart", 90), | 				(Integer) map.getOrDefault( "maxPlayers", 12), (Integer) map.getOrDefault( "minPlayers", 3), (Integer) map.getOrDefault( "amountSeekersOnStart", 1), (Integer) map.getOrDefault( "timeInLobbyUntilStart", 90), | ||||||
| 				(Integer) M.g(map, "waitingTimeSeeker", 20), (Integer) M.g(map, "gameTime", 200), (Integer) M.g(map, "timeUntilHidersSword", 30),(Integer) M.g(map, "blockAnnouncerTime", 45), | 				(Integer) map.getOrDefault( "waitingTimeSeeker", 20), (Integer) map.getOrDefault( "gameTime", 200), (Integer) map.getOrDefault( "timeUntilHidersSword", 30),(Integer) map.getOrDefault( "blockAnnouncerTime", 45), | ||||||
| 				(Boolean) M.g(map, "seekersCanHurtSeekers", false),(Boolean) M.g(map, "hidersCanHurtSeekers", false),(Boolean) M.g(map, "hidersCanHurtHiders", false),(Boolean) M.g(map, "seekersTakeFallDamage", false),(Boolean) M.g(map, "hidersTakeFallDamage", false), | 				(Boolean) map.getOrDefault( "seekersCanHurtSeekers", false),(Boolean) map.getOrDefault( "hidersCanHurtSeekers", false),(Boolean) map.getOrDefault( "hidersCanHurtHiders", false),(Boolean) map.getOrDefault( "seekersTakeFallDamage", false),(Boolean) map.getOrDefault( "hidersTakeFallDamage", false), | ||||||
| 				(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), | 				(ArrayList<ItemStack>) map.getOrDefault( "disguiseBlocks", new ArrayList<ItemStack>()),(Location) map.getOrDefault( "lobbyWarp", loc), (Location) map.getOrDefault( "hidersWarp", loc), (Location) map.getOrDefault( "seekersWarp", loc), | ||||||
| 				(LocationSerializable) M.g(map, "spawnWarp", loc), (ArrayList<String>) M.g(map, "seekersWinCommands", new ArrayList<String>()), | 				(Location) map.getOrDefault( "spawnWarp", loc), (ArrayList<String>) map.getOrDefault( "seekersWinCommands", new ArrayList<String>()), | ||||||
| 				(ArrayList<String>) M.g(map, "hidersWinCommands", new ArrayList<String>()), (ArrayList<String>) M.g(map, "allowedCommands", new ArrayList<String>()), | 				(ArrayList<String>) map.getOrDefault("hidersWinCommands", new ArrayList<String>()), (ArrayList<String>) map.getOrDefault( "allowedCommands", new ArrayList<String>()), | ||||||
| 				(Integer) M.g(map, "seekersTokenWin", 10), (Integer) M.g(map, "hidersTokenWin", 50), (Integer) M.g(map, "killTokens", 8), new ArrayList<>(), | 				(Integer) map.getOrDefault( "seekersTokenWin", 10), (Integer) map.getOrDefault( "hidersTokenWin", 50), (Integer) map.getOrDefault( "killTokens", 8), new ArrayList<>(), | ||||||
| 				ArenaState.WAITING, 0, new ArrayList<>(), Bukkit.getScoreboardManager().getNewScoreboard()); | 				ArenaState.WAITING, 0, new ArrayList<>(), Bukkit.getScoreboardManager().getNewScoreboard()); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @@ -9,14 +9,10 @@ import nl.Steffion.BlockHunt.Events.EndArenaEvent; | |||||||
| import nl.Steffion.BlockHunt.Events.JoinArenaEvent; | import nl.Steffion.BlockHunt.Events.JoinArenaEvent; | ||||||
| import nl.Steffion.BlockHunt.Events.LeaveArenaEvent; | import nl.Steffion.BlockHunt.Events.LeaveArenaEvent; | ||||||
| import nl.Steffion.BlockHunt.PermissionsC.Permissions; | import nl.Steffion.BlockHunt.PermissionsC.Permissions; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| import nl.Steffion.BlockHunt.Managers.PermissionsM; | import nl.Steffion.BlockHunt.Managers.PermissionsManager; | ||||||
| import nl.Steffion.BlockHunt.Serializables.LocationSerializable; |  | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.*; | ||||||
| import org.bukkit.GameMode; |  | ||||||
| import org.bukkit.Material; |  | ||||||
| import org.bukkit.Sound; |  | ||||||
| import org.bukkit.attribute.Attribute; | import org.bukkit.attribute.Attribute; | ||||||
| import org.bukkit.block.Block; | import org.bukkit.block.Block; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -39,14 +35,14 @@ public class ArenaHandler { | |||||||
| 	public static void sendMessage(Arena arena, String message, String... vars) { | 	public static void sendMessage(Arena arena, String message, String... vars) { | ||||||
| 		for (Player player : arena.playersInArena) { | 		for (Player player : arena.playersInArena) { | ||||||
| 			String pMessage = message.replaceAll("%player%", player.getDisplayName()); | 			String pMessage = message.replaceAll("%player%", player.getDisplayName()); | ||||||
| 			player.sendMessage(MessageM.replaceAll(pMessage, vars)); | 			player.sendMessage(MessageManager.replaceAll(pMessage, vars)); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	public static void sendFMessage(Arena arena, ConfigC location, String... vars) { | 	public static void sendFMessage(Arena arena, ConfigC location, String... vars) { | ||||||
| 		for (Player player : arena.playersInArena) { | 		for (Player player : arena.playersInArena) { | ||||||
| 			String pMessage = location.config.getFile().get(location.location).toString().replaceAll("%player%", player.getDisplayName()); | 			String pMessage = location.config.getFile().get(location.location).toString().replaceAll("%player%", player.getDisplayName()); | ||||||
| 			player.sendMessage(MessageM.replaceAll(pMessage, vars)); | 			player.sendMessage(MessageManager.replaceAll(pMessage, vars)); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| @@ -66,7 +62,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, ConfigC.error_joinNoBlocksSet); | 						MessageManager.sendFMessage(player, ConfigC.error_joinNoBlocksSet); | ||||||
| 					} else { | 					} else { | ||||||
| 						boolean inventoryempty = true; | 						boolean inventoryempty = true; | ||||||
| 						for (ItemStack invitem : player.getInventory()) { | 						for (ItemStack invitem : player.getInventory()) { | ||||||
| @@ -86,17 +82,17 @@ public class ArenaHandler { | |||||||
| 						} | 						} | ||||||
| 
 | 
 | ||||||
| 						if ((Boolean) W.config.get(ConfigC.requireInventoryClearOnJoin) && !inventoryempty) { | 						if ((Boolean) W.config.get(ConfigC.requireInventoryClearOnJoin) && !inventoryempty) { | ||||||
| 							MessageM.sendFMessage(player, ConfigC.error_joinInventoryNotEmpty); | 							MessageManager.sendFMessage(player, ConfigC.error_joinInventoryNotEmpty); | ||||||
| 							return; | 							return; | ||||||
| 						} | 						} | ||||||
| 
 | 
 | ||||||
| 						LocationSerializable zero = new LocationSerializable(Bukkit.getWorld(player.getWorld().getName()), 0, 0, 0, 0, 0); | 						Location zero = new Location(Bukkit.getWorld(player.getWorld().getName()), 0, 0, 0, 0, 0); | ||||||
| 						if (arena.lobbyWarp != null && arena.hidersWarp != null && arena.seekersWarp != null && arena.spawnWarp != null) { | 						if (arena.lobbyWarp != null && arena.hidersWarp != null && 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.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.gameState == ArenaState.WAITING || arena.gameState == ArenaState.STARTING) { | ||||||
| 									if (arena.playersInArena.size() >= arena.maxPlayers) { | 									if (arena.playersInArena.size() >= arena.maxPlayers) { | ||||||
| 										if (!PermissionsM.hasPerm(player, Permissions.joinfull, false)) { | 										if (!PermissionsManager.hasPerm(player, Permissions.joinfull, false)) { | ||||||
| 											MessageM.sendFMessage(player, ConfigC.error_joinFull); | 											MessageManager.sendFMessage(player, ConfigC.error_joinFull); | ||||||
| 											return; | 											return; | ||||||
| 										} | 										} | ||||||
| 									} | 									} | ||||||
| @@ -152,14 +148,14 @@ public class ArenaHandler { | |||||||
| 
 | 
 | ||||||
| 									if ((Boolean) W.config.get(ConfigC.shop_blockChooserv1Enabled)) { | 									if ((Boolean) W.config.get(ConfigC.shop_blockChooserv1Enabled)) { | ||||||
| 										if (W.shop.getFile().get(player.getName() + ".blockchooser") != null | 										if (W.shop.getFile().get(player.getName() + ".blockchooser") != null | ||||||
| 												|| PermissionsM.hasPerm(player, Permissions.shopblockchooser, false)) { | 												|| PermissionsManager.hasPerm(player, Permissions.shopblockchooser, false)) { | ||||||
| 											ItemStack shopBlockChooser = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.shop_blockChooserv1IDname)), 1); | 											ItemStack shopBlockChooser = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.shop_blockChooserv1IDname)), 1); | ||||||
| 											ItemMeta shopBlockChooser_IM = shopBlockChooser.getItemMeta(); | 											ItemMeta shopBlockChooser_IM = shopBlockChooser.getItemMeta(); | ||||||
| 											shopBlockChooser_IM.setDisplayName(MessageM.replaceAll((String) W.config.get(ConfigC.shop_blockChooserv1Name))); | 											shopBlockChooser_IM.setDisplayName(MessageManager.replaceAll((String) W.config.get(ConfigC.shop_blockChooserv1Name))); | ||||||
| 											List<String> lores = W.config.getFile().getStringList(ConfigC.shop_blockChooserv1Description.location); | 											List<String> lores = W.config.getFile().getStringList(ConfigC.shop_blockChooserv1Description.location); | ||||||
| 											List<String> lores2 = new ArrayList<>(); | 											List<String> lores2 = new ArrayList<>(); | ||||||
| 											for (String lore : lores) { | 											for (String lore : lores) { | ||||||
| 												lores2.add(MessageM.replaceAll(lore)); | 												lores2.add(MessageManager.replaceAll(lore)); | ||||||
| 											} | 											} | ||||||
| 											shopBlockChooser_IM.setLore(lores2); | 											shopBlockChooser_IM.setLore(lores2); | ||||||
| 											shopBlockChooser.setItemMeta(shopBlockChooser_IM); | 											shopBlockChooser.setItemMeta(shopBlockChooser_IM); | ||||||
| @@ -173,11 +169,11 @@ public class ArenaHandler { | |||||||
| 											ItemStack shopBlockHuntPass = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.shop_BlockHuntPassv2IDName)), | 											ItemStack shopBlockHuntPass = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.shop_BlockHuntPassv2IDName)), | ||||||
| 													1); | 													1); | ||||||
| 											ItemMeta shopBlockHuntPass_IM = shopBlockHuntPass.getItemMeta(); | 											ItemMeta shopBlockHuntPass_IM = shopBlockHuntPass.getItemMeta(); | ||||||
| 											shopBlockHuntPass_IM.setDisplayName(MessageM.replaceAll((String) W.config.get(ConfigC.shop_BlockHuntPassv2Name))); | 											shopBlockHuntPass_IM.setDisplayName(MessageManager.replaceAll((String) W.config.get(ConfigC.shop_BlockHuntPassv2Name))); | ||||||
| 											List<String> lores = W.config.getFile().getStringList(ConfigC.shop_BlockHuntPassv2Description.location); | 											List<String> lores = W.config.getFile().getStringList(ConfigC.shop_BlockHuntPassv2Description.location); | ||||||
| 											List<String> lores2 = new ArrayList<>(); | 											List<String> lores2 = new ArrayList<>(); | ||||||
| 											for (String lore : lores) { | 											for (String lore : lores) { | ||||||
| 												lores2.add(MessageM.replaceAll(lore)); | 												lores2.add(MessageManager.replaceAll(lore)); | ||||||
| 											} | 											} | ||||||
| 
 | 
 | ||||||
| 											shopBlockHuntPass_IM.setLore(lores2); | 											shopBlockHuntPass_IM.setLore(lores2); | ||||||
| @@ -197,24 +193,24 @@ public class ArenaHandler { | |||||||
| 										ArenaHandler.sendFMessage(arena, ConfigC.warning_lobbyNeedAtleast, "1-" + arena.minPlayers); | 										ArenaHandler.sendFMessage(arena, ConfigC.warning_lobbyNeedAtleast, "1-" + arena.minPlayers); | ||||||
| 									} | 									} | ||||||
| 								} else { | 								} else { | ||||||
| 									MessageM.sendFMessage(player, ConfigC.error_joinArenaIngame); | 									MessageManager.sendFMessage(player, ConfigC.error_joinArenaIngame); | ||||||
| 								} | 								} | ||||||
| 							} else { | 							} else { | ||||||
| 								MessageM.sendFMessage(player, ConfigC.error_joinWarpsNotSet); | 								MessageManager.sendFMessage(player, ConfigC.error_joinWarpsNotSet); | ||||||
| 							} | 							} | ||||||
| 						} else { | 						} else { | ||||||
| 							MessageM.sendFMessage(player, ConfigC.error_joinWarpsNotSet); | 							MessageManager.sendFMessage(player, ConfigC.error_joinWarpsNotSet); | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			MessageM.sendFMessage(player, ConfigC.error_joinAlreadyJoined); | 			MessageManager.sendFMessage(player, ConfigC.error_joinAlreadyJoined); | ||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		if (!found) { | 		if (!found) { | ||||||
| 			MessageM.sendFMessage(player, ConfigC.error_noArena, "name-" + arenaname); | 			MessageManager.sendFMessage(player, ConfigC.error_noArena, "name-" + arenaname); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		SignsHandler.updateSigns(); | 		SignsHandler.updateSigns(); | ||||||
| @@ -277,8 +273,13 @@ 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) { | ||||||
| 						otherplayer.showPlayer(player);  | 						if (otherplayer.canSee(player)) | ||||||
| 						player.showPlayer(otherplayer);  | 							otherplayer.showPlayer(player); // Make new player | ||||||
|  | 															// visible to others | ||||||
|  | 						if (player.canSee(otherplayer)) | ||||||
|  | 							player.showPlayer(otherplayer); // Make other | ||||||
|  | 															// players visible | ||||||
|  | 															// to new player | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| @@ -327,14 +328,14 @@ public class ArenaHandler { | |||||||
| 
 | 
 | ||||||
| 			ScoreboardHandler.removeScoreboard(player); | 			ScoreboardHandler.removeScoreboard(player); | ||||||
| 
 | 
 | ||||||
| 			MessageM.sendFMessage(player, ConfigC.normal_leaveYouLeft); | 			MessageManager.sendFMessage(player, ConfigC.normal_leaveYouLeft); | ||||||
| 			if (message) { | 			if (message) { | ||||||
| 				ArenaHandler.sendFMessage(arena, ConfigC.normal_leaveLeftArena, "playername-" + player.getName(), "1-" + arena.playersInArena.size(), "2-" | 				ArenaHandler.sendFMessage(arena, ConfigC.normal_leaveLeftArena, "playername-" + player.getName(), "1-" + arena.playersInArena.size(), "2-" | ||||||
| 						+ arena.maxPlayers); | 						+ arena.maxPlayers); | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			if (message) { | 			if (message) { | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_leaveNotInArena); | 				MessageManager.sendFMessage(player, ConfigC.error_leaveNotInArena); | ||||||
| 			} | 			} | ||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
| @@ -368,7 +369,7 @@ public class ArenaHandler { | |||||||
| 					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, "amount-" + arena.seekersTokenWin); | 					MessageManager.sendFMessage(player, ConfigC.normal_addedToken, "amount-" + arena.seekersTokenWin); | ||||||
| 
 | 
 | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| @@ -420,7 +421,7 @@ public class ArenaHandler { | |||||||
| 					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, "amount-" + arena.hidersTokenWin); | 					MessageManager.sendFMessage(player, ConfigC.normal_addedToken, "amount-" + arena.hidersTokenWin); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| @@ -35,10 +35,10 @@ import nl.Steffion.BlockHunt.Listeners.OnPlayerInteractEvent; | |||||||
| import nl.Steffion.BlockHunt.Listeners.OnPlayerMoveEvent; | import nl.Steffion.BlockHunt.Listeners.OnPlayerMoveEvent; | ||||||
| import nl.Steffion.BlockHunt.Listeners.OnPlayerQuitEvent; | import nl.Steffion.BlockHunt.Listeners.OnPlayerQuitEvent; | ||||||
| import nl.Steffion.BlockHunt.Listeners.OnSignChangeEvent; | import nl.Steffion.BlockHunt.Listeners.OnSignChangeEvent; | ||||||
| import nl.Steffion.BlockHunt.Managers.CommandM; | import nl.Steffion.BlockHunt.Managers.CommandManager; | ||||||
| import nl.Steffion.BlockHunt.Managers.ConfigM; | import nl.Steffion.BlockHunt.Managers.ConfigManager; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| import nl.Steffion.BlockHunt.Managers.PermissionsM; | import nl.Steffion.BlockHunt.Managers.PermissionsManager; | ||||||
| import nl.Steffion.BlockHunt.Serializables.LocationSerializable; | import nl.Steffion.BlockHunt.Serializables.LocationSerializable; | ||||||
| 
 | 
 | ||||||
| import org.apache.commons.lang.StringUtils; | import org.apache.commons.lang.StringUtils; | ||||||
| @@ -95,21 +95,21 @@ public class BlockHunt extends JavaPlugin implements Listener { | |||||||
| 		} | 		} | ||||||
| 	}; | 	}; | ||||||
| 
 | 
 | ||||||
| 	public static CommandM CMD; | 	public static CommandManager CMD; | ||||||
| 	public static CommandM CMDinfo; | 	public static CommandManager CMDinfo; | ||||||
| 	public static CommandM CMDhelp; | 	public static CommandManager CMDhelp; | ||||||
| 	public static CommandM CMDreload; | 	public static CommandManager CMDreload; | ||||||
| 	public static CommandM CMDjoin; | 	public static CommandManager CMDjoin; | ||||||
| 	public static CommandM CMDleave; | 	public static CommandManager CMDleave; | ||||||
| 	public static CommandM CMDlist; | 	public static CommandManager CMDlist; | ||||||
| 	public static CommandM CMDshop; | 	public static CommandManager CMDshop; | ||||||
| 	public static CommandM CMDstart; | 	public static CommandManager CMDstart; | ||||||
| 	public static CommandM CMDwand; | 	public static CommandManager CMDwand; | ||||||
| 	public static CommandM CMDcreate; | 	public static CommandManager CMDcreate; | ||||||
| 	public static CommandM CMDset; | 	public static CommandManager CMDset; | ||||||
| 	public static CommandM CMDsetwarp; | 	public static CommandManager CMDsetwarp; | ||||||
| 	public static CommandM CMDremove; | 	public static CommandManager CMDremove; | ||||||
| 	public static CommandM CMDtokens; | 	public static CommandManager CMDtokens; | ||||||
| 
 | 
 | ||||||
| 	public void onEnable() { | 	public void onEnable() { | ||||||
| 		getServer().getPluginManager().registerEvents(this, this); | 		getServer().getPluginManager().registerEvents(this, this); | ||||||
| @@ -138,55 +138,55 @@ public class BlockHunt extends JavaPlugin implements Listener { | |||||||
| 		pdfFile = getDescription(); | 		pdfFile = getDescription(); | ||||||
| 		plugin = this; | 		plugin = this; | ||||||
| 
 | 
 | ||||||
| 		ConfigM.newFiles(); | 		ConfigManager.newFiles(); | ||||||
| 
 | 
 | ||||||
| 		CMD = new CommandM("BlockHunt", "BlockHunt", null, null, Permissions.info, ConfigC.help_info, (Boolean) W.config.get(ConfigC.commandEnabled_info), BlockHuntCMD, | 		CMD = new CommandManager("BlockHunt", "BlockHunt", null, null, Permissions.info, ConfigC.help_info, (Boolean) W.config.get(ConfigC.commandEnabled_info), BlockHuntCMD, | ||||||
| 				new CMDinfo(), null); | 				new CMDinfo(), null); | ||||||
| 		CMDinfo = new CommandM("BlockHunt INFO", "BlockHunt", "info", "i", Permissions.info, ConfigC.help_info, (Boolean) W.config.get(ConfigC.commandEnabled_info), | 		CMDinfo = new CommandManager("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", Permissions.help, ConfigC.help_help, (Boolean) W.config.get(ConfigC.commandEnabled_help), | 		CMDhelp = new CommandManager("BlockHunt HELP", "BlockHunt", "help", "h", Permissions.help, ConfigC.help_help, (Boolean) W.config.get(ConfigC.commandEnabled_help), | ||||||
| 				BlockHuntCMD, new CMDhelp(), "/BlockHunt <help|h> [page number]"); | 				BlockHuntCMD, new CMDhelp(), "/BlockHunt <help|h> [page number]"); | ||||||
| 		CMDreload = new CommandM("BlockHunt RELOAD", "BlockHunt", "reload", "r", Permissions.reload, ConfigC.help_reload, | 		CMDreload = new CommandManager("BlockHunt RELOAD", "BlockHunt", "reload", "r", Permissions.reload, ConfigC.help_reload, | ||||||
| 				(Boolean) W.config.get(ConfigC.commandEnabled_reload), BlockHuntCMD, new CMDreload(), "/BlockHunt <reload|r>"); | 				(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), | 		CMDjoin = new CommandManager("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", Permissions.leave, ConfigC.help_leave, | 		CMDleave = new CommandManager("BlockHunt LEAVE", "BlockHunt", "leave", "l", 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), 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), | 		CMDlist = new CommandManager("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", Permissions.shop, ConfigC.help_shop, (Boolean) W.config.get(ConfigC.commandEnabled_shop), | 		CMDshop = new CommandManager("BlockHunt SHOP", "BlockHunt", "shop", "sh", 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", Permissions.start, ConfigC.help_start, | 		CMDstart = new CommandManager("BlockHunt START", "BlockHunt", "start", "go", 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), 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), | 		CMDwand = new CommandManager("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", "c", Permissions.create, ConfigC.help_create, | 		CMDcreate = new CommandManager("BlockHunt CREATE", "BlockHunt", "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), 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), | 		CMDset = new CommandManager("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", "sw", Permissions.setwarp, ConfigC.help_setwarp, | 		CMDsetwarp = new CommandManager("BlockHunt SETWARP", "BlockHunt", "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", "delete", Permissions.remove, ConfigC.help_remove, | 		CMDremove = new CommandManager("BlockHunt REMOVE", "BlockHunt", "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), BlockHuntCMD, new CMDremove(), "/BlockHunt <remove|delete> <arenaname>"); | ||||||
| 		CMDtokens = new CommandM("BlockHunt TOKENS", "BlockHunt", "tokens", "t", Permissions.tokens, ConfigC.help_tokens, | 		CMDtokens = new CommandManager("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>"); | 				(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); | 			MessageManager.broadcastFMessage(ConfigC.error_libsDisguisesNotInstalled); | ||||||
| 			Bukkit.getServer().getPluginManager().disablePlugin(this); |             Bukkit.getServer().getPluginManager().disablePlugin(this); | ||||||
| 			return; |             return; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		if (!getServer().getPluginManager().isPluginEnabled("ProtocolLib")) { | 		if (!getServer().getPluginManager().isPluginEnabled("ProtocolLib")) { | ||||||
| 			MessageM.broadcastFMessage(ConfigC.error_protocolLibNotInstalled); | 			MessageManager.broadcastFMessage(ConfigC.error_protocolLibNotInstalled); | ||||||
|             Bukkit.getServer().getPluginManager().disablePlugin(this); |             Bukkit.getServer().getPluginManager().disablePlugin(this); | ||||||
|             return; |             return; | ||||||
|         } | 		} | ||||||
| 
 | 
 | ||||||
| 		ArenaHandler.loadArenas(); | 		ArenaHandler.loadArenas(); | ||||||
| 
 | 
 | ||||||
| 		MessageM.sendFMessage(null, ConfigC.log_enabledPlugin, "name-" + BlockHunt.pdfFile.getName(), "version-" + BlockHunt.pdfFile.getVersion(), "authors-" | 		MessageManager.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!! | 		// Welcome to the massive game loop!! | ||||||
| @@ -284,10 +284,10 @@ public class BlockHunt extends JavaPlugin implements Listener { | |||||||
|                                 W.pBlock.put(arenaPlayer, block); |                                 W.pBlock.put(arenaPlayer, block); | ||||||
| 
 | 
 | ||||||
|                                 if (block.getDurability() != 0) { |                                 if (block.getDurability() != 0) { | ||||||
|                                     MessageM.sendFMessage(arenaPlayer, ConfigC.normal_ingameBlock, |                                     MessageManager.sendFMessage(arenaPlayer, ConfigC.normal_ingameBlock, | ||||||
|                                             "block-" + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase() + ":" + block.getDurability()); |                                             "block-" + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase() + ":" + block.getDurability()); | ||||||
|                                 } else { |                                 } else { | ||||||
|                                     MessageM.sendFMessage(arenaPlayer, ConfigC.normal_ingameBlock, |                                     MessageManager.sendFMessage(arenaPlayer, ConfigC.normal_ingameBlock, | ||||||
|                                             "block-" + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase()); |                                             "block-" + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase()); | ||||||
|                                 } |                                 } | ||||||
|                             } |                             } | ||||||
| @@ -330,7 +330,7 @@ public class BlockHunt extends JavaPlugin implements Listener { | |||||||
|                             for (Player arenaPlayer : arena.playersInArena) { |                             for (Player arenaPlayer : arena.playersInArena) { | ||||||
|                                 if (!arena.seekers.contains(arenaPlayer)) { |                                 if (!arena.seekers.contains(arenaPlayer)) { | ||||||
|                                     arenaPlayer.getInventory().addItem(sword); |                                     arenaPlayer.getInventory().addItem(sword); | ||||||
|                                     MessageM.sendFMessage(arenaPlayer, ConfigC.normal_ingameGivenSword); |                                     MessageManager.sendFMessage(arenaPlayer, ConfigC.normal_ingameGivenSword); | ||||||
|                                 } |                                 } | ||||||
|                             } |                             } | ||||||
|                         } |                         } | ||||||
| @@ -420,13 +420,13 @@ public class BlockHunt extends JavaPlugin implements Listener { | |||||||
|                                                 player.playSound(pLoc, Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1); |                                                 player.playSound(pLoc, Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1); | ||||||
|                                                 W.hiddenLoc.put(player, moveLoc); |                                                 W.hiddenLoc.put(player, moveLoc); | ||||||
|                                                 if (block.getDurability() != 0) { |                                                 if (block.getDurability() != 0) { | ||||||
|                                                     MessageM.sendFMessage( |                                                     MessageManager.sendFMessage( | ||||||
|                                                             player, |                                                             player, | ||||||
|                                                             ConfigC.normal_ingameNowSolid, |                                                             ConfigC.normal_ingameNowSolid, | ||||||
|                                                             "block-" + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase() + ":" |                                                             "block-" + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase() + ":" | ||||||
|                                                                     + block.getDurability()); |                                                                     + block.getDurability()); | ||||||
|                                                 } else { |                                                 } else { | ||||||
|                                                     MessageM.sendFMessage(player, ConfigC.normal_ingameNowSolid, "block-" |                                                     MessageManager.sendFMessage(player, ConfigC.normal_ingameNowSolid, "block-" | ||||||
|                                                             + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase()); |                                                             + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase()); | ||||||
|                                                 } |                                                 } | ||||||
|                                             } |                                             } | ||||||
| @@ -437,7 +437,7 @@ public class BlockHunt extends JavaPlugin implements Listener { | |||||||
|                                                 } |                                                 } | ||||||
|                                             } |                                             } | ||||||
|                                         } else { |                                         } else { | ||||||
|                                             MessageM.sendFMessage(player, ConfigC.warning_ingameNoSolidPlace); |                                             MessageManager.sendFMessage(player, ConfigC.warning_ingameNoSolidPlace); | ||||||
|                                         } |                                         } | ||||||
|                                     } |                                     } | ||||||
|                                 } else { |                                 } else { | ||||||
| @@ -466,7 +466,7 @@ public class BlockHunt extends JavaPlugin implements Listener { | |||||||
| 			ArenaHandler.stopArena(arena); | 			ArenaHandler.stopArena(arena); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		MessageM.sendFMessage(null, ConfigC.log_disabledPlugin, "name-" + BlockHunt.pdfFile.getName(), "version-" + BlockHunt.pdfFile.getVersion(), "autors-" | 		MessageManager.sendFMessage(null, ConfigC.log_disabledPlugin, "name-" + BlockHunt.pdfFile.getName(), "version-" + BlockHunt.pdfFile.getVersion(), "autors-" | ||||||
| 				+ BlockHunt.pdfFile.getAuthors().get(0)); | 				+ BlockHunt.pdfFile.getAuthors().get(0)); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| @@ -498,7 +498,7 @@ public class BlockHunt extends JavaPlugin implements Listener { | |||||||
| 			player = (Player) sender; | 			player = (Player) sender; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		for (CommandM command : W.commands) { | 		for (CommandManager command : W.commands) { | ||||||
| 			String[] argsSplit = null; | 			String[] argsSplit = null; | ||||||
| 			String[] argsSplitAlias = null; | 			String[] argsSplitAlias = null; | ||||||
| 
 | 
 | ||||||
| @@ -526,11 +526,11 @@ public class BlockHunt extends JavaPlugin implements Listener { | |||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				if (equals) { | 				if (equals) { | ||||||
| 					if (PermissionsM.hasPerm(player, command.permission, true)) { | 					if (PermissionsManager.hasPerm(player, command.permission, true)) { | ||||||
| 						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, ConfigC.error_commandNotEnabled); | 							MessageManager.sendFMessage(player, ConfigC.error_commandNotEnabled); | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| @@ -546,7 +546,7 @@ public class BlockHunt extends JavaPlugin implements Listener { | |||||||
| 	@Override | 	@Override | ||||||
| 	public List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] args) { | 	public List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] args) { | ||||||
| 
 | 
 | ||||||
| 		for (CommandM command : W.commands) { | 		for (CommandManager command : W.commands) { | ||||||
| 			if (cmd.getName().equalsIgnoreCase(command.label)) { | 			if (cmd.getName().equalsIgnoreCase(command.label)) { | ||||||
| 				if (args.length == 1) { | 				if (args.length == 1) { | ||||||
| 					return command.mainTABlist; | 					return command.mainTABlist; | ||||||
| @@ -8,7 +8,7 @@ import nl.Steffion.BlockHunt.BlockHunt; | |||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.ScoreboardHandler; | import nl.Steffion.BlockHunt.ScoreboardHandler; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
| import org.bukkit.command.Command; | import org.bukkit.command.Command; | ||||||
| @@ -20,7 +20,7 @@ public class CMDcreate extends DefaultCMD { | |||||||
| 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
| 		if (player != null) { | 		if (player != null) { | ||||||
| 			if (args.length <= 1) { | 			if (args.length <= 1) { | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDcreate.usage); | 				MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "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().equals(W.pos2.get(player).getWorld())) { | 					if (W.pos1.get(player).getWorld().equals(W.pos2.get(player).getWorld())) { | ||||||
| @@ -34,16 +34,16 @@ public class CMDcreate extends DefaultCMD { | |||||||
| 						W.arenaList.add(arena); | 						W.arenaList.add(arena); | ||||||
| 						ScoreboardHandler.createScoreboard(arena); | 						ScoreboardHandler.createScoreboard(arena); | ||||||
| 
 | 
 | ||||||
| 						MessageM.sendFMessage(player, ConfigC.normal_createCreatedArena, "name-" + args[1]); | 						MessageManager.sendFMessage(player, ConfigC.normal_createCreatedArena, "name-" + args[1]); | ||||||
| 					} else { | 					} else { | ||||||
| 						MessageM.sendFMessage(player, ConfigC.error_createNotSameWorld); | 						MessageManager.sendFMessage(player, ConfigC.error_createNotSameWorld); | ||||||
| 					} | 					} | ||||||
| 				} else { | 				} else { | ||||||
| 					MessageM.sendFMessage(player, ConfigC.error_createSelectionFirst); | 					MessageManager.sendFMessage(player, ConfigC.error_createSelectionFirst); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			MessageM.sendFMessage(player, ConfigC.error_onlyIngame); | 			MessageManager.sendFMessage(player, ConfigC.error_onlyIngame); | ||||||
| 		} | 		} | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
| @@ -13,9 +13,9 @@ package nl.Steffion.BlockHunt.Commands; | |||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.BlockHunt; | import nl.Steffion.BlockHunt.BlockHunt; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.CommandM; | import nl.Steffion.BlockHunt.Managers.CommandManager; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| import nl.Steffion.BlockHunt.Managers.PermissionsM; | import nl.Steffion.BlockHunt.Managers.PermissionsManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.command.Command; | import org.bukkit.command.Command; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -26,7 +26,7 @@ public class CMDhelp extends DefaultCMD { | |||||||
| 	@Override | 	@Override | ||||||
| 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
| 		int amountCommands = 0; | 		int amountCommands = 0; | ||||||
| 		for (CommandM command : W.commands) { | 		for (CommandManager command : W.commands) { | ||||||
| 			if (command.usage != null) { | 			if (command.usage != null) { | ||||||
| 				amountCommands = amountCommands + 1; | 				amountCommands = amountCommands + 1; | ||||||
| 			} | 			} | ||||||
| @@ -39,22 +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-" + BlockHunt.pdfFile.getName() + " %Nhelp page %A" + page + "%N/%A" + maxPages); | 			MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName() + " %Nhelp page %A" + page + "%N/%A" + maxPages); | ||||||
| 			int i = 1; | 			int i = 1; | ||||||
| 			for (CommandM command : W.commands) { | 			for (CommandManager command : W.commands) { | ||||||
| 				if (i <= 4) { | 				if (i <= 4) { | ||||||
| 					if (command.usage != null) { | 					if (command.usage != null) { | ||||||
| 						if (PermissionsM.hasPerm(player, command.permission, false)) { | 						if (PermissionsManager.hasPerm(player, command.permission, false)) { | ||||||
| 							MessageM.sendMessage(player, "%A" + command.usage + "%N - " + W.messages.getFile().get(command.help.location)); | 							MessageManager.sendMessage(player, "%A" + command.usage + "%N - " + W.messages.getFile().get(command.help.location)); | ||||||
| 						} else { | 						} else { | ||||||
| 							MessageM.sendMessage(player, "%W" + command.usage + "%N - " + W.messages.getFile().get(command.help.location)); | 							MessageManager.sendMessage(player, "%W" + command.usage + "%N - " + W.messages.getFile().get(command.help.location)); | ||||||
| 						} | 						} | ||||||
| 						i = i + 1; | 						i = i + 1; | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oHelp Page"); | 			MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oHelp Page"); | ||||||
| 		} else { | 		} else { | ||||||
| 			int page = 1; | 			int page = 1; | ||||||
| 			try { | 			try { | ||||||
| @@ -67,24 +67,24 @@ public class CMDhelp extends DefaultCMD { | |||||||
| 				maxPages = page; | 				maxPages = page; | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName() + " %Nhelp page %A" + page + "%N/%A" + maxPages); | 			MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName() + " %Nhelp page %A" + page + "%N/%A" + maxPages); | ||||||
| 
 | 
 | ||||||
| 			int i = 1; | 			int i = 1; | ||||||
| 			for (CommandM command : W.commands) { | 			for (CommandManager 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 && i <= ((page - 1) * 4) + 4) { | 						if (i >= ((page - 1) * 4) + 1 && i <= ((page - 1) * 4) + 4) { | ||||||
| 							if (PermissionsM.hasPerm(player, command.permission, false)) { | 							if (PermissionsManager.hasPerm(player, command.permission, false)) { | ||||||
| 								MessageM.sendMessage(player, "%A" + command.usage + "%N - " + W.messages.getFile().get(command.help.location)); | 								MessageManager.sendMessage(player, "%A" + command.usage + "%N - " + W.messages.getFile().get(command.help.location)); | ||||||
| 							} else { | 							} else { | ||||||
| 								MessageM.sendMessage(player, "%W" + command.usage + "%N - " + W.messages.getFile().get(command.help.location)); | 								MessageManager.sendMessage(player, "%W" + command.usage + "%N - " + W.messages.getFile().get(command.help.location)); | ||||||
| 							} | 							} | ||||||
| 						} | 						} | ||||||
| 						i = i + 1; | 						i = i + 1; | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oHelp Page"); | 			MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oHelp Page"); | ||||||
| 		} | 		} | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
							
								
								
									
										35
									
								
								src/main/java/nl/Steffion/BlockHunt/Commands/CMDinfo.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								src/main/java/nl/Steffion/BlockHunt/Commands/CMDinfo.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,35 @@ | |||||||
|  | package nl.Steffion.BlockHunt.Commands; | ||||||
|  | /** | ||||||
|  |  * Steffion's Engine - Made by Steffion. | ||||||
|  |  * | ||||||
|  |  * You're allowed to use this engine for own usage, you're not allowed to | ||||||
|  |  * republish the engine. Using this for your own plugin is allowed when a | ||||||
|  |  * credit is placed somewhere in the plugin. | ||||||
|  |  * | ||||||
|  |  * Thanks for your cooperate! | ||||||
|  |  * | ||||||
|  |  * @author Steffion | ||||||
|  |  */ | ||||||
|  | import nl.Steffion.BlockHunt.BlockHunt; | ||||||
|  | import nl.Steffion.BlockHunt.ConfigC; | ||||||
|  | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
|  |  | ||||||
|  | import org.bukkit.command.Command; | ||||||
|  | import org.bukkit.entity.Player; | ||||||
|  |  | ||||||
|  | public class CMDinfo extends DefaultCMD { | ||||||
|  |  | ||||||
|  |  | ||||||
|  | 	@Override | ||||||
|  | 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
|  | 		MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName()); | ||||||
|  | 		MessageManager.sendMessage(player, "%A%name%%N made by %A%autors%%N.", "name-" + BlockHunt.pdfFile.getName(), "autors-" + BlockHunt.pdfFile.getAuthors().get(0)); | ||||||
|  | 		MessageManager.sendMessage(player, "%NVersion: %A%version%%N.", "version-" + BlockHunt.pdfFile.getVersion()); | ||||||
|  | 		MessageManager.sendMessage(player, "%NType %A%helpusage% %Nfor help.", "helpusage-" + BlockHunt.CMDhelp.usage); | ||||||
|  | 		MessageManager.sendMessage(player, "%NDev-Page: %Ahttp://dev.bukkit.org/bukkit-plugins/blockhunt/"); | ||||||
|  | 		MessageManager.sendMessage(player, "%NDonations are welcome!"); | ||||||
|  | 		MessageManager.sendMessage(player, "%NMade by help from some friends &c<3%N!"); | ||||||
|  | 		MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oInfo Page"); | ||||||
|  | 		return true; | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @@ -3,7 +3,7 @@ package nl.Steffion.BlockHunt.Commands; | |||||||
| import nl.Steffion.BlockHunt.ArenaHandler; | import nl.Steffion.BlockHunt.ArenaHandler; | ||||||
| import nl.Steffion.BlockHunt.BlockHunt; | import nl.Steffion.BlockHunt.BlockHunt; | ||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.command.Command; | import org.bukkit.command.Command; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -14,12 +14,12 @@ public class CMDjoin extends DefaultCMD { | |||||||
| 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
| 		if (player != null) { | 		if (player != null) { | ||||||
| 			if (args.length <= 1) { | 			if (args.length <= 1) { | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDjoin.usage); | 				MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDjoin.usage); | ||||||
| 			} else { | 			} else { | ||||||
| 				ArenaHandler.playerJoinArena(player, args[1]); | 				ArenaHandler.playerJoinArena(player, args[1]); | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			MessageM.sendFMessage(player, ConfigC.error_onlyIngame); | 			MessageManager.sendFMessage(player, ConfigC.error_onlyIngame); | ||||||
| 		} | 		} | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
| @@ -2,7 +2,7 @@ package nl.Steffion.BlockHunt.Commands; | |||||||
| 
 | 
 | ||||||
| import nl.Steffion.BlockHunt.ArenaHandler; | import nl.Steffion.BlockHunt.ArenaHandler; | ||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.command.Command; | import org.bukkit.command.Command; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -14,7 +14,7 @@ public class CMDleave extends DefaultCMD { | |||||||
| 		if (player != null) { | 		if (player != null) { | ||||||
| 			ArenaHandler.playerLeaveArena(player, true, true); | 			ArenaHandler.playerLeaveArena(player, true, true); | ||||||
| 		} else { | 		} else { | ||||||
| 			MessageM.sendFMessage(player, ConfigC.error_onlyIngame); | 			MessageManager.sendFMessage(player, ConfigC.error_onlyIngame); | ||||||
| 		} | 		} | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
							
								
								
									
										29
									
								
								src/main/java/nl/Steffion/BlockHunt/Commands/CMDlist.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								src/main/java/nl/Steffion/BlockHunt/Commands/CMDlist.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | package nl.Steffion.BlockHunt.Commands; | ||||||
|  |  | ||||||
|  | import nl.Steffion.BlockHunt.Arena; | ||||||
|  | import nl.Steffion.BlockHunt.BlockHunt; | ||||||
|  | import nl.Steffion.BlockHunt.ConfigC; | ||||||
|  | import nl.Steffion.BlockHunt.W; | ||||||
|  | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
|  |  | ||||||
|  | import org.bukkit.command.Command; | ||||||
|  | import org.bukkit.entity.Player; | ||||||
|  |  | ||||||
|  | public class CMDlist extends DefaultCMD { | ||||||
|  |  | ||||||
|  | 	@Override | ||||||
|  | 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
|  | 		MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName()); | ||||||
|  | 		if (W.arenaList.size() >= 1) { | ||||||
|  | 			MessageManager.sendMessage(player, "&7Available arena(s):"); | ||||||
|  | 			for (Arena arena : W.arenaList) { | ||||||
|  | 				MessageManager.sendMessage(player, "%A" + arena.arenaName); | ||||||
|  | 			} | ||||||
|  | 		} else { | ||||||
|  | 			MessageManager.sendMessage(player, "&7&oNo arenas available..."); | ||||||
|  | 			MessageManager.sendMessage(player, "&7&oCreate an arena first please."); | ||||||
|  | 		} | ||||||
|  | 		MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oArenas list"); | ||||||
|  | 		return true; | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @@ -11,7 +11,7 @@ package nl.Steffion.BlockHunt.Commands; | |||||||
|  * @author Steffion |  * @author Steffion | ||||||
|  */ |  */ | ||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.command.Command; | import org.bukkit.command.Command; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -20,7 +20,7 @@ public class CMDnotfound { | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	public static boolean exectue(Player player, Command cmd, String label, String[] args) { | 	public static boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
| 		MessageM.sendFMessage(player, ConfigC.error_commandNotFound); | 		MessageManager.sendFMessage(player, ConfigC.error_commandNotFound); | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @@ -14,8 +14,8 @@ import nl.Steffion.BlockHunt.Arena; | |||||||
| import nl.Steffion.BlockHunt.ArenaHandler; | import nl.Steffion.BlockHunt.ArenaHandler; | ||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.ConfigM; | import nl.Steffion.BlockHunt.Managers.ConfigManager; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.command.Command; | import org.bukkit.command.Command; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -25,7 +25,7 @@ public class CMDreload extends DefaultCMD { | |||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
| 		ConfigM.newFiles(); | 		ConfigManager.newFiles(); | ||||||
| 
 | 
 | ||||||
| 		W.config.load(); | 		W.config.load(); | ||||||
| 		W.messages.load(); | 		W.messages.load(); | ||||||
| @@ -37,7 +37,7 @@ public class CMDreload extends DefaultCMD { | |||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		ArenaHandler.loadArenas(); | 		ArenaHandler.loadArenas(); | ||||||
| 		MessageM.sendFMessage(player, ConfigC.normal_reloadedConfigs); | 		MessageManager.sendFMessage(player, ConfigC.normal_reloadedConfigs); | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @@ -4,8 +4,7 @@ import nl.Steffion.BlockHunt.Arena; | |||||||
| import nl.Steffion.BlockHunt.BlockHunt; | import nl.Steffion.BlockHunt.BlockHunt; | ||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| import nl.Steffion.BlockHunt.Serializables.LocationSerializable; |  | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Effect; | import org.bukkit.Effect; | ||||||
| import org.bukkit.Location; | import org.bukkit.Location; | ||||||
| @@ -20,15 +19,15 @@ public class CMDremove extends DefaultCMD { | |||||||
| 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
| 		if (player != null) { | 		if (player != null) { | ||||||
| 			if (args.length <= 1) { | 			if (args.length <= 1) { | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDremove.usage); | 				MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "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, ConfigC.normal_removeRemovedArena, "name-" + args[1]); | 						MessageManager.sendFMessage(player, 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").toString().equalsIgnoreCase(args[1])) { | 							if (W.signs.getFile().get(sign + ".arenaName").toString().equalsIgnoreCase(args[1])) { | ||||||
| 								LocationSerializable signLoc = new LocationSerializable((Location) W.signs.getFile().get(sign + ".location")); | 								Location signLoc = (Location) W.signs.getFile().get(sign + ".location"); | ||||||
| 								signLoc.getBlock().setType(Material.AIR); | 								signLoc.getBlock().setType(Material.AIR); | ||||||
| 								signLoc.getWorld().playEffect(signLoc, Effect.MOBSPAWNER_FLAMES, 0); | 								signLoc.getWorld().playEffect(signLoc, Effect.MOBSPAWNER_FLAMES, 0); | ||||||
| 								signLoc.getWorld().playSound(signLoc, Sound.ENTITY_ENDERDRAGON_FLAP, 1, 1); | 								signLoc.getWorld().playSound(signLoc, Sound.ENTITY_ENDERDRAGON_FLAP, 1, 1); | ||||||
| @@ -44,10 +43,10 @@ public class CMDremove extends DefaultCMD { | |||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_noArena, "name-" + args[1]); | 				MessageManager.sendFMessage(player, ConfigC.error_noArena, "name-" + args[1]); | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			MessageM.sendFMessage(player, ConfigC.error_onlyIngame); | 			MessageManager.sendFMessage(player, ConfigC.error_onlyIngame); | ||||||
| 		} | 		} | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
| @@ -3,7 +3,7 @@ package nl.Steffion.BlockHunt.Commands; | |||||||
| import nl.Steffion.BlockHunt.BlockHunt; | import nl.Steffion.BlockHunt.BlockHunt; | ||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.InventoryHandler; | import nl.Steffion.BlockHunt.InventoryHandler; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.command.Command; | import org.bukkit.command.Command; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -14,13 +14,13 @@ public class CMDset extends DefaultCMD { | |||||||
| 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
| 		if (player != null) { | 		if (player != null) { | ||||||
| 			if (args.length <= 1) { | 			if (args.length <= 1) { | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDset.usage); | 				MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDset.usage); | ||||||
| 			} else { | 			} else { | ||||||
| 				String arenaname = args[1]; | 				String arenaname = args[1]; | ||||||
| 				InventoryHandler.openPanel(player, arenaname); | 				InventoryHandler.openPanel(player, arenaname); | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			MessageM.sendFMessage(player, ConfigC.error_onlyIngame); | 			MessageManager.sendFMessage(player, ConfigC.error_onlyIngame); | ||||||
| 		} | 		} | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
| @@ -5,9 +5,9 @@ import nl.Steffion.BlockHunt.ArenaHandler; | |||||||
| import nl.Steffion.BlockHunt.BlockHunt; | import nl.Steffion.BlockHunt.BlockHunt; | ||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| import nl.Steffion.BlockHunt.Serializables.LocationSerializable; |  | ||||||
| 
 | 
 | ||||||
|  | import org.bukkit.Location; | ||||||
| import org.bukkit.command.Command; | import org.bukkit.command.Command; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| 
 | 
 | ||||||
| @@ -17,7 +17,7 @@ public class CMDsetwarp extends DefaultCMD { | |||||||
| 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
| 		if (player != null) { | 		if (player != null) { | ||||||
| 			if (args.length <= 2) { | 			if (args.length <= 2) { | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDsetwarp.usage); | 				MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDsetwarp.usage); | ||||||
| 			} else { | 			} else { | ||||||
| 				String arenaname = args[2]; | 				String arenaname = args[2]; | ||||||
| 				String warpname = args[1]; | 				String warpname = args[1]; | ||||||
| @@ -29,32 +29,32 @@ public class CMDsetwarp extends DefaultCMD { | |||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 				if (arena != null) { | 				if (arena != null) { | ||||||
| 					LocationSerializable loc = new LocationSerializable(player.getLocation()); | 					Location loc = player.getLocation(); | ||||||
| 					if (warpname.equalsIgnoreCase("lobby")) { | 					if (warpname.equalsIgnoreCase("lobby")) { | ||||||
| 						arena.lobbyWarp = loc; | 						arena.lobbyWarp = loc; | ||||||
| 						save(arena); | 						save(arena); | ||||||
| 						MessageM.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname); | 						MessageManager.sendFMessage(player, 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, ConfigC.normal_setwarpWarpSet, "warp-" + warpname); | 						MessageManager.sendFMessage(player, 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, ConfigC.normal_setwarpWarpSet, "warp-" + warpname); | 						MessageManager.sendFMessage(player, 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, ConfigC.normal_setwarpWarpSet, "warp-" + warpname); | 						MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname); | ||||||
| 					} else { | 					} else { | ||||||
| 						MessageM.sendFMessage(player, ConfigC.error_setwarpWarpNotFound, "warp-" + warpname); | 						MessageManager.sendFMessage(player, ConfigC.error_setwarpWarpNotFound, "warp-" + warpname); | ||||||
| 					} | 					} | ||||||
| 				} else { | 				} else { | ||||||
| 					MessageM.sendFMessage(player, ConfigC.error_noArena, "name-" + arenaname); | 					MessageManager.sendFMessage(player, ConfigC.error_noArena, "name-" + arenaname); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			MessageM.sendFMessage(player, ConfigC.error_onlyIngame); | 			MessageManager.sendFMessage(player, ConfigC.error_onlyIngame); | ||||||
| 		} | 		} | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
| @@ -5,7 +5,7 @@ import nl.Steffion.BlockHunt.Arena.ArenaState; | |||||||
| import nl.Steffion.BlockHunt.BlockHunt; | import nl.Steffion.BlockHunt.BlockHunt; | ||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.command.Command; | import org.bukkit.command.Command; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -16,7 +16,7 @@ public class CMDstart extends DefaultCMD { | |||||||
| 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
| 		if (player != null) { | 		if (player != null) { | ||||||
| 			if (args.length <= 1) { | 			if (args.length <= 1) { | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDstart.usage); | 				MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDstart.usage); | ||||||
| 			} else { | 			} else { | ||||||
| 				Arena arena = null; | 				Arena arena = null; | ||||||
| 				for (Arena arena2 : W.arenaList) { | 				for (Arena arena2 : W.arenaList) { | ||||||
| @@ -30,9 +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, ConfigC.normal_startForced, "arenaname-" + arena.arenaName); | 							MessageManager.sendFMessage(player, ConfigC.normal_startForced, "arenaname-" + arena.arenaName); | ||||||
| 						} else { | 						} else { | ||||||
| 							MessageM.sendFMessage(player, ConfigC.warning_lobbyNeedAtleast, "1-2"); | 							MessageManager.sendFMessage(player, 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) { | ||||||
| @@ -43,14 +43,14 @@ public class CMDstart extends DefaultCMD { | |||||||
| 							arena.timer = 1; | 							arena.timer = 1; | ||||||
| 						} | 						} | ||||||
| 
 | 
 | ||||||
| 						MessageM.sendFMessage(player, ConfigC.normal_startForced, "arenaname-" + arena.arenaName); | 						MessageManager.sendFMessage(player, ConfigC.normal_startForced, "arenaname-" + arena.arenaName); | ||||||
| 					} | 					} | ||||||
| 				} else { | 				} else { | ||||||
| 					MessageM.sendFMessage(player, ConfigC.error_noArena, "name-" + args[1]); | 					MessageManager.sendFMessage(player, ConfigC.error_noArena, "name-" + args[1]); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			MessageM.sendFMessage(player, ConfigC.error_onlyIngame); | 			MessageManager.sendFMessage(player, ConfigC.error_onlyIngame); | ||||||
| 		} | 		} | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
| @@ -13,7 +13,7 @@ package nl.Steffion.BlockHunt.Commands; | |||||||
| import nl.Steffion.BlockHunt.BlockHunt; | import nl.Steffion.BlockHunt.BlockHunt; | ||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
| import org.bukkit.command.Command; | import org.bukkit.command.Command; | ||||||
| @@ -25,7 +25,7 @@ public class CMDtokens extends DefaultCMD { | |||||||
| 	@Override | 	@Override | ||||||
| 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
| 		if (args.length <= 3) { | 		if (args.length <= 3) { | ||||||
| 			MessageM.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDtokens.usage); | 			MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDtokens.usage); | ||||||
| 		} else { | 		} else { | ||||||
| 			String option = args[1]; | 			String option = args[1]; | ||||||
| 			String playerName = args[2]; | 			String playerName = args[2]; | ||||||
| @@ -33,13 +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-" + args[3]); | 				MessageManager.sendFMessage(player, ConfigC.error_notANumber, "1-" + 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, ConfigC.error_tokensPlayerNotOnline, "playername-" + playerName); | 				MessageManager.sendFMessage(player, ConfigC.error_tokensPlayerNotOnline, "playername-" + playerName); | ||||||
| 				return true; | 				return true; | ||||||
| 			} | 			} | ||||||
| 			String name = "\u00A78Console"; | 			String name = "\u00A78Console"; | ||||||
| @@ -50,8 +50,8 @@ 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, "option-Set", "playername-" + tokenPlayer.getName(), "option2-to", "amount-" + amount); | 				MessageManager.sendFMessage(player, ConfigC.normal_tokensChanged, "option-Set", "playername-" + tokenPlayer.getName(), "option2-to", "amount-" + amount); | ||||||
| 				MessageM.sendFMessage(tokenPlayer, ConfigC.normal_tokensChangedPerson, "option-set", "playername-" + name, "option2-to", "amount-" + amount); | 				MessageManager.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) { | ||||||
| @@ -59,8 +59,8 @@ public class CMDtokens extends DefaultCMD { | |||||||
| 				} | 				} | ||||||
| 				W.shop.getFile().set(tokenPlayer.getName() + ".tokens", tokens + amount); | 				W.shop.getFile().set(tokenPlayer.getName() + ".tokens", tokens + amount); | ||||||
| 				W.shop.save(); | 				W.shop.save(); | ||||||
| 				MessageM.sendFMessage(player, ConfigC.normal_tokensChanged, "option-Added", "playername-" + tokenPlayer.getName(), "option2-to", "amount-" + amount); | 				MessageManager.sendFMessage(player, ConfigC.normal_tokensChanged, "option-Added", "playername-" + tokenPlayer.getName(), "option2-to", "amount-" + amount); | ||||||
| 				MessageM.sendFMessage(tokenPlayer, ConfigC.normal_tokensChangedPerson, "option-added", "playername-" + name, "option2-to", "amount-" + amount); | 				MessageManager.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) { | ||||||
| @@ -68,10 +68,10 @@ public class CMDtokens extends DefaultCMD { | |||||||
| 				} | 				} | ||||||
| 				W.shop.getFile().set(tokenPlayer.getName() + ".tokens", tokens - amount); | 				W.shop.getFile().set(tokenPlayer.getName() + ".tokens", tokens - amount); | ||||||
| 				W.shop.save(); | 				W.shop.save(); | ||||||
| 				MessageM.sendFMessage(player, ConfigC.normal_tokensChanged, "option-Took", "playername-" + tokenPlayer.getName(), "option2-from", "amount-" + amount); | 				MessageManager.sendFMessage(player, ConfigC.normal_tokensChanged, "option-Took", "playername-" + tokenPlayer.getName(), "option2-from", "amount-" + amount); | ||||||
| 				MessageM.sendFMessage(tokenPlayer, ConfigC.normal_tokensChangedPerson, "option-took", "playername-" + name, "option2-from", "amount-" + amount); | 				MessageManager.sendFMessage(tokenPlayer, ConfigC.normal_tokensChangedPerson, "option-took", "playername-" + name, "option2-from", "amount-" + amount); | ||||||
| 			} else { | 			} else { | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_tokensUnknownsetting, "option-" + option); | 				MessageManager.sendFMessage(player, ConfigC.error_tokensUnknownsetting, "option-" + option); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		return true; | 		return true; | ||||||
| @@ -5,7 +5,7 @@ import java.util.List; | |||||||
| 
 | 
 | ||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Material; | import org.bukkit.Material; | ||||||
| import org.bukkit.Sound; | import org.bukkit.Sound; | ||||||
| @@ -21,21 +21,21 @@ public class CMDwand extends DefaultCMD { | |||||||
| 		if (player != null) { | 		if (player != null) { | ||||||
| 			ItemStack wand = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.wandIDname))); | 			ItemStack wand = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.wandIDname))); | ||||||
| 			ItemMeta im = wand.getItemMeta(); | 			ItemMeta im = wand.getItemMeta(); | ||||||
| 			im.setDisplayName(MessageM.replaceAll((String) W.config.get(ConfigC.wandName))); | 			im.setDisplayName(MessageManager.replaceAll((String) W.config.get(ConfigC.wandName))); | ||||||
| 			W.config.load(); | 			W.config.load(); | ||||||
| 			List<String> lores = W.config.getFile().getStringList(ConfigC.wandDescription.location); | 			List<String> lores = W.config.getFile().getStringList(ConfigC.wandDescription.location); | ||||||
| 			List<String> lores2 = new ArrayList<>(); | 			List<String> lores2 = new ArrayList<>(); | ||||||
| 			for (String lore : lores) { | 			for (String lore : lores) { | ||||||
| 				lores2.add(MessageM.replaceAll(lore)); | 				lores2.add(MessageManager.replaceAll(lore)); | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			im.setLore(lores2); | 			im.setLore(lores2); | ||||||
| 			wand.setItemMeta(im); | 			wand.setItemMeta(im); | ||||||
| 			player.getInventory().addItem(wand); | 			player.getInventory().addItem(wand); | ||||||
| 			player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 5, 0); | 			player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 5, 0); | ||||||
| 			MessageM.sendFMessage(player, ConfigC.normal_wandGaveWand, "type-" + wand.getType().toString().replaceAll("_", " ").toLowerCase()); | 			MessageManager.sendFMessage(player, ConfigC.normal_wandGaveWand, "type-" + wand.getType().toString().replaceAll("_", " ").toLowerCase()); | ||||||
| 		} else { | 		} else { | ||||||
| 			MessageM.sendFMessage(player, ConfigC.error_onlyIngame); | 			MessageManager.sendFMessage(player, ConfigC.error_onlyIngame); | ||||||
| 		} | 		} | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
| @@ -10,7 +10,7 @@ package nl.Steffion.BlockHunt.Commands; | |||||||
|  * |  * | ||||||
|  * @author Steffion |  * @author Steffion | ||||||
|  */ |  */ | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.command.Command; | import org.bukkit.command.Command; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -19,7 +19,7 @@ public class DefaultCMD { | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | 	public boolean exectue(Player player, Command cmd, String label, String[] args) { | ||||||
| 		MessageM.sendMessage(player, "%TAG%NExample of a Command!"); | 		MessageManager.sendMessage(player, "%TAG%NExample of a Command!"); | ||||||
| 		// TODO Place the command stuff here. | 		// TODO Place the command stuff here. | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
| @@ -10,7 +10,7 @@ package nl.Steffion.BlockHunt; | |||||||
|  * |  * | ||||||
|  * @author Steffion |  * @author Steffion | ||||||
|  */ |  */ | ||||||
| import nl.Steffion.BlockHunt.Managers.ConfigM; | import nl.Steffion.BlockHunt.Managers.ConfigManager; | ||||||
| 
 | 
 | ||||||
| public enum ConfigC { | public enum ConfigC { | ||||||
| 
 | 
 | ||||||
| @@ -106,7 +106,7 @@ public enum ConfigC { | |||||||
| 			"%TAG%ESorry, the maximum amount of hiders has been reached!", W.messages); | 			"%TAG%ESorry, the maximum amount of hiders has been reached!", W.messages); | ||||||
| 
 | 
 | ||||||
| 	public Object value; | 	public Object value; | ||||||
| 	public ConfigM config; | 	public ConfigManager config; | ||||||
| 	public String location; | 	public String location; | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| @@ -117,7 +117,7 @@ public enum ConfigC { | |||||||
| 	 * @param config | 	 * @param config | ||||||
| 	 *            The config file. | 	 *            The config file. | ||||||
| 	 */ | 	 */ | ||||||
| 	ConfigC(Object value, ConfigM config) { | 	ConfigC(Object value, ConfigManager config) { | ||||||
| 		this.value = value; | 		this.value = value; | ||||||
| 		this.config = config; | 		this.config = config; | ||||||
| 		this.location = this.name().replaceAll("_", "."); | 		this.location = this.name().replaceAll("_", "."); | ||||||
| @@ -4,8 +4,8 @@ import java.util.ArrayList; | |||||||
| import java.util.List; | import java.util.List; | ||||||
| 
 | 
 | ||||||
| import nl.Steffion.BlockHunt.Arena.ArenaType; | import nl.Steffion.BlockHunt.Arena.ArenaType; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| import nl.Steffion.BlockHunt.Managers.PermissionsM; | import nl.Steffion.BlockHunt.Managers.PermissionsManager; | ||||||
| import nl.Steffion.BlockHunt.PermissionsC.Permissions; | import nl.Steffion.BlockHunt.PermissionsC.Permissions; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
| @@ -31,11 +31,11 @@ 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.createInventory(null, 54, MessageM.replaceAll("\u00A7r%N&lBlockHunt Arena: %A" + shorten)); | 			Inventory panel = Bukkit.createInventory(null, 54, MessageManager.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.replaceAll("%NBlockHunt arena: %A" + arena.arenaName)); | 			arenaNameNote_IM.setDisplayName(MessageManager.replaceAll("%NBlockHunt arena: %A" + arena.arenaName)); | ||||||
| 			arenaNameNote.setItemMeta(arenaNameNote_IM); | 			arenaNameNote.setItemMeta(arenaNameNote_IM); | ||||||
| 			panel.setItem(0, arenaNameNote); | 			panel.setItem(0, arenaNameNote); | ||||||
| 
 | 
 | ||||||
| @@ -67,7 +67,7 @@ public class InventoryHandler { | |||||||
| 
 | 
 | ||||||
| 			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.replaceAll("%NSet the %AdisguiseBlocks%N.")); | 			disguiseBlocks_NOTE_IM.setDisplayName(MessageManager.replaceAll("%NSet the %AdisguiseBlocks%N.")); | ||||||
| 			disguiseBlocks_NOTE.setItemMeta(disguiseBlocks_NOTE_IM); | 			disguiseBlocks_NOTE.setItemMeta(disguiseBlocks_NOTE_IM); | ||||||
| 			panel.setItem(36, disguiseBlocks_NOTE); | 			panel.setItem(36, disguiseBlocks_NOTE); | ||||||
| 
 | 
 | ||||||
| @@ -122,14 +122,14 @@ public class InventoryHandler { | |||||||
| 
 | 
 | ||||||
| 			player.openInventory(panel); | 			player.openInventory(panel); | ||||||
| 		} else { | 		} else { | ||||||
| 			MessageM.sendFMessage(player, ConfigC.error_noArena, "name-" + arenaname); | 			MessageManager.sendFMessage(player, ConfigC.error_noArena, "name-" + arenaname); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	public static void updownButton(Inventory panel, Arena arena, ArenaType at, String option, String addremove, ItemStack UP, ItemStack BUTTON, ItemStack DOWN, int up, | 	public static void updownButton(Inventory panel, Arena arena, ArenaType at, String option, String addremove, ItemStack UP, ItemStack BUTTON, ItemStack DOWN, int up, | ||||||
| 			int button, int down) { | 			int button, int down) { | ||||||
| 		ItemMeta UP_IM = UP.getItemMeta(); | 		ItemMeta UP_IM = UP.getItemMeta(); | ||||||
| 		UP_IM.setDisplayName(MessageM.replaceAll((String) W.messages.get(ConfigC.button_add), "1-" + addremove, "2-" + option)); | 		UP_IM.setDisplayName(MessageManager.replaceAll((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; | ||||||
| @@ -170,11 +170,11 @@ public class InventoryHandler { | |||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		ItemMeta BUTTON_IM = BUTTON.getItemMeta(); | 		ItemMeta BUTTON_IM = BUTTON.getItemMeta(); | ||||||
| 		BUTTON_IM.setDisplayName(MessageM.replaceAll((String) W.messages.get(ConfigC.button_setting), "1-" + option, "2-" + setting)); | 		BUTTON_IM.setDisplayName(MessageManager.replaceAll((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((String) W.messages.get(ConfigC.button_remove), "1-" + addremove, "2-" + option)); | 		DOWN_IM.setDisplayName(MessageManager.replaceAll((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); | ||||||
| @@ -184,13 +184,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, MessageM.replaceAll("%N&lDisguiseBlocks")); | 		Inventory panel = Bukkit.createInventory(null, 36, MessageManager.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.replaceAll("%NDisguiseBlocks of arena: %A" + arenaname)); | 		arenaNameNote_IM.setDisplayName(MessageManager.replaceAll("%NDisguiseBlocks of arena: %A" + arenaname)); | ||||||
| 		ArrayList<String> lores = new ArrayList<>(); | 		ArrayList<String> lores = new ArrayList<>(); | ||||||
| 		lores.add(MessageM.replaceAll("%NPlace the DisguiseBlocks inside this inventory.")); | 		lores.add(MessageManager.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); | ||||||
| @@ -203,7 +203,7 @@ public class InventoryHandler { | |||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	public static void openShop(Player player) { | 	public static void openShop(Player player) { | ||||||
| 		Inventory shop = Bukkit.createInventory(null, 9, MessageM.replaceAll("\u00A7r" + W.config.get(ConfigC.shop_title))); | 		Inventory shop = Bukkit.createInventory(null, 9, MessageManager.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(); | ||||||
| @@ -214,40 +214,40 @@ public class InventoryHandler { | |||||||
| 
 | 
 | ||||||
| 		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" + playerTokens)); | 		shopTokens_IM.setDisplayName(MessageManager.replaceAll("%N&lTokens: %A" + playerTokens)); | ||||||
| 		shopTokens.setItemMeta(shopTokens_IM); | 		shopTokens.setItemMeta(shopTokens_IM); | ||||||
| 
 | 
 | ||||||
| 		ItemStack shopBlockChooser = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.shop_blockChooserv1IDname)), 1); | 		ItemStack shopBlockChooser = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.shop_blockChooserv1IDname)), 1); | ||||||
| 		ItemMeta shopBlockChooser_IM = shopBlockChooser.getItemMeta(); | 		ItemMeta shopBlockChooser_IM = shopBlockChooser.getItemMeta(); | ||||||
| 		shopBlockChooser_IM.setDisplayName(MessageM.replaceAll((String) W.config.get(ConfigC.shop_blockChooserv1Name))); | 		shopBlockChooser_IM.setDisplayName(MessageManager.replaceAll((String) W.config.get(ConfigC.shop_blockChooserv1Name))); | ||||||
| 		lores = W.config.getFile().getStringList(ConfigC.shop_blockChooserv1Description.location); | 		lores = W.config.getFile().getStringList(ConfigC.shop_blockChooserv1Description.location); | ||||||
| 		lores2 = new ArrayList<>(); | 		lores2 = new ArrayList<>(); | ||||||
| 		for (String lore : lores) { | 		for (String lore : lores) { | ||||||
| 			lores2.add(MessageM.replaceAll(lore)); | 			lores2.add(MessageManager.replaceAll(lore)); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		lores2.add(MessageM.replaceAll((String) W.config.get(ConfigC.shop_price), "amount-" + W.config.get(ConfigC.shop_blockChooserv1Price))); | 		lores2.add(MessageManager.replaceAll((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(Material.getMaterial((String) W.config.get(ConfigC.shop_BlockHuntPassv2IDName)), 1); | 		ItemStack shopBlockHuntPass = new ItemStack(Material.getMaterial((String) W.config.get(ConfigC.shop_BlockHuntPassv2IDName)), 1); | ||||||
| 		ItemMeta shopBlockHuntPass_IM = shopBlockHuntPass.getItemMeta(); | 		ItemMeta shopBlockHuntPass_IM = shopBlockHuntPass.getItemMeta(); | ||||||
| 		shopBlockHuntPass_IM.setDisplayName(MessageM.replaceAll((String) W.config.get(ConfigC.shop_BlockHuntPassv2Name))); | 		shopBlockHuntPass_IM.setDisplayName(MessageManager.replaceAll((String) W.config.get(ConfigC.shop_BlockHuntPassv2Name))); | ||||||
| 		lores = W.config.getFile().getStringList(ConfigC.shop_BlockHuntPassv2Description.location); | 		lores = W.config.getFile().getStringList(ConfigC.shop_BlockHuntPassv2Description.location); | ||||||
| 		lores2 = new ArrayList<>(); | 		lores2 = new ArrayList<>(); | ||||||
| 		for (String lore : lores) { | 		for (String lore : lores) { | ||||||
| 			lores2.add(MessageM.replaceAll(lore)); | 			lores2.add(MessageManager.replaceAll(lore)); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		lores2.add(MessageM.replaceAll((String) W.config.get(ConfigC.shop_price), "amount-" + W.config.get(ConfigC.shop_BlockHuntPassv2Price))); | 		lores2.add(MessageManager.replaceAll((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) | 		if ((Boolean) W.config.get(ConfigC.shop_blockChooserv1Enabled) | ||||||
| 				&& (W.shop.getFile().get(player.getName() + ".blockchooser") == null && !PermissionsM.hasPerm(player, Permissions.shopblockchooser, false))) { | 				&& (W.shop.getFile().get(player.getName() + ".blockchooser") == null && !PermissionsManager.hasPerm(player, Permissions.shopblockchooser, false))) { | ||||||
| 			shop.setItem(1, shopBlockChooser); | 			shop.setItem(1, shopBlockChooser); | ||||||
| 		} | 		} | ||||||
| 		if ((Boolean) W.config.get(ConfigC.shop_BlockHuntPassv2Enabled)) { | 		if ((Boolean) W.config.get(ConfigC.shop_BlockHuntPassv2Enabled)) { | ||||||
| @@ -10,7 +10,7 @@ import nl.Steffion.BlockHunt.Arena.ArenaState; | |||||||
| import nl.Steffion.BlockHunt.ArenaHandler; | import nl.Steffion.BlockHunt.ArenaHandler; | ||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.apache.commons.lang.StringUtils; | import org.apache.commons.lang.StringUtils; | ||||||
| import org.bukkit.GameMode; | import org.bukkit.GameMode; | ||||||
| @@ -107,7 +107,7 @@ public class OnEntityDamageByEntityEvent implements Listener { | |||||||
| 							W.shop.getFile().set(damager.getName() + ".tokens", damagerTokens + arena.killTokens); | 							W.shop.getFile().set(damager.getName() + ".tokens", damagerTokens + arena.killTokens); | ||||||
| 							W.shop.save(); | 							W.shop.save(); | ||||||
| 
 | 
 | ||||||
| 							MessageM.sendFMessage(damager, ConfigC.normal_addedToken, "amount-" + arena.killTokens); | 							MessageManager.sendFMessage(damager, ConfigC.normal_addedToken, "amount-" + arena.killTokens); | ||||||
| 
 | 
 | ||||||
| 							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); | ||||||
| @@ -118,7 +118,7 @@ public class OnEntityDamageByEntityEvent implements Listener { | |||||||
| 							W.shop.getFile().set(player.getName() + ".tokens", playerTokens + (int) addingTokens); | 							W.shop.getFile().set(player.getName() + ".tokens", playerTokens + (int) addingTokens); | ||||||
| 							W.shop.save(); | 							W.shop.save(); | ||||||
| 
 | 
 | ||||||
| 							MessageM.sendFMessage(player, ConfigC.normal_addedToken, "amount-" + (int) addingTokens); | 							MessageManager.sendFMessage(player, ConfigC.normal_addedToken, "amount-" + (int) addingTokens); | ||||||
| 
 | 
 | ||||||
| 							arena.seekers.add(player); | 							arena.seekers.add(player); | ||||||
| 							player.setWalkSpeed(0.3F); | 							player.setWalkSpeed(0.3F); | ||||||
| @@ -6,7 +6,7 @@ import nl.Steffion.BlockHunt.ArenaHandler; | |||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.InventoryHandler; | import nl.Steffion.BlockHunt.InventoryHandler; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
| import org.bukkit.Material; | import org.bukkit.Material; | ||||||
| @@ -41,7 +41,7 @@ public class OnInventoryClickEvent implements Listener { | |||||||
| 					if (!event.getCurrentItem().getType().isBlock()) { | 					if (!event.getCurrentItem().getType().isBlock()) { | ||||||
| 						if (!event.getCurrentItem().getType().equals(Material.FLOWER_POT_ITEM)) { | 						if (!event.getCurrentItem().getType().equals(Material.FLOWER_POT_ITEM)) { | ||||||
| 							event.setCancelled(true); | 							event.setCancelled(true); | ||||||
| 							MessageM.sendFMessage(player, ConfigC.error_setNotABlock); | 							MessageManager.sendFMessage(player, ConfigC.error_setNotABlock); | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| @@ -54,7 +54,7 @@ public class OnInventoryClickEvent implements Listener { | |||||||
| 				return; | 				return; | ||||||
| 
 | 
 | ||||||
| 			if (inv.getName().startsWith("\u00A7r")) { | 			if (inv.getName().startsWith("\u00A7r")) { | ||||||
| 				if (inv.getName().equals(MessageM.replaceAll("\u00A7r" + W.config.get(ConfigC.shop_title)))) { | 				if (inv.getName().equals(MessageManager.replaceAll("\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) { | ||||||
| @@ -68,16 +68,16 @@ public class OnInventoryClickEvent implements Listener { | |||||||
| 						return; | 						return; | ||||||
| 					if (item.getItemMeta().getDisplayName() == null) | 					if (item.getItemMeta().getDisplayName() == null) | ||||||
| 						return; | 						return; | ||||||
| 					if (item.getItemMeta().getDisplayName().equals(MessageM.replaceAll(W.config.get(ConfigC.shop_blockChooserv1Name).toString()))) { | 					if (item.getItemMeta().getDisplayName().equals(MessageManager.replaceAll(W.config.get(ConfigC.shop_blockChooserv1Name).toString()))) { | ||||||
| 						if (playerTokens >= (Integer) W.config.get(ConfigC.shop_blockChooserv1Price)) { | 						if (playerTokens >= (Integer) W.config.get(ConfigC.shop_blockChooserv1Price)) { | ||||||
| 							W.shop.getFile().set(player.getName() + ".blockchooser", true); | 							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.getFile().set(player.getName() + ".tokens", playerTokens - (Integer) W.config.get(ConfigC.shop_blockChooserv1Price)); | ||||||
| 							W.shop.save(); | 							W.shop.save(); | ||||||
| 							MessageM.sendFMessage(player, ConfigC.normal_shopBoughtItem, "itemname-" + W.config.get(ConfigC.shop_blockChooserv1Name)); | 							MessageManager.sendFMessage(player, ConfigC.normal_shopBoughtItem, "itemname-" + W.config.get(ConfigC.shop_blockChooserv1Name)); | ||||||
| 						} else { | 						} else { | ||||||
| 							MessageM.sendFMessage(player, ConfigC.error_shopNeedMoreTokens); | 							MessageManager.sendFMessage(player, ConfigC.error_shopNeedMoreTokens); | ||||||
| 						} | 						} | ||||||
| 					} else if (item.getItemMeta().getDisplayName().equals(MessageM.replaceAll(W.config.get(ConfigC.shop_BlockHuntPassv2Name).toString()))) { | 					} else if (item.getItemMeta().getDisplayName().equals(MessageManager.replaceAll(W.config.get(ConfigC.shop_BlockHuntPassv2Name).toString()))) { | ||||||
| 						if (playerTokens >= (Integer) W.config.get(ConfigC.shop_BlockHuntPassv2Price)) { | 						if (playerTokens >= (Integer) W.config.get(ConfigC.shop_BlockHuntPassv2Price)) { | ||||||
| 							if (W.shop.getFile().get(player.getName() + ".blockhuntpass") == null) { | 							if (W.shop.getFile().get(player.getName() + ".blockhuntpass") == null) { | ||||||
| 								W.shop.getFile().set(player.getName() + ".blockhuntpass", 0); | 								W.shop.getFile().set(player.getName() + ".blockhuntpass", 0); | ||||||
| @@ -87,25 +87,25 @@ public class OnInventoryClickEvent implements Listener { | |||||||
| 							W.shop.getFile().set(player.getName() + ".blockhuntpass", (Integer) W.shop.getFile().get(player.getName() + ".blockhuntpass") + 1); | 							W.shop.getFile().set(player.getName() + ".blockhuntpass", (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.getFile().set(player.getName() + ".tokens", playerTokens - (Integer) W.config.get(ConfigC.shop_BlockHuntPassv2Price)); | ||||||
| 							W.shop.save(); | 							W.shop.save(); | ||||||
| 							MessageM.sendFMessage(player, ConfigC.normal_shopBoughtItem, "itemname-" + W.config.get(ConfigC.shop_BlockHuntPassv2Name)); | 							MessageManager.sendFMessage(player, ConfigC.normal_shopBoughtItem, "itemname-" + W.config.get(ConfigC.shop_BlockHuntPassv2Name)); | ||||||
| 						} else { | 						} else { | ||||||
| 							MessageM.sendFMessage(player, ConfigC.error_shopNeedMoreTokens); | 							MessageManager.sendFMessage(player, ConfigC.error_shopNeedMoreTokens); | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					InventoryHandler.openShop(player); | 					InventoryHandler.openShop(player); | ||||||
| 				} else if (inv.getName().contains(MessageM.replaceAll((String) W.config.get(ConfigC.shop_blockChooserv1Name)))) { | 				} else if (inv.getName().contains(MessageManager.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(player, ConfigC.normal_shopChoosenBlock, "block-" | 							MessageManager.sendFMessage(player, ConfigC.normal_shopChoosenBlock, "block-" | ||||||
| 									+ event.getCurrentItem().getType().toString().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase()); | 									+ event.getCurrentItem().getType().toString().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase()); | ||||||
| 						} else { | 						} else { | ||||||
| 							MessageM.sendFMessage(player, ConfigC.error_setNotABlock); | 							MessageManager.sendFMessage(player, ConfigC.error_setNotABlock); | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 				} else if (inv.getName().contains(MessageM.replaceAll((String) W.config.get(ConfigC.shop_BlockHuntPassv2Name)))) { | 				} else if (inv.getName().contains(MessageManager.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().equals(Material.WOOL) && event.getCurrentItem().getDurability() == (short) 11) { | 						if (event.getCurrentItem().getType().equals(Material.WOOL) && event.getCurrentItem().getDurability() == (short) 11) { | ||||||
| @@ -122,12 +122,12 @@ public class OnInventoryClickEvent implements Listener { | |||||||
| 								} | 								} | ||||||
| 
 | 
 | ||||||
| 								if (i >= arena.amountSeekersOnStart) { | 								if (i >= arena.amountSeekersOnStart) { | ||||||
| 									MessageM.sendFMessage(player, ConfigC.error_shopMaxSeekersReached); | 									MessageManager.sendFMessage(player, ConfigC.error_shopMaxSeekersReached); | ||||||
| 								} else { | 								} else { | ||||||
| 									W.choosenSeeker.put(player, true); | 									W.choosenSeeker.put(player, true); | ||||||
| 									player.getInventory().setItemInHand(new ItemStack(Material.AIR)); | 									player.getInventory().setItemInHand(new ItemStack(Material.AIR)); | ||||||
| 									player.updateInventory(); | 									player.updateInventory(); | ||||||
| 									MessageM.sendFMessage(player, ConfigC.normal_shopChoosenSeeker); | 									MessageManager.sendFMessage(player, ConfigC.normal_shopChoosenSeeker); | ||||||
| 									inv.clear(); | 									inv.clear(); | ||||||
| 									if (W.shop.getFile().getInt(player.getName() + ".blockhuntpass") == 1) { | 									if (W.shop.getFile().getInt(player.getName() + ".blockhuntpass") == 1) { | ||||||
| 										W.shop.getFile().set(player.getName() + ".blockhuntpass", null); | 										W.shop.getFile().set(player.getName() + ".blockhuntpass", null); | ||||||
| @@ -153,12 +153,12 @@ public class OnInventoryClickEvent implements Listener { | |||||||
| 								} | 								} | ||||||
| 
 | 
 | ||||||
| 								if (i >= (arena.playersInArena.size() - 1)) { | 								if (i >= (arena.playersInArena.size() - 1)) { | ||||||
| 									MessageM.sendFMessage(player, ConfigC.error_shopMaxHidersReached); | 									MessageManager.sendFMessage(player, ConfigC.error_shopMaxHidersReached); | ||||||
| 								} else { | 								} else { | ||||||
| 									W.choosenSeeker.put(player, false); | 									W.choosenSeeker.put(player, false); | ||||||
| 									player.getInventory().setItemInHand(new ItemStack(Material.AIR)); | 									player.getInventory().setItemInHand(new ItemStack(Material.AIR)); | ||||||
| 									player.updateInventory(); | 									player.updateInventory(); | ||||||
| 									MessageM.sendFMessage(player, ConfigC.normal_shopChoosenHiders); | 									MessageManager.sendFMessage(player, ConfigC.normal_shopChoosenHiders); | ||||||
| 									inv.clear(); | 									inv.clear(); | ||||||
| 									if (W.shop.getFile().getInt(player.getName() + ".blockhuntpass") == 1) { | 									if (W.shop.getFile().getInt(player.getName() + ".blockhuntpass") == 1) { | ||||||
| 										W.shop.getFile().set(player.getName() + ".blockhuntpass", null); | 										W.shop.getFile().set(player.getName() + ".blockhuntpass", null); | ||||||
| @@ -174,7 +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.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageM.replaceAll("%NBlockHunt arena: %A"), ""); | 					String arenaname = inv.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageManager.replaceAll("%NBlockHunt arena: %A"), ""); | ||||||
| 
 | 
 | ||||||
| 					Arena arena = null; | 					Arena arena = null; | ||||||
| 					for (Arena arena2 : W.arenaList) { | 					for (Arena arena2 : W.arenaList) { | ||||||
| @@ -272,7 +272,7 @@ public class OnInventoryClickEvent implements Listener { | |||||||
| 					break; | 					break; | ||||||
| 				} | 				} | ||||||
| 			} else { | 			} else { | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_setTooHighNumber, "max-" + max); | 				MessageManager.sendFMessage(player, ConfigC.error_setTooHighNumber, "max-" + max); | ||||||
| 			} | 			} | ||||||
| 		} else if (item.getItemMeta().getDisplayName().contains((String) W.messages.get(ConfigC.button_remove2))) { | 		} else if (item.getItemMeta().getDisplayName().contains((String) W.messages.get(ConfigC.button_remove2))) { | ||||||
| 			if (option > min) { | 			if (option > min) { | ||||||
| @@ -312,7 +312,7 @@ public class OnInventoryClickEvent implements Listener { | |||||||
| 					break; | 					break; | ||||||
| 				} | 				} | ||||||
| 			} else { | 			} else { | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_setTooLowNumber, "min-" + min); | 				MessageManager.sendFMessage(player, ConfigC.error_setTooLowNumber, "min-" + min); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| @@ -5,7 +5,7 @@ import java.util.ArrayList; | |||||||
| import nl.Steffion.BlockHunt.Arena; | import nl.Steffion.BlockHunt.Arena; | ||||||
| import nl.Steffion.BlockHunt.ArenaHandler; | import nl.Steffion.BlockHunt.ArenaHandler; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Material; | import org.bukkit.Material; | ||||||
| import org.bukkit.event.EventHandler; | import org.bukkit.event.EventHandler; | ||||||
| @@ -23,7 +23,7 @@ public class OnInventoryCloseEvent implements Listener { | |||||||
| 		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.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageM.replaceAll("%NDisguiseBlocks of arena: %A"), ""); | 				String arenaname = inv.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageManager.replaceAll("%NDisguiseBlocks of arena: %A"), ""); | ||||||
| 
 | 
 | ||||||
| 				Arena arena = null; | 				Arena arena = null; | ||||||
| 				for (Arena arena2 : W.arenaList) { | 				for (Arena arena2 : W.arenaList) { | ||||||
| @@ -5,8 +5,8 @@ import nl.Steffion.BlockHunt.ArenaHandler; | |||||||
| import nl.Steffion.BlockHunt.ConfigC; | import nl.Steffion.BlockHunt.ConfigC; | ||||||
| import nl.Steffion.BlockHunt.PermissionsC.Permissions; | import nl.Steffion.BlockHunt.PermissionsC.Permissions; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| import nl.Steffion.BlockHunt.Managers.PermissionsM; | import nl.Steffion.BlockHunt.Managers.PermissionsManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| import org.bukkit.event.EventHandler; | import org.bukkit.event.EventHandler; | ||||||
| @@ -37,11 +37,11 @@ public class OnPlayerCommandPreprocessEvent implements Listener { | |||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				if (PermissionsM.hasPerm(player, Permissions.allcommands, false)) { | 				if (PermissionsManager.hasPerm(player, Permissions.allcommands, false)) { | ||||||
| 					return; | 					return; | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				MessageM.sendFMessage(player, ConfigC.warning_unableToCommand); | 				MessageManager.sendFMessage(player, ConfigC.warning_unableToCommand); | ||||||
| 				event.setCancelled(true); | 				event.setCancelled(true); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| @@ -9,9 +9,8 @@ import nl.Steffion.BlockHunt.PermissionsC.Permissions; | |||||||
| import nl.Steffion.BlockHunt.SignsHandler; | import nl.Steffion.BlockHunt.SignsHandler; | ||||||
| import nl.Steffion.BlockHunt.SolidBlockHandler; | import nl.Steffion.BlockHunt.SolidBlockHandler; | ||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| import nl.Steffion.BlockHunt.Managers.PermissionsM; | import nl.Steffion.BlockHunt.Managers.PermissionsManager; | ||||||
| import nl.Steffion.BlockHunt.Serializables.LocationSerializable; |  | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
| import org.bukkit.Location; | import org.bukkit.Location; | ||||||
| @@ -35,19 +34,19 @@ public class OnPlayerInteractEvent implements Listener { | |||||||
| 	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(); | ||||||
| 		if (PermissionsM.hasPerm(player, Permissions.create, false)) { | 		if (PermissionsManager.hasPerm(player, Permissions.create, false)) { | ||||||
| 			ItemStack item = player.getInventory().getItemInMainHand(); | 			ItemStack item = player.getInventory().getItemInMainHand(); | ||||||
| 			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(MessageM.replaceAll((String) W.config.get(ConfigC.wandName)))) { | 					if (im.getDisplayName().equals(MessageManager.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(event.getClickedBlock().getLocation()); | 							Location location = 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 || !W.pos1.get(player).equals(location)) { | 								if (W.pos1.get(player) == null || !W.pos1.get(player).equals(location)) { | ||||||
| 									MessageM.sendFMessage(player, ConfigC.normal_wandSetPosition, "number-1", | 									MessageManager.sendFMessage(player, ConfigC.normal_wandSetPosition, "number-1", | ||||||
| 											"pos-%N(%A" + location.getBlockX() + "%N, %A" + location.getBlockY() + "%N, %A" + location.getBlockZ() + "%N)", "x-" | 											"pos-%N(%A" + location.getBlockX() + "%N, %A" + location.getBlockY() + "%N, %A" + location.getBlockZ() + "%N)", "x-" | ||||||
| 													+ location.getBlockX(), "y-" + location.getBlockY(), "z-" + location.getBlockZ()); | 													+ location.getBlockX(), "y-" + location.getBlockY(), "z-" + location.getBlockZ()); | ||||||
| 									W.pos1.put(player, location); | 									W.pos1.put(player, location); | ||||||
| @@ -55,7 +54,7 @@ public class OnPlayerInteractEvent implements Listener { | |||||||
| 							} 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 || !W.pos2.get(player).equals(location)) { | 								if (W.pos2.get(player) == null || !W.pos2.get(player).equals(location)) { | ||||||
| 									MessageM.sendFMessage(player, ConfigC.normal_wandSetPosition, "number-2", | 									MessageManager.sendFMessage(player, ConfigC.normal_wandSetPosition, "number-2", | ||||||
| 											"pos-%N(%A" + location.getBlockX() + "%N, %A" + location.getBlockY() + "%N, %A" + location.getBlockZ() + "%N)", "x-" | 											"pos-%N(%A" + location.getBlockX() + "%N, %A" + location.getBlockY() + "%N, %A" + location.getBlockZ() + "%N)", "x-" | ||||||
| 													+ location.getBlockX(), "y-" + location.getBlockY(), "z-" + location.getBlockZ()); | 													+ location.getBlockX(), "y-" + location.getBlockY(), "z-" + location.getBlockZ()); | ||||||
| 									W.pos2.put(player, location); | 									W.pos2.put(player, location); | ||||||
| @@ -70,21 +69,21 @@ 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().equals(Material.SIGN_POST) || event.getClickedBlock().getType().equals(Material.WALL_SIGN)) { | 				if (event.getClickedBlock().getType().equals(Material.SIGN_POST) || event.getClickedBlock().getType().equals(Material.WALL_SIGN)) { | ||||||
| 					if (SignsHandler.isSign(new LocationSerializable(event.getClickedBlock().getLocation()))) { | 					if (SignsHandler.isSign(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).equals(MessageM.replaceAll(W.config.getFile().getStringList(ConfigC.sign_LEAVE.location).get(1)))) { | 							if (sign.getLine(1).equals(MessageManager.replaceAll(W.config.getFile().getStringList(ConfigC.sign_LEAVE.location).get(1)))) { | ||||||
| 								if (PermissionsM.hasPerm(player, Permissions.joinsign, true)) { | 								if (PermissionsManager.hasPerm(player, Permissions.joinsign, true)) { | ||||||
| 									ArenaHandler.playerLeaveArena(player, true, true); | 									ArenaHandler.playerLeaveArena(player, true, true); | ||||||
| 								} | 								} | ||||||
| 							} else if (sign.getLine(1).equals(MessageM.replaceAll(W.config.getFile().getStringList(ConfigC.sign_SHOP.location).get(1)))) { | 							} else if (sign.getLine(1).equals(MessageManager.replaceAll(W.config.getFile().getStringList(ConfigC.sign_SHOP.location).get(1)))) { | ||||||
| 								if (PermissionsM.hasPerm(player, Permissions.shop, true)) { | 								if (PermissionsManager.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].contains(arena.arenaName)) { | 									if (sign.getLines()[1].contains(arena.arenaName)) { | ||||||
| 										if (PermissionsM.hasPerm(player, Permissions.joinsign, true)) { | 										if (PermissionsManager.hasPerm(player, Permissions.joinsign, true)) { | ||||||
| 											ArenaHandler.playerJoinArena(player, arena.arenaName); | 											ArenaHandler.playerJoinArena(player, arena.arenaName); | ||||||
| 										} | 										} | ||||||
| 									} | 									} | ||||||
| @@ -135,8 +134,8 @@ public class OnPlayerInteractEvent implements Listener { | |||||||
| 				ItemStack item = player.getInventory().getItemInMainHand(); | 				ItemStack item = player.getInventory().getItemInMainHand(); | ||||||
| 				if (item.getType() != Material.AIR) { | 				if (item.getType() != Material.AIR) { | ||||||
| 					if (item.getItemMeta().getDisplayName() != null) { | 					if (item.getItemMeta().getDisplayName() != null) { | ||||||
| 						if (item.getItemMeta().getDisplayName().equals(MessageM.replaceAll((String) W.config.get(ConfigC.shop_blockChooserv1Name)))) { | 						if (item.getItemMeta().getDisplayName().equals(MessageManager.replaceAll((String) W.config.get(ConfigC.shop_blockChooserv1Name)))) { | ||||||
| 							Inventory blockChooser = Bukkit.createInventory(null, 36, MessageM.replaceAll("\u00A7r" + W.config.get(ConfigC.shop_blockChooserv1Name))); | 							Inventory blockChooser = Bukkit.createInventory(null, 36, MessageManager.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, arena.disguiseBlocks.get(i - 1)); | 									blockChooser.setItem(i - 1, arena.disguiseBlocks.get(i - 1)); | ||||||
| @@ -146,16 +145,16 @@ public class OnPlayerInteractEvent implements Listener { | |||||||
| 							player.openInventory(blockChooser); | 							player.openInventory(blockChooser); | ||||||
| 						} | 						} | ||||||
| 
 | 
 | ||||||
| 						if (item.getItemMeta().getDisplayName().equals(MessageM.replaceAll((String) W.config.get(ConfigC.shop_BlockHuntPassv2Name)))) { | 						if (item.getItemMeta().getDisplayName().equals(MessageManager.replaceAll((String) W.config.get(ConfigC.shop_BlockHuntPassv2Name)))) { | ||||||
| 							Inventory BlockHuntPass = Bukkit.createInventory(null, 9, MessageM.replaceAll("\u00A7r" + W.config.get(ConfigC.shop_BlockHuntPassv2Name))); | 							Inventory BlockHuntPass = Bukkit.createInventory(null, 9, MessageManager.replaceAll("\u00A7r" + W.config.get(ConfigC.shop_BlockHuntPassv2Name))); | ||||||
| 							ItemStack BlockHuntPassSEEKER = new ItemStack(Material.WOOL, 1, (short) 11); | 							ItemStack BlockHuntPassSEEKER = new ItemStack(Material.WOOL, 1, (short) 11); | ||||||
| 							ItemMeta BlockHuntPassIM = BlockHuntPassSEEKER.getItemMeta(); | 							ItemMeta BlockHuntPassIM = BlockHuntPassSEEKER.getItemMeta(); | ||||||
| 							BlockHuntPassIM.setDisplayName(MessageM.replaceAll("&eSEEKER")); | 							BlockHuntPassIM.setDisplayName(MessageManager.replaceAll("&eSEEKER")); | ||||||
| 							BlockHuntPassSEEKER.setItemMeta(BlockHuntPassIM); | 							BlockHuntPassSEEKER.setItemMeta(BlockHuntPassIM); | ||||||
| 							BlockHuntPass.setItem(1, BlockHuntPassSEEKER); | 							BlockHuntPass.setItem(1, BlockHuntPassSEEKER); | ||||||
| 
 | 
 | ||||||
| 							ItemStack BlockHuntPassHIDER = new ItemStack(Material.WOOL, 1, (short) 14); | 							ItemStack BlockHuntPassHIDER = new ItemStack(Material.WOOL, 1, (short) 14); | ||||||
| 							BlockHuntPassIM.setDisplayName(MessageM.replaceAll("&eHIDER")); | 							BlockHuntPassIM.setDisplayName(MessageManager.replaceAll("&eHIDER")); | ||||||
| 							BlockHuntPassHIDER.setItemMeta(BlockHuntPassIM); | 							BlockHuntPassHIDER.setItemMeta(BlockHuntPassIM); | ||||||
| 							BlockHuntPass.setItem(7, BlockHuntPassHIDER); | 							BlockHuntPass.setItem(7, BlockHuntPassHIDER); | ||||||
| 
 | 
 | ||||||
| @@ -3,8 +3,7 @@ package nl.Steffion.BlockHunt.Listeners; | |||||||
| import nl.Steffion.BlockHunt.BlockHunt; | import nl.Steffion.BlockHunt.BlockHunt; | ||||||
| import nl.Steffion.BlockHunt.PermissionsC.Permissions; | import nl.Steffion.BlockHunt.PermissionsC.Permissions; | ||||||
| import nl.Steffion.BlockHunt.SignsHandler; | import nl.Steffion.BlockHunt.SignsHandler; | ||||||
| import nl.Steffion.BlockHunt.Managers.PermissionsM; | import nl.Steffion.BlockHunt.Managers.PermissionsManager; | ||||||
| import nl.Steffion.BlockHunt.Serializables.LocationSerializable; |  | ||||||
| 
 | 
 | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| import org.bukkit.event.EventHandler; | import org.bukkit.event.EventHandler; | ||||||
| @@ -20,8 +19,8 @@ public class OnSignChangeEvent implements Listener { | |||||||
| 		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 (PermissionsManager.hasPerm(player, Permissions.signcreate, true)) { | ||||||
| 					SignsHandler.createSign(event, lines, new LocationSerializable(event.getBlock().getLocation())); | 					SignsHandler.createSign(event, lines, event.getBlock().getLocation()); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| @@ -17,7 +17,7 @@ import nl.Steffion.BlockHunt.PermissionsC.Permissions; | |||||||
| import nl.Steffion.BlockHunt.W; | import nl.Steffion.BlockHunt.W; | ||||||
| import nl.Steffion.BlockHunt.Commands.DefaultCMD; | import nl.Steffion.BlockHunt.Commands.DefaultCMD; | ||||||
| 
 | 
 | ||||||
| public class CommandM { | public class CommandManager { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	public String name; | 	public String name; | ||||||
| @@ -31,8 +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, Permissions permission, ConfigC help, Boolean enabled, List<String> mainTABlist, | 	public CommandManager(String name, String label, String args, String argsalias, Permissions permission, ConfigC help, Boolean enabled, List<String> mainTABlist, | ||||||
| 			DefaultCMD CMD, String usage) { | 						  DefaultCMD CMD, String usage) { | ||||||
| 		this.name = name; | 		this.name = name; | ||||||
| 		this.label = label; | 		this.label = label; | ||||||
| 		this.args = args; | 		this.args = args; | ||||||
| @@ -20,14 +20,14 @@ import org.bukkit.configuration.ConfigurationSection; | |||||||
| import org.bukkit.configuration.file.FileConfiguration; | import org.bukkit.configuration.file.FileConfiguration; | ||||||
| import org.bukkit.configuration.file.YamlConfiguration; | import org.bukkit.configuration.file.YamlConfiguration; | ||||||
| 
 | 
 | ||||||
| public class ConfigM { | public class ConfigManager { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	String fileName; | 	private String fileName; | ||||||
| 	File file; | 	private File file; | ||||||
| 	FileConfiguration fileC; | 	private FileConfiguration fileC; | ||||||
| 	ConfigurationSection fileCS; | 	private ConfigurationSection fileCS; | ||||||
| 	String fileLocation; | 	private File fileLocation; | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| 	 * Use this class to create an automated config file. | 	 * Use this class to create an automated config file. | ||||||
| @@ -35,10 +35,10 @@ public class ConfigM { | |||||||
| 	 * @param fileName | 	 * @param fileName | ||||||
| 	 *            Name of the file. | 	 *            Name of the file. | ||||||
| 	 */ | 	 */ | ||||||
| 	public ConfigM(String fileName) { | 	public ConfigManager(String fileName) { | ||||||
| 		this.fileName = fileName; | 		this.fileName = fileName; | ||||||
| 		this.file = new File("plugins/" + BlockHunt.pdfFile.getName(), fileName + ".yml"); | 		this.file = new File(BlockHunt.plugin.getDataFolder(), fileName + ".yml"); | ||||||
| 		this.fileLocation = BlockHunt.pdfFile.getName(); | 		this.fileLocation = BlockHunt.plugin.getDataFolder(); | ||||||
| 		this.fileC = new YamlConfiguration(); | 		this.fileC = new YamlConfiguration(); | ||||||
| 		this.checkFile(); | 		this.checkFile(); | ||||||
| 		this.fileCS = fileC.getConfigurationSection(""); | 		this.fileCS = fileC.getConfigurationSection(""); | ||||||
| @@ -50,13 +50,14 @@ public class ConfigM { | |||||||
| 	 *  | 	 *  | ||||||
| 	 * @param fileName | 	 * @param fileName | ||||||
| 	 *            Name of the file. | 	 *            Name of the file. | ||||||
| 	 * @param fileLocation | 	 * @param subdirectory | ||||||
| 	 *            Sub-Location of the file. | 	 *            Sub-Location of the file. | ||||||
| 	 */ | 	 */ | ||||||
| 	public ConfigM(String fileName, String fileLocation) { | 	public ConfigManager(String fileName, String subdirectory) { | ||||||
| 		this.fileName = fileName; | 		this.fileName = fileName; | ||||||
| 		this.file = new File("plugins/" + BlockHunt.pdfFile.getName() + "/" + fileLocation, fileName + ".yml"); | 		File directory = new File( BlockHunt.plugin.getDataFolder() , subdirectory ); | ||||||
| 		this.fileLocation = BlockHunt.pdfFile.getName() + "/" + fileLocation; | 		this.file = new File( directory,fileName + ".yml"); | ||||||
|  | 		this.fileLocation = directory; | ||||||
| 		this.fileC = new YamlConfiguration(); | 		this.fileC = new YamlConfiguration(); | ||||||
| 		this.checkFile(); | 		this.checkFile(); | ||||||
| 		this.fileCS = fileC.getConfigurationSection(""); | 		this.fileCS = fileC.getConfigurationSection(""); | ||||||
| @@ -68,9 +69,9 @@ public class ConfigM { | |||||||
| 	 * console. | 	 * console. | ||||||
| 	 */ | 	 */ | ||||||
| 	public static void newFiles() { | 	public static void newFiles() { | ||||||
| 		ConfigM.setDefaults(); | 		ConfigManager.setDefaults(); | ||||||
| 		for (String fileName : W.newFiles) { | 		for (String fileName : W.newFiles) { | ||||||
| 			MessageM.sendMessage(null, "%TAG%WCouldn't find '%A%fileName%.yml%W' creating new one.", "fileName-" + fileName); | 			MessageManager.sendMessage(null, "%TAG%WCouldn't find '%A%fileName%.yml%W' creating new one.", "fileName-" + fileName); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		W.newFiles.clear(); | 		W.newFiles.clear(); | ||||||
| @@ -97,11 +98,10 @@ public class ConfigM { | |||||||
| 			try { | 			try { | ||||||
| 				this.file.getParentFile().mkdirs(); | 				this.file.getParentFile().mkdirs(); | ||||||
| 				this.file.createNewFile(); | 				this.file.createNewFile(); | ||||||
| 				if (this.fileLocation.equals(BlockHunt.pdfFile.getName())) { | 				if(file.exists()) { | ||||||
| 					W.newFiles.add(this.fileName); | 					W.newFiles.add(this.fileName); | ||||||
| 				} else { |  | ||||||
| 					W.newFiles.add(this.fileLocation + this.fileName); |  | ||||||
| 				} | 				} | ||||||
|  | 
 | ||||||
| 			} catch (Exception e) { | 			} catch (Exception e) { | ||||||
| 				e.printStackTrace(); | 				e.printStackTrace(); | ||||||
| 			} | 			} | ||||||
| @@ -6,7 +6,7 @@ import nl.Steffion.BlockHunt.W; | |||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| 
 | 
 | ||||||
| public class MessageM { | public class MessageManager { | ||||||
| 	/** | 	/** | ||||||
| 	 * Steffion's Engine - Made by Steffion. | 	 * Steffion's Engine - Made by Steffion. | ||||||
| 	 *  | 	 *  | ||||||
| @@ -33,9 +33,9 @@ public class MessageM { | |||||||
| 	 */ | 	 */ | ||||||
| 	public static void sendMessage(Player player, String message, String... vars) { | 	public static void sendMessage(Player player, String message, String... vars) { | ||||||
| 		if (player == null) { | 		if (player == null) { | ||||||
| 			Bukkit.getConsoleSender().sendMessage(MessageM.replaceAll(message.replaceAll("%player%", "Console"), vars)); | 			Bukkit.getConsoleSender().sendMessage(MessageManager.replaceAll(message.replaceAll("%player%", "Console"), vars)); | ||||||
| 		} else { | 		} else { | ||||||
| 			player.sendMessage(MessageM.replaceAll(message.replaceAll("%player%", player.getDisplayName()), vars)); | 			player.sendMessage(MessageManager.replaceAll(message.replaceAll("%player%", player.getDisplayName()), vars)); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| @@ -54,9 +54,9 @@ public class MessageM { | |||||||
| 	public static void sendFMessage(Player player, ConfigC location, String... vars) { | 	public static void sendFMessage(Player player, ConfigC location, String... vars) { | ||||||
| 		if (player == null) { | 		if (player == null) { | ||||||
| 			Bukkit.getConsoleSender().sendMessage( | 			Bukkit.getConsoleSender().sendMessage( | ||||||
| 					MessageM.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", "Console"), vars)); | 					MessageManager.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", "Console"), vars)); | ||||||
| 		} else { | 		} else { | ||||||
| 			player.sendMessage(MessageM.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", player.getDisplayName()), vars)); | 			player.sendMessage(MessageManager.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", player.getDisplayName()), vars)); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| @@ -74,10 +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(message.replaceAll("%player%", player.getDisplayName()), vars)); | 			player.sendMessage(MessageManager.replaceAll(message.replaceAll("%player%", player.getDisplayName()), vars)); | ||||||
| 		} | 		} | ||||||
| 		// message = message.replaceAll("%player%", "Console"); | 		// message = message.replaceAll("%player%", "Console"); | ||||||
| 		Bukkit.getConsoleSender().sendMessage(MessageM.replaceAll(message.replaceAll("%player%", "Console"), vars)); | 		Bukkit.getConsoleSender().sendMessage(MessageManager.replaceAll(message.replaceAll("%player%", "Console"), vars)); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| @@ -95,11 +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(location.config.getFile().get(location.location).toString().replaceAll("%player%", player.getDisplayName()), vars)); | 			player.sendMessage(MessageManager.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", player.getDisplayName()), 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(MessageM.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", "Console"), vars)); | 		Bukkit.getConsoleSender().sendMessage(MessageManager.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", "Console"), vars)); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| @@ -113,7 +113,7 @@ public class MessageM { | |||||||
| 	 * @return String with the message with values replaced | 	 * @return String with the message with values replaced | ||||||
| 	 */ | 	 */ | ||||||
| 	public static String replaceAll(String message, String... vars) { | 	public static String replaceAll(String message, String... vars) { | ||||||
| 		return MessageM.replaceColours(MessageM.replaceColourVars(MessageM.replaceVars(message, vars))); | 		return MessageManager.replaceColours(MessageManager.replaceColourVars(MessageManager.replaceVars(message, vars))); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| @@ -7,7 +7,7 @@ import nl.Steffion.BlockHunt.PermissionsC.Permissions; | |||||||
| 
 | 
 | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| 
 | 
 | ||||||
| public class PermissionsM { | public class PermissionsManager { | ||||||
| 	/** | 	/** | ||||||
| 	 * Steffion's Engine - Made by Steffion. | 	 * Steffion's Engine - Made by Steffion. | ||||||
| 	 *  | 	 *  | ||||||
| @@ -69,7 +69,7 @@ public class PermissionsM { | |||||||
| 			return true; | 			return true; | ||||||
| 		} else { | 		} else { | ||||||
| 			if (message) { | 			if (message) { | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_noPermission); | 				MessageManager.sendFMessage(player, ConfigC.error_noPermission); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		return false; | 		return false; | ||||||
| @@ -125,7 +125,7 @@ public class PermissionsM { | |||||||
| 			return true; | 			return true; | ||||||
| 		} else { | 		} else { | ||||||
| 			if (message) { | 			if (message) { | ||||||
| 				MessageM.sendFMessage(player, ConfigC.error_noPermission); | 				MessageManager.sendFMessage(player, ConfigC.error_noPermission); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		return false; | 		return false; | ||||||
| @@ -1,7 +1,7 @@ | |||||||
| package nl.Steffion.BlockHunt; | package nl.Steffion.BlockHunt; | ||||||
| 
 | 
 | ||||||
| import nl.Steffion.BlockHunt.Arena.ArenaState; | import nl.Steffion.BlockHunt.Arena.ArenaState; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -22,17 +22,17 @@ public class ScoreboardHandler { | |||||||
| 			Objective object = board.registerNewObjective(BlockHunt.cutString(arena.arenaName, 32), "dummy"); | 			Objective object = board.registerNewObjective(BlockHunt.cutString(arena.arenaName, 32), "dummy"); | ||||||
| 
 | 
 | ||||||
| 			object.setDisplaySlot(DisplaySlot.SIDEBAR); | 			object.setDisplaySlot(DisplaySlot.SIDEBAR); | ||||||
| 			object.setDisplayName(BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_title)), 32)); | 			object.setDisplayName(BlockHunt.cutString(MessageManager.replaceAll((String) W.config.get(ConfigC.scoreboard_title)), 32)); | ||||||
| 			 | 			 | ||||||
| 			String temp = BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_timeleft)), 32); | 			String temp = BlockHunt.cutString(MessageManager.replaceAll((String) W.config.get(ConfigC.scoreboard_timeleft)), 32); | ||||||
| 			Score timeleft = object.getScore(temp); | 			Score timeleft = object.getScore(temp); | ||||||
| 			timeleft.setScore(arena.timer); | 			timeleft.setScore(arena.timer); | ||||||
| 			 | 			 | ||||||
| 			temp = BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_seekers)), 32); | 			temp = BlockHunt.cutString(MessageManager.replaceAll((String) W.config.get(ConfigC.scoreboard_seekers)), 32); | ||||||
| 			Score seekers = object.getScore(temp); | 			Score seekers = object.getScore(temp); | ||||||
| 			seekers.setScore(arena.seekers.size()); | 			seekers.setScore(arena.seekers.size()); | ||||||
| 			 | 			 | ||||||
| 			temp = BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_hiders)), 32); | 			temp = BlockHunt.cutString(MessageManager.replaceAll((String) W.config.get(ConfigC.scoreboard_hiders)), 32); | ||||||
| 			Score hiders = object.getScore(temp); | 			Score hiders = object.getScore(temp); | ||||||
| 			hiders.setScore(arena.playersInArena.size() - arena.seekers.size()); | 			hiders.setScore(arena.playersInArena.size() - arena.seekers.size()); | ||||||
| 			 | 			 | ||||||
| @@ -52,17 +52,17 @@ public class ScoreboardHandler { | |||||||
| 		if ((Boolean) W.config.get(ConfigC.scoreboard_enabled)) { | 		if ((Boolean) W.config.get(ConfigC.scoreboard_enabled)) { | ||||||
| 			Scoreboard board = arena.scoreboard; | 			Scoreboard board = arena.scoreboard; | ||||||
| 			Objective object = board.getObjective(DisplaySlot.SIDEBAR); | 			Objective object = board.getObjective(DisplaySlot.SIDEBAR); | ||||||
| 			object.setDisplayName(BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_title)), 32)); | 			object.setDisplayName(BlockHunt.cutString(MessageManager.replaceAll((String) W.config.get(ConfigC.scoreboard_title)), 32)); | ||||||
| 			 | 			 | ||||||
| 			String temp = BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_timeleft)), 32); | 			String temp = BlockHunt.cutString(MessageManager.replaceAll((String) W.config.get(ConfigC.scoreboard_timeleft)), 32); | ||||||
| 			Score timeleft = object.getScore(temp); | 			Score timeleft = object.getScore(temp); | ||||||
| 			timeleft.setScore(arena.timer); | 			timeleft.setScore(arena.timer); | ||||||
| 			 | 			 | ||||||
| 			temp = BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_seekers)), 32); | 			temp = BlockHunt.cutString(MessageManager.replaceAll((String) W.config.get(ConfigC.scoreboard_seekers)), 32); | ||||||
| 			Score seekers = object.getScore(temp); | 			Score seekers = object.getScore(temp); | ||||||
| 			seekers.setScore(arena.seekers.size()); | 			seekers.setScore(arena.seekers.size()); | ||||||
| 			 | 			 | ||||||
| 			temp = BlockHunt.cutString(MessageM.replaceAll((String) W.config.get(ConfigC.scoreboard_hiders)), 32); | 			temp = BlockHunt.cutString(MessageManager.replaceAll((String) W.config.get(ConfigC.scoreboard_hiders)), 32); | ||||||
| 			Score hiders = object.getScore(temp); | 			Score hiders = object.getScore(temp); | ||||||
| 			hiders.setScore(arena.playersInArena.size() - arena.seekers.size()); | 			hiders.setScore(arena.playersInArena.size() - arena.seekers.size()); | ||||||
| 			 | 			 | ||||||
| @@ -1,57 +1,66 @@ | |||||||
| package nl.Steffion.BlockHunt.Serializables; | package nl.Steffion.BlockHunt.Serializables; | ||||||
| 
 | 
 | ||||||
| import java.util.HashMap; | import java.util.HashMap; | ||||||
| import java.util.Map; | import java.util.Map; | ||||||
| 
 | 
 | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
| import org.bukkit.Location; | import org.bukkit.Location; | ||||||
| import org.bukkit.World; | import org.bukkit.World; | ||||||
| import org.bukkit.configuration.serialization.ConfigurationSerializable; | import org.bukkit.configuration.serialization.ConfigurationSerializable; | ||||||
| import org.bukkit.configuration.serialization.SerializableAs; | import org.bukkit.configuration.serialization.SerializableAs; | ||||||
| 
 | 
 | ||||||
| @SerializableAs("BlockHuntLocation") | /** | ||||||
| public class LocationSerializable extends Location implements ConfigurationSerializable { |  * No longer required as a location is already serializable | ||||||
| 	public LocationSerializable(World world, double x, double y, double z, float yaw, float pitch) { |  */ | ||||||
| 		super(world, x, y, z, yaw, pitch); | 
 | ||||||
| 	} | @SerializableAs("BlockHuntLocation") | ||||||
| 
 | @Deprecated | ||||||
| 	public LocationSerializable(Location loc) { | public class LocationSerializable extends Location { | ||||||
| 		super(loc.getWorld(), loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch()); | 	public LocationSerializable(World world, double x, double y, double z, float yaw, float pitch) { | ||||||
| 	} | 		super(world, x, y, z, yaw, pitch); | ||||||
| 
 | 	} | ||||||
| 	@Override | 
 | ||||||
| 	public boolean equals(Object o) { | 	public LocationSerializable(Location loc) { | ||||||
| 		if (o instanceof LocationSerializable || o instanceof Location) { | 		super(loc.getWorld(), loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch()); | ||||||
| 			Location loc = (Location) o; | 	} | ||||||
| 			return loc.getWorld().getName().equals(getWorld().getName()) && loc.getX() == getX() && loc.getY() == getY() && loc.getZ() == getZ() | 
 | ||||||
| 					&& loc.getYaw() == getYaw() && loc.getPitch() == getPitch(); | 	@Override | ||||||
| 		} | 	public boolean equals(Object o) { | ||||||
| 		return false; | 		if (o instanceof LocationSerializable || o instanceof Location) { | ||||||
| 	} | 			Location loc = (Location) o; | ||||||
| 
 | 			return loc.getWorld().getName().equals(getWorld().getName()) && loc.getX() == getX() && loc.getY() == getY() && loc.getZ() == getZ() | ||||||
| 	@Override | 					&& loc.getYaw() == getYaw() && loc.getPitch() == getPitch(); | ||||||
| 	public Map<String, Object> serialize() { | 		} | ||||||
| 		Map<String, Object> map = new HashMap<>(); | 		return false; | ||||||
| 		map.put("w", getWorld().getName()); | 	} | ||||||
| 		map.put("x", getX()); | 
 | ||||||
| 		map.put("y", getY()); | 	@Override | ||||||
| 		map.put("z", getZ()); | 	public Map<String, Object> serialize() { | ||||||
| 		if (getYaw() != 0D) | 		Map<String, Object> map = new HashMap<>(); | ||||||
| 			map.put("a", getYaw()); | 		map.put("world", getWorld().getName()); | ||||||
| 		if (getPitch() != 0D) | 		map.put("x", getX()); | ||||||
| 			map.put("p", getPitch()); | 		map.put("y", getY()); | ||||||
| 		return map; | 		map.put("z", getZ()); | ||||||
| 	} | 		if (getYaw() != 0D) | ||||||
| 
 | 			map.put("yaw", getYaw()); | ||||||
| 	public static LocationSerializable deserialize(Map<String, Object> map) { | 		if (getPitch() != 0D) | ||||||
| 		World w = Bukkit.getWorld((String) M.g(map, "w", "")); | 			map.put("pitch", getPitch()); | ||||||
| 		if (w == null) { | 		return map; | ||||||
| 			MessageM.sendMessage(null, "%EError deserializing LocationSerializable - world not found! (%A%w%%E)", "w-" + w); | 	} | ||||||
| 			return null; | 
 | ||||||
| 		} | 	public static LocationSerializable deserialize(Map<String, Object> map) { | ||||||
| 		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(), | 		World w = Bukkit.getWorld((String)map.getOrDefault( "w", "")); | ||||||
| 				((Double) M.g(map, "p", 0D)).floatValue()); | 		if (w == null) { | ||||||
| 	} | 			MessageManager.sendMessage(null, "%EError deserializing Location - world not found! (%A%w%%E)", "w-" + w); | ||||||
| } | 			return null; | ||||||
|  | 		} | ||||||
|  | 		return new LocationSerializable(w, (Double) map.getOrDefault( "x", 0D), (Double) map.getOrDefault( "y", 0D), (Double) map.getOrDefault( "z", 0D), ((Double) map.getOrDefault( "a", 0D)).floatValue(), | ||||||
|  | 				((Double) map.getOrDefault( "p", 0D)).floatValue()); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public static Location getLocation(LocationSerializable ser){ | ||||||
|  | 		return new Location(ser.getWorld(),ser.getX(),ser.getY(),ser.getZ(),ser.getYaw(),ser.getPitch()); | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @@ -2,16 +2,16 @@ package nl.Steffion.BlockHunt; | |||||||
| 
 | 
 | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| import nl.Steffion.BlockHunt.Arena.ArenaState; | import nl.Steffion.BlockHunt.Arena.ArenaState; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| import nl.Steffion.BlockHunt.Serializables.LocationSerializable; |  | ||||||
| 
 | 
 | ||||||
|  | import org.bukkit.Location; | ||||||
| import org.bukkit.Material; | import org.bukkit.Material; | ||||||
| import org.bukkit.block.Sign; | import org.bukkit.block.Sign; | ||||||
| import org.bukkit.event.block.SignChangeEvent; | import org.bukkit.event.block.SignChangeEvent; | ||||||
| 
 | 
 | ||||||
| public class SignsHandler { | public class SignsHandler { | ||||||
| 
 | 
 | ||||||
| 	public static void createSign(SignChangeEvent event, String[] lines, LocationSerializable location) { | 	public static void createSign(SignChangeEvent event, String[] lines, Location 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; | ||||||
| @@ -61,15 +61,15 @@ public class SignsHandler { | |||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				if (!saved) { | 				if (!saved) { | ||||||
| 					MessageM.sendFMessage(event.getPlayer(), ConfigC.error_noArena, "name-" + lines[1]); | 					MessageManager.sendFMessage(event.getPlayer(), ConfigC.error_noArena, "name-" + lines[1]); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	public static void removeSign(LocationSerializable location) { | 	public static void removeSign(Location location) { | ||||||
| 		for (String sign : W.signs.getFile().getKeys(false)) { | 		for (String sign : W.signs.getFile().getKeys(false)) { | ||||||
| 			LocationSerializable loc = new LocationSerializable((LocationSerializable) W.signs.getFile().get(sign + ".location")); | 			Location loc = (Location) 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(); | ||||||
| @@ -77,9 +77,9 @@ public class SignsHandler { | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	public static boolean isSign(LocationSerializable location) { | 	public static boolean isSign(Location location) { | ||||||
| 		for (String sign : W.signs.getFile().getKeys(false)) { | 		for (String sign : W.signs.getFile().getKeys(false)) { | ||||||
| 			LocationSerializable loc = new LocationSerializable((LocationSerializable) W.signs.getFile().get(sign + ".location")); | 			Location loc = (Location) W.signs.getFile().get(sign + ".location"); | ||||||
| 			if (loc.equals(location)) { | 			if (loc.equals(location)) { | ||||||
| 				return true; | 				return true; | ||||||
| 			} | 			} | ||||||
| @@ -91,7 +91,7 @@ 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) W.signs.getFile().get(sign + ".location")); | 			Location loc = (Location) W.signs.getFile().get(sign + ".location"); | ||||||
| 			if (loc.getBlock().getType().equals(Material.SIGN_POST) || loc.getBlock().getType().equals(Material.WALL_SIGN)) { | 			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(); | ||||||
| @@ -101,7 +101,7 @@ public class SignsHandler { | |||||||
| 					int linecount = 0; | 					int linecount = 0; | ||||||
| 					for (String line : signLines) { | 					for (String line : signLines) { | ||||||
| 						if (linecount <= 3) { | 						if (linecount <= 3) { | ||||||
| 							signblock.setLine(linecount, MessageM.replaceAll(line)); | 							signblock.setLine(linecount, MessageManager.replaceAll(line)); | ||||||
| 						} | 						} | ||||||
| 
 | 
 | ||||||
| 						linecount = linecount + 1; | 						linecount = linecount + 1; | ||||||
| @@ -112,7 +112,7 @@ public class SignsHandler { | |||||||
| 					int linecount = 0; | 					int linecount = 0; | ||||||
| 					for (String line : signLines) { | 					for (String line : signLines) { | ||||||
| 						if (linecount <= 3) { | 						if (linecount <= 3) { | ||||||
| 							signblock.setLine(linecount, MessageM.replaceAll(line)); | 							signblock.setLine(linecount, MessageManager.replaceAll(line)); | ||||||
| 						} | 						} | ||||||
| 
 | 
 | ||||||
| 						linecount = linecount + 1; | 						linecount = linecount + 1; | ||||||
| @@ -129,7 +129,7 @@ public class SignsHandler { | |||||||
| 										if (linecount <= 3) { | 										if (linecount <= 3) { | ||||||
| 											signblock.setLine( | 											signblock.setLine( | ||||||
| 													linecount, | 													linecount, | ||||||
| 													MessageM.replaceAll(line, "arenaname-" + arena.arenaName, "players-" + arena.playersInArena.size(), "maxplayers-" | 													MessageManager.replaceAll(line, "arenaname-" + arena.arenaName, "players-" + arena.playersInArena.size(), "maxplayers-" | ||||||
| 															+ arena.maxPlayers, "timeleft-" + arena.timer)); | 															+ arena.maxPlayers, "timeleft-" + arena.timer)); | ||||||
| 										} | 										} | ||||||
| 
 | 
 | ||||||
| @@ -145,7 +145,7 @@ public class SignsHandler { | |||||||
| 										if (linecount <= 3) { | 										if (linecount <= 3) { | ||||||
| 											signblock.setLine( | 											signblock.setLine( | ||||||
| 													linecount, | 													linecount, | ||||||
| 													MessageM.replaceAll(line, "arenaname-" + arena.arenaName, "players-" + arena.playersInArena.size(), "maxplayers-" | 													MessageManager.replaceAll(line, "arenaname-" + arena.arenaName, "players-" + arena.playersInArena.size(), "maxplayers-" | ||||||
| 															+ arena.maxPlayers, "timeleft-" + arena.timer)); | 															+ arena.maxPlayers, "timeleft-" + arena.timer)); | ||||||
| 										} | 										} | ||||||
| 
 | 
 | ||||||
| @@ -161,7 +161,7 @@ public class SignsHandler { | |||||||
| 										if (linecount <= 3) { | 										if (linecount <= 3) { | ||||||
| 											signblock.setLine( | 											signblock.setLine( | ||||||
| 													linecount, | 													linecount, | ||||||
| 													MessageM.replaceAll(line, "arenaname-" + arena.arenaName, "players-" + arena.playersInArena.size(), "maxplayers-" | 													MessageManager.replaceAll(line, "arenaname-" + arena.arenaName, "players-" + arena.playersInArena.size(), "maxplayers-" | ||||||
| 															+ arena.maxPlayers, "timeleft-" + arena.timer)); | 															+ arena.maxPlayers, "timeleft-" + arena.timer)); | ||||||
| 										} | 										} | ||||||
| 
 | 
 | ||||||
| @@ -3,7 +3,7 @@ package nl.Steffion.BlockHunt; | |||||||
| import me.libraryaddict.disguise.DisguiseAPI; | import me.libraryaddict.disguise.DisguiseAPI; | ||||||
| import me.libraryaddict.disguise.disguisetypes.DisguiseType; | import me.libraryaddict.disguise.disguisetypes.DisguiseType; | ||||||
| import me.libraryaddict.disguise.disguisetypes.MiscDisguise; | import me.libraryaddict.disguise.disguisetypes.MiscDisguise; | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; | import nl.Steffion.BlockHunt.Managers.MessageManager; | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
| import org.bukkit.ChatColor; | import org.bukkit.ChatColor; | ||||||
| @@ -57,6 +57,6 @@ public class SolidBlockHandler { | |||||||
| 		MiscDisguise disguise = new MiscDisguise(DisguiseType.FALLING_BLOCK, block.getTypeId(), block.getDurability()); | 		MiscDisguise disguise = new MiscDisguise(DisguiseType.FALLING_BLOCK, block.getTypeId(), block.getDurability()); | ||||||
| 		DisguiseAPI.disguiseToAll(player, disguise); | 		DisguiseAPI.disguiseToAll(player, disguise); | ||||||
| 
 | 
 | ||||||
| 		MessageM.sendFMessage(player, ConfigC.normal_ingameNoMoreSolid); | 		MessageManager.sendFMessage(player, ConfigC.normal_ingameNoMoreSolid); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @@ -16,9 +16,8 @@ import java.util.ArrayList; | |||||||
| import java.util.HashMap; | import java.util.HashMap; | ||||||
| import java.util.Random; | import java.util.Random; | ||||||
| 
 | 
 | ||||||
| import nl.Steffion.BlockHunt.Managers.CommandM; | import nl.Steffion.BlockHunt.Managers.CommandManager; | ||||||
| import nl.Steffion.BlockHunt.Managers.ConfigM; | import nl.Steffion.BlockHunt.Managers.ConfigManager; | ||||||
| import nl.Steffion.BlockHunt.Serializables.LocationSerializable; |  | ||||||
| 
 | 
 | ||||||
| import org.bukkit.Location; | import org.bukkit.Location; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -30,23 +29,23 @@ public class W { | |||||||
| 	 * Standard stuff. | 	 * Standard stuff. | ||||||
| 	 */ | 	 */ | ||||||
| 	public static ArrayList<String> newFiles = new ArrayList<>(); | 	public static ArrayList<String> newFiles = new ArrayList<>(); | ||||||
| 	public static ArrayList<CommandM> commands = new ArrayList<>(); | 	public static ArrayList<CommandManager> commands = new ArrayList<>(); | ||||||
| 
 | 
 | ||||||
| 	/* | 	/* | ||||||
| 	 * If you want another file to be created. Copy and paste this line. | 	 * If you want another file to be created. Copy and paste this line. | ||||||
| 	 */ | 	 */ | ||||||
| 	public static ConfigM config = new ConfigM("config"); | 	public static ConfigManager config = new ConfigManager("config"); | ||||||
| 	public static ConfigM messages = new ConfigM("messages"); | 	public static ConfigManager messages = new ConfigManager("messages"); | ||||||
| 	public static ConfigM arenas = new ConfigM("arenas"); | 	public static ConfigManager arenas = new ConfigManager("arenas"); | ||||||
| 	public static ConfigM signs = new ConfigM("signs"); | 	public static ConfigManager signs = new ConfigManager("signs"); | ||||||
| 	public static ConfigM shop = new ConfigM("shop"); | 	public static ConfigManager shop = new ConfigManager("shop"); | ||||||
| 
 | 
 | ||||||
| 	/* | 	/* | ||||||
| 	 * Add any variable you need in different classes here: | 	 * Add any variable you need in different classes here: | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
| 	public static HashMap<Player, LocationSerializable> pos1 = new HashMap<>(); | 	public static HashMap<Player, Location> pos1 = new HashMap<>(); | ||||||
| 	public static HashMap<Player, LocationSerializable> pos2 = new HashMap<>(); | 	public static HashMap<Player, Location> pos2 = new HashMap<>(); | ||||||
| 
 | 
 | ||||||
| 	public static ArrayList<Arena> arenaList = new ArrayList<>(); | 	public static ArrayList<Arena> arenaList = new ArrayList<>(); | ||||||
| 	public static Random random = new Random(); | 	public static Random random = new Random(); | ||||||
							
								
								
									
										90
									
								
								src/main/resources/lang/messages.properties
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										90
									
								
								src/main/resources/lang/messages.properties
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,90 @@ | |||||||
|  | log-enabledPlugin: '%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%autors%%N.' | ||||||
|  | log-disabledPlugin: '%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%autors%%N.' | ||||||
|  | info: '%NDisplays the plugin''s info.' | ||||||
|  | help: '%NShows a list of commands.' | ||||||
|  | reload: '%NReloads all configs.' | ||||||
|  | join: '%NJoins a BlockHunt game.' | ||||||
|  | leave: '%NLeave a BlockHunt game.' | ||||||
|  | list: '%NShows a list of available arenas.' | ||||||
|  | shop: '%NOpens the BlockHunt shop.' | ||||||
|  | start: '%NForces an arena to start.' | ||||||
|  | wand: '%NGives you the wand selection tool.' | ||||||
|  | create: '%NCreates an arena from your selection.' | ||||||
|  | set: '%NOpens a panel to set settings.' | ||||||
|  | setwarp: '%NSets warps for your arena.' | ||||||
|  | remove: '%NDeletes an Arena.' | ||||||
|  | tokens: '%NChange someones tokens.' | ||||||
|  | #buttons | ||||||
|  | button-add: '%NAdd %A%1%%N to %A%2%%N' | ||||||
|  | button-add2: Add | ||||||
|  | button-setting: '%NSetting %A%1%%N is now: %A%2%%N.' | ||||||
|  | button-remove: '%NRemove %A%1%%N from %A%2%%N' | ||||||
|  | button-remove2: Remove | ||||||
|  | #Normal | ||||||
|  | reloadedConfigs: '%TAG&aReloaded all configs!' | ||||||
|  | joinJoinedArena: '%TAG%A%playername%%N joined your arena. (%A%1%%N/%A%2%%N)' | ||||||
|  | leaveYouLeft: '%TAG%NYou left the arena! Thanks for playing!' | ||||||
|  | leaveLeftArena: '%TAG%A%playername%%N left your arena. (%A%1%%N/%A%2%%N)' | ||||||
|  | startForced: '%TAG%NYou forced to start arena ''%A%arenaname%%N''!' | ||||||
|  | wandGaveWand: '%TAG%NHere you go! &o(Use the %A&o%type%%N&o!)' | ||||||
|  | wandSetPosition: '%TAG%NSet position %A#%number%%N to location: (%A%x%%N, %A%y%%N,%A%z%%N).' | ||||||
|  | createCreatedArena: '%TAG%NCreated an arena with the name ''%A%name%%N''.' | ||||||
|  | lobbyArenaIsStarting: '%TAG%NThe arena will start in %A%1%%N second(s)!' | ||||||
|  | lobbyArenaStarted: '%TAG%NThe arena has been started! The seeker is coming to find you in %A%secs%%N seconds!' | ||||||
|  | ingameSeekerChoosen: '%TAG%NPlayer %A%seeker%%N has been choosen as seeker!' | ||||||
|  | ingameBlock: '%TAG%NYou''re disguised as a(n) ''%A%block%%N'' block.' | ||||||
|  | ingameArenaEnd: '%TAG%NThe arena will end in %A%1%%N second(s)!' | ||||||
|  | ingameSeekerSpawned: '%TAG%A%playername%%N has spawned as a seeker!' | ||||||
|  | ingameGivenSword: '%TAG%NYou were given a sword!' | ||||||
|  | ingameHiderDied: '%TAG%NHider %A%playername%%N was killed by %A%killer%%N!' | ||||||
|  | ingameHidersLeft: '%NHider(s) left: %A%left%%N' | ||||||
|  | ingameSeekerDied: '%TAG%NSeeker %A%playername%%N died and will respawn in %A%secs%%N seconds!' | ||||||
|  | winSeekers: '%TAG%NThe %ASEEKERS%N have won!' | ||||||
|  | winHiders: '%TAG%NThe %AHIDERS%N have won!' | ||||||
|  | setwarpWarpSet: '%TAG%NSet warp ''%A%warp%%N'' to your location!' | ||||||
|  | addedToken: '%TAG%A%amount%%N tokens were added to your account!' | ||||||
|  | removeRemovedArena: '%TAG%NRemoved arena ''%A%name%%N''!' | ||||||
|  | tokensChanged: '%TAG%N%option% %A%amount%%N tokens %option2% %A%playername%%N.' | ||||||
|  | tokensChangedPerson: '%TAG%NPlayer %A%playername%%N %N%option% %A%amount%%N %option2% your tokens.' | ||||||
|  | ingameNowSolid: '%TAG%NYou''re now a solid ''%A%block%%N'' block!' | ||||||
|  | ingameNoMoreSolid: '%TAG%NYou''re no longer a solid block!' | ||||||
|  | shopBoughtItem: '%TAG%NYou''ve bought the ''%A%itemname%%N'' item!' | ||||||
|  | shopChoosenBlock: '%TAG%NYou''ve choosen to be a(n) ''%A%block%%N'' block!' | ||||||
|  | shopChoosenSeeker: '%TAG%NYou''ve choosen to be a %Aseeker%N!' | ||||||
|  | shopChoosenHiders: '%TAG%NYou''ve choosen to be a %Ahider%N!' | ||||||
|  | ingameBlocksLeft: '%TAG%NRemaining blocks: %A%1%%N' | ||||||
|  |  | ||||||
|  | # Warnings | ||||||
|  | lobbyNeedAtleast: '%TAG%WYou need atleast %A%1%%W player(s) to start the game!' | ||||||
|  | ingameNEWSeekerChoosen: '%TAG%WThe last seeker left and a new seeker has been choosen!' | ||||||
|  | unableToCommand: '%TAG%WSorry but that command is disabled in the arena.' | ||||||
|  | ingameNoSolidPlace: '%TAG%WThat''s not a valid place to become solid!' | ||||||
|  | arenaStopped: '%TAG%WThe arena has been forced to stop!' | ||||||
|  |  | ||||||
|  | error-noPermission: '%TAG%EYou don''t have the permissions to do that!' | ||||||
|  | error-notANumber: '%TAG%E''%A%1%%E'' is not a number!' | ||||||
|  | error-commandNotEnabled: '%TAG%EThis command has been disabled!' | ||||||
|  | error-commandNotFound: '%TAG%ECouldn''t find the command. Try %A/BlockHunt help %Efor more info.' | ||||||
|  | error-notEnoughArguments: '%TAG%EYou''re missing arguments, correct syntax: %A%syntax%' | ||||||
|  | error-libsDisguisesNotInstalled: '%TAG%EThe plugin ''%ALib''s Disguises%E'' is required to run this plugin! Intall it or it won''t work!' | ||||||
|  | error-protocolLibNotInstalled: '%TAG%EThe plugin ''%AProtocolLib%E'' is required to run this plugin! Intall it or it won''t work!' | ||||||
|  | error-noArena: '%TAG%ENo arena found with the name ''%A%name%%E''.' | ||||||
|  | error-onlyIngame: '%TAG%EThis is an only in-game command!' | ||||||
|  | error-joinAlreadyJoined: '%TAG%EYou''ve already joined an arena!' | ||||||
|  | error-joinNoBlocksSet: '%TAG%EThere are none blocks set for this arena. Notify the administrator.' | ||||||
|  | error-joinWarpsNotSet: '%TAG%EThere are no warps set for this arena. Notify the administrator.' | ||||||
|  | error-joinArenaIngame: '%TAG%EThis game has already started.' | ||||||
|  | error-joinFull: '%TAG%EUnable to join this arena. It''s full!' | ||||||
|  | error-joinInventoryNotEmpty: '%TAG%EYour inventory should be empty before joining!' | ||||||
|  | error-leaveNotInArena: '%TAG%EYou''re not in an arena!' | ||||||
|  | error-createSelectionFirst: '%TAG%EMake a selection first. Use the wand command: %A/BlockHunt <wand|w>%E.' | ||||||
|  | error-createNotSameWorld: '%TAG%EMake your selection points in the same world!' | ||||||
|  | error-setTooHighNumber: '%TAG%EThat amount is too high! Max amount is: %A%max%%E.' | ||||||
|  | error-setTooLowNumber: '%TAG%EThat amount is too low! Minimal amount is: %A%min%%E.' | ||||||
|  | error-setNotABlock: '%TAG%EThat is not a block!' | ||||||
|  | error-setwarpWarpNotFound: '%TAG%EWarp ''%A%warp%%E'' is not valid!' | ||||||
|  | error-tokensPlayerNotOnline: '%TAG%ENo player found with the name ''%A%playername%%E''!' | ||||||
|  | error-tokensUnknownsetting: '%TAG%E''%A%option%%E'' is not a known option!' | ||||||
|  | error-shopNeedMoreTokens: '%TAG%EYou need more tokens before you can buy this item.' | ||||||
|  | error-shopMaxSeekersReached: '%TAG%ESorry, the maximum amount of seekers has been reached!' | ||||||
|  | error-shopMaxHidersReached: '%TAG%ESorry, the maximum amount of hiders has been reached!' | ||||||
							
								
								
									
										90
									
								
								src/main/resources/lang/messages_en.properties
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										90
									
								
								src/main/resources/lang/messages_en.properties
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,90 @@ | |||||||
|  | log-enabledPlugin: '%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%autors%%N.' | ||||||
|  | log-disabledPlugin: '%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%autors%%N.' | ||||||
|  | info: '%NDisplays the plugin''s info.' | ||||||
|  | help: '%NShows a list of commands.' | ||||||
|  | reload: '%NReloads all configs.' | ||||||
|  | join: '%NJoins a BlockHunt game.' | ||||||
|  | leave: '%NLeave a BlockHunt game.' | ||||||
|  | list: '%NShows a list of available arenas.' | ||||||
|  | shop: '%NOpens the BlockHunt shop.' | ||||||
|  | start: '%NForces an arena to start.' | ||||||
|  | wand: '%NGives you the wand selection tool.' | ||||||
|  | create: '%NCreates an arena from your selection.' | ||||||
|  | set: '%NOpens a panel to set settings.' | ||||||
|  | setwarp: '%NSets warps for your arena.' | ||||||
|  | remove: '%NDeletes an Arena.' | ||||||
|  | tokens: '%NChange someones tokens.' | ||||||
|  | #buttons | ||||||
|  | button-add: '%NAdd %A%1%%N to %A%2%%N' | ||||||
|  | button-add2: Add | ||||||
|  | button-setting: '%NSetting %A%1%%N is now: %A%2%%N.' | ||||||
|  | button-remove: '%NRemove %A%1%%N from %A%2%%N' | ||||||
|  | button-remove2: Remove | ||||||
|  | #Normal | ||||||
|  | reloadedConfigs: '%TAG&aReloaded all configs!' | ||||||
|  | joinJoinedArena: '%TAG%A%playername%%N joined your arena. (%A%1%%N/%A%2%%N)' | ||||||
|  | leaveYouLeft: '%TAG%NYou left the arena! Thanks for playing!' | ||||||
|  | leaveLeftArena: '%TAG%A%playername%%N left your arena. (%A%1%%N/%A%2%%N)' | ||||||
|  | startForced: '%TAG%NYou forced to start arena ''%A%arenaname%%N''!' | ||||||
|  | wandGaveWand: '%TAG%NHere you go! &o(Use the %A&o%type%%N&o!)' | ||||||
|  | wandSetPosition: '%TAG%NSet position %A#%number%%N to location: (%A%x%%N, %A%y%%N,%A%z%%N).' | ||||||
|  | createCreatedArena: '%TAG%NCreated an arena with the name ''%A%name%%N''.' | ||||||
|  | lobbyArenaIsStarting: '%TAG%NThe arena will start in %A%1%%N second(s)!' | ||||||
|  | lobbyArenaStarted: '%TAG%NThe arena has been started! The seeker is coming to find you in %A%secs%%N seconds!' | ||||||
|  | ingameSeekerChoosen: '%TAG%NPlayer %A%seeker%%N has been choosen as seeker!' | ||||||
|  | ingameBlock: '%TAG%NYou''re disguised as a(n) ''%A%block%%N'' block.' | ||||||
|  | ingameArenaEnd: '%TAG%NThe arena will end in %A%1%%N second(s)!' | ||||||
|  | ingameSeekerSpawned: '%TAG%A%playername%%N has spawned as a seeker!' | ||||||
|  | ingameGivenSword: '%TAG%NYou were given a sword!' | ||||||
|  | ingameHiderDied: '%TAG%NHider %A%playername%%N was killed by %A%killer%%N!' | ||||||
|  | ingameHidersLeft: '%NHider(s) left: %A%left%%N' | ||||||
|  | ingameSeekerDied: '%TAG%NSeeker %A%playername%%N died and will respawn in %A%secs%%N seconds!' | ||||||
|  | winSeekers: '%TAG%NThe %ASEEKERS%N have won!' | ||||||
|  | winHiders: '%TAG%NThe %AHIDERS%N have won!' | ||||||
|  | setwarpWarpSet: '%TAG%NSet warp ''%A%warp%%N'' to your location!' | ||||||
|  | addedToken: '%TAG%A%amount%%N tokens were added to your account!' | ||||||
|  | removeRemovedArena: '%TAG%NRemoved arena ''%A%name%%N''!' | ||||||
|  | tokensChanged: '%TAG%N%option% %A%amount%%N tokens %option2% %A%playername%%N.' | ||||||
|  | tokensChangedPerson: '%TAG%NPlayer %A%playername%%N %N%option% %A%amount%%N %option2% your tokens.' | ||||||
|  | ingameNowSolid: '%TAG%NYou''re now a solid ''%A%block%%N'' block!' | ||||||
|  | ingameNoMoreSolid: '%TAG%NYou''re no longer a solid block!' | ||||||
|  | shopBoughtItem: '%TAG%NYou''ve bought the ''%A%itemname%%N'' item!' | ||||||
|  | shopChoosenBlock: '%TAG%NYou''ve choosen to be a(n) ''%A%block%%N'' block!' | ||||||
|  | shopChoosenSeeker: '%TAG%NYou''ve choosen to be a %Aseeker%N!' | ||||||
|  | shopChoosenHiders: '%TAG%NYou''ve choosen to be a %Ahider%N!' | ||||||
|  | ingameBlocksLeft: '%TAG%NRemaining blocks: %A%1%%N' | ||||||
|  |  | ||||||
|  | # Warnings | ||||||
|  | lobbyNeedAtleast: '%TAG%WYou need atleast %A%1%%W player(s) to start the game!' | ||||||
|  | ingameNEWSeekerChoosen: '%TAG%WThe last seeker left and a new seeker has been choosen!' | ||||||
|  | unableToCommand: '%TAG%WSorry but that command is disabled in the arena.' | ||||||
|  | ingameNoSolidPlace: '%TAG%WThat''s not a valid place to become solid!' | ||||||
|  | arenaStopped: '%TAG%WThe arena has been forced to stop!' | ||||||
|  |  | ||||||
|  | error-noPermission: '%TAG%EYou don''t have the permissions to do that!' | ||||||
|  | error-notANumber: '%TAG%E''%A%1%%E'' is not a number!' | ||||||
|  | error-commandNotEnabled: '%TAG%EThis command has been disabled!' | ||||||
|  | error-commandNotFound: '%TAG%ECouldn''t find the command. Try %A/BlockHunt help %Efor more info.' | ||||||
|  | error-notEnoughArguments: '%TAG%EYou''re missing arguments, correct syntax: %A%syntax%' | ||||||
|  | error-libsDisguisesNotInstalled: '%TAG%EThe plugin ''%ALib''s Disguises%E'' is required to run this plugin! Intall it or it won''t work!' | ||||||
|  | error-protocolLibNotInstalled: '%TAG%EThe plugin ''%AProtocolLib%E'' is required to run this plugin! Intall it or it won''t work!' | ||||||
|  | error-noArena: '%TAG%ENo arena found with the name ''%A%name%%E''.' | ||||||
|  | error-onlyIngame: '%TAG%EThis is an only in-game command!' | ||||||
|  | error-joinAlreadyJoined: '%TAG%EYou''ve already joined an arena!' | ||||||
|  | error-joinNoBlocksSet: '%TAG%EThere are none blocks set for this arena. Notify the administrator.' | ||||||
|  | error-joinWarpsNotSet: '%TAG%EThere are no warps set for this arena. Notify the administrator.' | ||||||
|  | error-joinArenaIngame: '%TAG%EThis game has already started.' | ||||||
|  | error-joinFull: '%TAG%EUnable to join this arena. It''s full!' | ||||||
|  | error-joinInventoryNotEmpty: '%TAG%EYour inventory should be empty before joining!' | ||||||
|  | error-leaveNotInArena: '%TAG%EYou''re not in an arena!' | ||||||
|  | error-createSelectionFirst: '%TAG%EMake a selection first. Use the wand command: %A/BlockHunt <wand|w>%E.' | ||||||
|  | error-createNotSameWorld: '%TAG%EMake your selection points in the same world!' | ||||||
|  | error-setTooHighNumber: '%TAG%EThat amount is too high! Max amount is: %A%max%%E.' | ||||||
|  | error-setTooLowNumber: '%TAG%EThat amount is too low! Minimal amount is: %A%min%%E.' | ||||||
|  | error-setNotABlock: '%TAG%EThat is not a block!' | ||||||
|  | error-setwarpWarpNotFound: '%TAG%EWarp ''%A%warp%%E'' is not valid!' | ||||||
|  | error-tokensPlayerNotOnline: '%TAG%ENo player found with the name ''%A%playername%%E''!' | ||||||
|  | error-tokensUnknownsetting: '%TAG%E''%A%option%%E'' is not a known option!' | ||||||
|  | error-shopNeedMoreTokens: '%TAG%EYou need more tokens before you can buy this item.' | ||||||
|  | error-shopMaxSeekersReached: '%TAG%ESorry, the maximum amount of seekers has been reached!' | ||||||
|  | error-shopMaxHidersReached: '%TAG%ESorry, the maximum amount of hiders has been reached!' | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| package nl.Steffion.BlockHunt.Commands; |  | ||||||
| /** |  | ||||||
|  * Steffion's Engine - Made by Steffion. |  | ||||||
|  * |  | ||||||
|  * You're allowed to use this engine for own usage, you're not allowed to |  | ||||||
|  * republish the engine. Using this for your own plugin is allowed when a |  | ||||||
|  * credit is placed somewhere in the plugin. |  | ||||||
|  * |  | ||||||
|  * Thanks for your cooperate! |  | ||||||
|  * |  | ||||||
|  * @author Steffion |  | ||||||
|  */ |  | ||||||
| import nl.Steffion.BlockHunt.BlockHunt; |  | ||||||
| import nl.Steffion.BlockHunt.ConfigC; |  | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; |  | ||||||
|  |  | ||||||
| import org.bukkit.command.Command; |  | ||||||
| import org.bukkit.entity.Player; |  | ||||||
|  |  | ||||||
| public class CMDinfo extends DefaultCMD { |  | ||||||
|  |  | ||||||
|  |  | ||||||
| 	@Override |  | ||||||
| 	public boolean exectue(Player player, Command cmd, String label, String[] args) { |  | ||||||
| 		MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName()); |  | ||||||
| 		MessageM.sendMessage(player, "%A%name%%N made by %A%autors%%N.", "name-" + BlockHunt.pdfFile.getName(), "autors-" + 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, "%NMade by help from some friends &c<3%N!"); |  | ||||||
| 		MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oInfo Page"); |  | ||||||
| 		return true; |  | ||||||
| 	} |  | ||||||
| } |  | ||||||
| @@ -1,29 +0,0 @@ | |||||||
| package nl.Steffion.BlockHunt.Commands; |  | ||||||
|  |  | ||||||
| import nl.Steffion.BlockHunt.Arena; |  | ||||||
| import nl.Steffion.BlockHunt.BlockHunt; |  | ||||||
| import nl.Steffion.BlockHunt.ConfigC; |  | ||||||
| import nl.Steffion.BlockHunt.W; |  | ||||||
| import nl.Steffion.BlockHunt.Managers.MessageM; |  | ||||||
|  |  | ||||||
| import org.bukkit.command.Command; |  | ||||||
| import org.bukkit.entity.Player; |  | ||||||
|  |  | ||||||
| public class CMDlist extends DefaultCMD { |  | ||||||
|  |  | ||||||
| 	@Override |  | ||||||
| 	public boolean exectue(Player player, Command cmd, String label, String[] args) { |  | ||||||
| 		MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName()); |  | ||||||
| 		if (W.arenaList.size() >= 1) { |  | ||||||
| 			MessageM.sendMessage(player, "&7Available arena(s):"); |  | ||||||
| 			for (Arena arena : W.arenaList) { |  | ||||||
| 				MessageM.sendMessage(player, "%A" + arena.arenaName); |  | ||||||
| 			} |  | ||||||
| 		} else { |  | ||||||
| 			MessageM.sendMessage(player, "&7&oNo arenas available..."); |  | ||||||
| 			MessageM.sendMessage(player, "&7&oCreate an arena first please."); |  | ||||||
| 		} |  | ||||||
| 		MessageM.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oArenas list"); |  | ||||||
| 		return true; |  | ||||||
| 	} |  | ||||||
| } |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| package nl.Steffion.BlockHunt.Managers; |  | ||||||
| /** |  | ||||||
|  * Steffion's Engine - Made by Steffion. |  | ||||||
|  * |  | ||||||
|  * You're allowed to use this engine for own usage, you're not allowed to |  | ||||||
|  * republish the engine. Using this for your own plugin is allowed when a |  | ||||||
|  * credit is placed somewhere in the plugin. |  | ||||||
|  * |  | ||||||
|  * Thanks for your cooperate! |  | ||||||
|  * |  | ||||||
|  * @author Steffion |  | ||||||
|  */ |  | ||||||
| public class EngineInfo { |  | ||||||
|  |  | ||||||
|  |  | ||||||
| 	public static String engineVersion = "3.0.2"; |  | ||||||
| 	public static String engineAuthors = "Steffion"; |  | ||||||
| } |  | ||||||
| @@ -1,71 +0,0 @@ | |||||||
| package nl.Steffion.BlockHunt.Managers; |  | ||||||
|  |  | ||||||
| import java.io.File; |  | ||||||
| import java.io.FileInputStream; |  | ||||||
| import java.io.FileOutputStream; |  | ||||||
| import java.io.IOException; |  | ||||||
| import java.io.InputStream; |  | ||||||
| import java.io.OutputStream; |  | ||||||
|  |  | ||||||
| public class FileM { |  | ||||||
| 	/* |  | ||||||
| 	 * Made by @author Steffion,  2013. |  | ||||||
| 	 */ |  | ||||||
|  |  | ||||||
| 	public static void copyFolder(File src, File dest) throws IOException { |  | ||||||
| 		if (src.isDirectory()) { |  | ||||||
| 			if (!dest.exists()) { |  | ||||||
| 				dest.mkdir(); |  | ||||||
| 				// Bukkit.broadcastMessage("Directory copied from " + src |  | ||||||
| 				// + "  to " + dest); |  | ||||||
| 			} |  | ||||||
| 			String files[] = src.list(); |  | ||||||
|  |  | ||||||
| 			for (String file : files) { |  | ||||||
| 				File srcFile = new File(src, file); |  | ||||||
| 				File destFile = new File(dest, file); |  | ||||||
| 				if (!srcFile.getName().equals("uid.dat")) { |  | ||||||
| 					copyFolder(srcFile, destFile); |  | ||||||
| 				} |  | ||||||
| 			} |  | ||||||
|  |  | ||||||
| 		} else { |  | ||||||
| 			InputStream in = new FileInputStream(src); |  | ||||||
| 			OutputStream out = new FileOutputStream(dest); |  | ||||||
|  |  | ||||||
| 			byte[] buffer = new byte[1024]; |  | ||||||
|  |  | ||||||
| 			int length; |  | ||||||
| 			while ((length = in.read(buffer)) > 0) { |  | ||||||
| 				out.write(buffer, 0, length); |  | ||||||
| 			} |  | ||||||
|  |  | ||||||
| 			in.close(); |  | ||||||
| 			out.close(); |  | ||||||
| 			// Bukkit.broadcastMessage("File copied from " + src + " to " + |  | ||||||
| 			// dest); |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	public static void delete(File file) throws IOException { |  | ||||||
| 		if (file.isDirectory()) { |  | ||||||
|  |  | ||||||
| 			if (file.list().length == 0) { |  | ||||||
| 				file.delete(); |  | ||||||
| 			} else { |  | ||||||
| 				String files[] = file.list(); |  | ||||||
|  |  | ||||||
| 				for (String temp : files) { |  | ||||||
| 					File fileDelete = new File(file, temp); |  | ||||||
| 					delete(fileDelete); |  | ||||||
| 				} |  | ||||||
|  |  | ||||||
| 				if (file.list().length == 0) { |  | ||||||
| 					file.delete(); |  | ||||||
| 				} |  | ||||||
| 			} |  | ||||||
| 		} else { |  | ||||||
| 			file.delete(); |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
| } |  | ||||||
| @@ -1,9 +0,0 @@ | |||||||
| package nl.Steffion.BlockHunt.Serializables; |  | ||||||
|  |  | ||||||
| import java.util.Map; |  | ||||||
|  |  | ||||||
| public class M { |  | ||||||
| 	public static Object g(Map<String, Object> map, String key, Object def) { |  | ||||||
| 		return map.getOrDefault(key, def); |  | ||||||
| 	} |  | ||||||
| } |  | ||||||
							
								
								
									
										82
									
								
								src/test/resources/arena.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								src/test/resources/arena.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,82 @@ | |||||||
|  | TestArena: | ||||||
|  |   ==: BlockHuntArena | ||||||
|  |   maxPlayers: 40 | ||||||
|  |   hidersWinCommands: [] | ||||||
|  |   timeInLobbyUntilStart: 30 | ||||||
|  |   minPlayers: 5 | ||||||
|  |   timeUntilHidersSword: 0 | ||||||
|  |   spawnWarp: | ||||||
|  |     ==: BlockHuntLocation | ||||||
|  |     p: 4.200027 | ||||||
|  |     a: 41.700073 | ||||||
|  |     w: games | ||||||
|  |     x: -178.5 | ||||||
|  |     y: 33.0 | ||||||
|  |     z: -130.5 | ||||||
|  |   allowedCommands: [] | ||||||
|  |   arenaName: TestArena | ||||||
|  |   amountSeekersOnStart: 3 | ||||||
|  |   pos1: | ||||||
|  |     ==: BlockHuntLocation | ||||||
|  |     w: games | ||||||
|  |     x: 576.0 | ||||||
|  |     y: 2.0 | ||||||
|  |     z: 503.0 | ||||||
|  |   pos2: | ||||||
|  |     ==: BlockHuntLocation | ||||||
|  |     w: games | ||||||
|  |     x: 428.0 | ||||||
|  |     y: 66.0 | ||||||
|  |     z: 342.0 | ||||||
|  |   waitingTimeSeeker: 20 | ||||||
|  |   seekersTokenWin: 0 | ||||||
|  |   lobbyWarp: | ||||||
|  |     ==: BlockHuntLocation | ||||||
|  |     p: 4.19999 | ||||||
|  |     a: -182.09694 | ||||||
|  |     w: games | ||||||
|  |     x: 500.66289894368725 | ||||||
|  |     y: 4.0 | ||||||
|  |     z: 497.83982348350094 | ||||||
|  |   seekersWinCommands: [] | ||||||
|  |   killTokens: 0 | ||||||
|  |   gameTime: 660 | ||||||
|  |   disguiseBlocks: | ||||||
|  |   - ==: org.bukkit.inventory.ItemStack | ||||||
|  |     type: BOOKSHELF | ||||||
|  |   - ==: org.bukkit.inventory.ItemStack | ||||||
|  |     type: GLOWSTONE | ||||||
|  |     meta: | ||||||
|  |       ==: ItemMeta | ||||||
|  |       meta-type: UNSPECIFIC | ||||||
|  |       enchants: | ||||||
|  |         DURABILITY: 10 | ||||||
|  |   - ==: org.bukkit.inventory.ItemStack | ||||||
|  |     type: EMERALD_BLOCK | ||||||
|  |   - ==: org.bukkit.inventory.ItemStack | ||||||
|  |     type: WOOL | ||||||
|  |     damage: 5 | ||||||
|  |   - ==: org.bukkit.inventory.ItemStack | ||||||
|  |     type: ICE | ||||||
|  |   - ==: org.bukkit.inventory.ItemStack | ||||||
|  |     type: MYCEL | ||||||
|  |   - ==: org.bukkit.inventory.ItemStack | ||||||
|  |     type: SAND | ||||||
|  |   hidersWarp: | ||||||
|  |     ==: BlockHuntLocation | ||||||
|  |     p: -1.9500121 | ||||||
|  |     a: 179.85266 | ||||||
|  |     w: games | ||||||
|  |     x: 500.52591580497256 | ||||||
|  |     y: 4.0 | ||||||
|  |     z: 482.31326505008246 | ||||||
|  |   blockAnnouncerTime: 45 | ||||||
|  |   seekersWarp: | ||||||
|  |     ==: BlockHuntLocation | ||||||
|  |     p: 17.69996 | ||||||
|  |     a: 90.15417 | ||||||
|  |     w: games | ||||||
|  |     x: 519.6272528902401 | ||||||
|  |     y: 42.0 | ||||||
|  |     z: 453.4140380016035 | ||||||
|  |   hidersTokenWin: 0 | ||||||
							
								
								
									
										87
									
								
								src/test/resources/config.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										87
									
								
								src/test/resources/config.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,87 @@ | |||||||
|  | chat: | ||||||
|  |   tag: '[BlockHunt] ' | ||||||
|  |   normal: '&b' | ||||||
|  |   warning: '&c' | ||||||
|  |   error: '&c' | ||||||
|  |   arg: '&e' | ||||||
|  |   header: '&9' | ||||||
|  |   headerhigh: '%H_______.[ %A%header%%H ]._______' | ||||||
|  | commandEnabled: | ||||||
|  |   info: true | ||||||
|  |   help: true | ||||||
|  |   reload: true | ||||||
|  |   join: true | ||||||
|  |   leave: true | ||||||
|  |   list: true | ||||||
|  |   shop: true | ||||||
|  |   start: true | ||||||
|  |   wand: true | ||||||
|  |   create: true | ||||||
|  |   set: true | ||||||
|  |   setwarp: true | ||||||
|  |   remove: true | ||||||
|  |   tokens: true | ||||||
|  | autoUpdateCheck: false | ||||||
|  | autoDownloadUpdate: false | ||||||
|  | wandIDname: STICK | ||||||
|  | wandName: '%A&lBlockHunt%N''s selection wand' | ||||||
|  | wandDescription: | ||||||
|  | - '%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 <help|h>' | ||||||
|  | shop: | ||||||
|  |   title: '%H&lBlockHunt %NShop' | ||||||
|  |   price: '%NPrice: %A%amount% %Ntokens.' | ||||||
|  |   blockChooserv1Enabled: true | ||||||
|  |   blockChooserv1IDname: BOOK | ||||||
|  |   blockChooserv1Price: 3000 | ||||||
|  |   blockChooserv1Name: '%H&lBlockHunt Chooser' | ||||||
|  |   blockChooserv1Description: | ||||||
|  |   - '%NUse this item before the arena starts.' | ||||||
|  |   - '%ARight-Click%N in the lobby and choose' | ||||||
|  |   - '%Nthe block you want to be!' | ||||||
|  |   - '&6Unlimited uses.' | ||||||
|  |   BlockHuntPassv2Enabled: true | ||||||
|  |   BlockHuntPassv2IDName: NAME_TAG | ||||||
|  |   BlockHuntPassv2Price: 150 | ||||||
|  |   BlockHuntPassv2Name: '%H&lBlockHunt Pass' | ||||||
|  |   BlockHuntPassv2Description: | ||||||
|  |   - '%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.' | ||||||
|  | sign: | ||||||
|  |   LEAVE: | ||||||
|  |   - '%H[BlockHunt%H]' | ||||||
|  |   - '&4LEAVE' | ||||||
|  |   - '&8Right-Click' | ||||||
|  |   - '&8To leave.' | ||||||
|  |   SHOP: | ||||||
|  |   - '%H[BlockHunt%H]' | ||||||
|  |   - '&4SHOP' | ||||||
|  |   - '&8Right-Click' | ||||||
|  |   - '&8To shop.' | ||||||
|  |   WAITING: | ||||||
|  |   - '%H[BlockHunt%H]' | ||||||
|  |   - '&5%arenaname%' | ||||||
|  |   - '&5%players%&6/&5%maxplayers%' | ||||||
|  |   - '&8Waiting...' | ||||||
|  |   STARTING: | ||||||
|  |   - '%H[BlockHunt%H]' | ||||||
|  |   - '&5%arenaname%' | ||||||
|  |   - '&5%players%&6/&5%maxplayers%' | ||||||
|  |   - '&2Start: %A%timeleft%' | ||||||
|  |   INGAME: | ||||||
|  |   - '%H[BlockHunt%H]' | ||||||
|  |   - '&5%arenaname%' | ||||||
|  |   - '&5%players%&6/&5%maxplayers%' | ||||||
|  |   - '%EIngame: %A%timeleft%' | ||||||
|  | scoreboard: | ||||||
|  |   enabled: true | ||||||
|  |   title: '%H[BlockHunt]' | ||||||
|  |   timeleft: '%ATime left:' | ||||||
|  |   seekers: '%NSeekers:' | ||||||
|  |   hiders: '%NHiders:' | ||||||
|  | requireInventoryClearOnJoin: false | ||||||
							
								
								
									
										99
									
								
								src/test/resources/messages.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										99
									
								
								src/test/resources/messages.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,99 @@ | |||||||
|  | log: | ||||||
|  |   enabledPlugin: '%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%autors%%N.' | ||||||
|  |   disabledPlugin: '%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%autors%%N.' | ||||||
|  | help: | ||||||
|  |   info: '%NDisplays the plugin''s info.' | ||||||
|  |   help: '%NShows a list of commands.' | ||||||
|  |   reload: '%NReloads all configs.' | ||||||
|  |   join: '%NJoins a BlockHunt game.' | ||||||
|  |   leave: '%NLeave a BlockHunt game.' | ||||||
|  |   list: '%NShows a list of available arenas.' | ||||||
|  |   shop: '%NOpens the BlockHunt shop.' | ||||||
|  |   start: '%NForces an arena to start.' | ||||||
|  |   wand: '%NGives you the wand selection tool.' | ||||||
|  |   create: '%NCreates an arena from your selection.' | ||||||
|  |   set: '%NOpens a panel to set settings.' | ||||||
|  |   setwarp: '%NSets warps for your arena.' | ||||||
|  |   remove: '%NDeletes an Arena.' | ||||||
|  |   tokens: '%NChange someones tokens.' | ||||||
|  | button: | ||||||
|  |   add: '%NAdd %A%1%%N to %A%2%%N' | ||||||
|  |   add2: Add | ||||||
|  |   setting: '%NSetting %A%1%%N is now: %A%2%%N.' | ||||||
|  |   remove: '%NRemove %A%1%%N from %A%2%%N' | ||||||
|  |   remove2: Remove | ||||||
|  | normal: | ||||||
|  |   reloadedConfigs: '%TAG&aReloaded all configs!' | ||||||
|  |   joinJoinedArena: '%TAG%A%playername%%N joined your arena. (%A%1%%N/%A%2%%N)' | ||||||
|  |   leaveYouLeft: '%TAG%NYou left the arena! Thanks for playing!' | ||||||
|  |   leaveLeftArena: '%TAG%A%playername%%N left your arena. (%A%1%%N/%A%2%%N)' | ||||||
|  |   startForced: '%TAG%NYou forced to start arena ''%A%arenaname%%N''!' | ||||||
|  |   wandGaveWand: '%TAG%NHere you go! &o(Use the %A&o%type%%N&o!)' | ||||||
|  |   wandSetPosition: '%TAG%NSet position %A#%number%%N to location: (%A%x%%N, %A%y%%N, | ||||||
|  |     %A%z%%N).' | ||||||
|  |   createCreatedArena: '%TAG%NCreated an arena with the name ''%A%name%%N''.' | ||||||
|  |   lobbyArenaIsStarting: '%TAG%NThe arena will start in %A%1%%N second(s)!' | ||||||
|  |   lobbyArenaStarted: '%TAG%NThe arena has been started! The seeker is coming to find | ||||||
|  |     you in %A%secs%%N seconds!' | ||||||
|  |   ingameSeekerChoosen: '%TAG%NPlayer %A%seeker%%N has been choosen as seeker!' | ||||||
|  |   ingameBlock: '%TAG%NYou''re disguised as a(n) ''%A%block%%N'' block.' | ||||||
|  |   ingameArenaEnd: '%TAG%NThe arena will end in %A%1%%N second(s)!' | ||||||
|  |   ingameSeekerSpawned: '%TAG%A%playername%%N has spawned as a seeker!' | ||||||
|  |   ingameGivenSword: '%TAG%NYou were given a sword!' | ||||||
|  |   ingameHiderDied: '%TAG%NHider %A%playername%%N was killed by %A%killer%%N!' | ||||||
|  |   ingameHidersLeft: '%NHider(s) left: %A%left%%N' | ||||||
|  |   ingameSeekerDied: '%TAG%NSeeker %A%playername%%N died and will respawn in %A%secs%%N | ||||||
|  |     seconds!' | ||||||
|  |   winSeekers: '%TAG%NThe %ASEEKERS%N have won!' | ||||||
|  |   winHiders: '%TAG%NThe %AHIDERS%N have won!' | ||||||
|  |   setwarpWarpSet: '%TAG%NSet warp ''%A%warp%%N'' to your location!' | ||||||
|  |   addedToken: '%TAG%A%amount%%N tokens were added to your account!' | ||||||
|  |   removeRemovedArena: '%TAG%NRemoved arena ''%A%name%%N''!' | ||||||
|  |   tokensChanged: '%TAG%N%option% %A%amount%%N tokens %option2% %A%playername%%N.' | ||||||
|  |   tokensChangedPerson: '%TAG%NPlayer %A%playername%%N %N%option% %A%amount%%N %option2% | ||||||
|  |     your tokens.' | ||||||
|  |   ingameNowSolid: '%TAG%NYou''re now a solid ''%A%block%%N'' block!' | ||||||
|  |   ingameNoMoreSolid: '%TAG%NYou''re no longer a solid block!' | ||||||
|  |   shopBoughtItem: '%TAG%NYou''ve bought the ''%A%itemname%%N'' item!' | ||||||
|  |   shopChoosenBlock: '%TAG%NYou''ve choosen to be a(n) ''%A%block%%N'' block!' | ||||||
|  |   shopChoosenSeeker: '%TAG%NYou''ve choosen to be a %Aseeker%N!' | ||||||
|  |   shopChoosenHiders: '%TAG%NYou''ve choosen to be a %Ahider%N!' | ||||||
|  |   ingameBlocksLeft: '%TAG%NRemaining blocks: %A%1%%N' | ||||||
|  | warning: | ||||||
|  |   lobbyNeedAtleast: '%TAG%WYou need atleast %A%1%%W player(s) to start the game!' | ||||||
|  |   ingameNEWSeekerChoosen: '%TAG%WThe last seeker left and a new seeker has been choosen!' | ||||||
|  |   unableToCommand: '%TAG%WSorry but that command is disabled in the arena.' | ||||||
|  |   ingameNoSolidPlace: '%TAG%WThat''s not a valid place to become solid!' | ||||||
|  |   arenaStopped: '%TAG%WThe arena has been forced to stop!' | ||||||
|  | error: | ||||||
|  |   noPermission: '%TAG%EYou don''t have the permissions to do that!' | ||||||
|  |   notANumber: '%TAG%E''%A%1%%E'' is not a number!' | ||||||
|  |   commandNotEnabled: '%TAG%EThis command has been disabled!' | ||||||
|  |   commandNotFound: '%TAG%ECouldn''t find the command. Try %A/BlockHunt help %Efor | ||||||
|  |     more info.' | ||||||
|  |   notEnoughArguments: '%TAG%EYou''re missing arguments, correct syntax: %A%syntax%' | ||||||
|  |   libsDisguisesNotInstalled: '%TAG%EThe plugin ''%ALib''s Disguises%E'' is required | ||||||
|  |     to run this plugin! Intall it or it won''t work!' | ||||||
|  |   protocolLibNotInstalled: '%TAG%EThe plugin ''%AProtocolLib%E'' is required to run | ||||||
|  |     this plugin! Intall it or it won''t work!' | ||||||
|  |   noArena: '%TAG%ENo arena found with the name ''%A%name%%E''.' | ||||||
|  |   onlyIngame: '%TAG%EThis is an only in-game command!' | ||||||
|  |   joinAlreadyJoined: '%TAG%EYou''ve already joined an arena!' | ||||||
|  |   joinNoBlocksSet: '%TAG%EThere are none blocks set for this arena. Notify the administrator.' | ||||||
|  |   joinWarpsNotSet: '%TAG%EThere are no warps set for this arena. Notify the administrator.' | ||||||
|  |   joinArenaIngame: '%TAG%EThis game has already started.' | ||||||
|  |   joinFull: '%TAG%EUnable to join this arena. It''s full!' | ||||||
|  |   joinInventoryNotEmpty: '%TAG%EYour inventory should be empty before joining!' | ||||||
|  |   leaveNotInArena: '%TAG%EYou''re not in an arena!' | ||||||
|  |   createSelectionFirst: '%TAG%EMake a selection first. Use the wand command: %A/BlockHunt | ||||||
|  |     <wand|w>%E.' | ||||||
|  |   createNotSameWorld: '%TAG%EMake your selection points in the same world!' | ||||||
|  |   setTooHighNumber: '%TAG%EThat amount is too high! Max amount is: %A%max%%E.' | ||||||
|  |   setTooLowNumber: '%TAG%EThat amount is too low! Minimal amount is: %A%min%%E.' | ||||||
|  |   setNotABlock: '%TAG%EThat is not a block!' | ||||||
|  |   setwarpWarpNotFound: '%TAG%EWarp ''%A%warp%%E'' is not valid!' | ||||||
|  |   tokensPlayerNotOnline: '%TAG%ENo player found with the name ''%A%playername%%E''!' | ||||||
|  |   tokensUnknownsetting: '%TAG%E''%A%option%%E'' is not a known option!' | ||||||
|  |   shopNeedMoreTokens: '%TAG%EYou need more tokens before you can buy this item.' | ||||||
|  |   shopMaxSeekersReached: '%TAG%ESorry, the maximum amount of seekers has been reached!' | ||||||
|  |   shopMaxHidersReached: '%TAG%ESorry, the maximum amount of hiders has been reached!' | ||||||
		Reference in New Issue
	
	Block a user
	 
				 Narimm
					Narimm