From c5babc22d082abf47b879e39a029791a4bb54e6a Mon Sep 17 00:00:00 2001 From: montlikadani Date: Thu, 16 Aug 2018 18:28:57 +0200 Subject: [PATCH] Update ConfigManager.java --- .../gamingmesh/jobs/config/ConfigManager.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index 701819ee..8deb285b 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -368,7 +368,7 @@ public class ConfigManager { File f = new File(plugin.getDataFolder(), "jobConfig.yml"); InputStreamReader s = new InputStreamReader(new FileInputStream(f), "UTF-8"); - ArrayList jobs = new ArrayList(); + ArrayList jobs = new ArrayList<>(); Jobs.setJobs(jobs); Jobs.setNoneJob(null); if (!f.exists()) { @@ -446,7 +446,7 @@ public class ConfigManager { String description = org.bukkit.ChatColor.translateAlternateColorCodes('&', jobSection.getString("description", "")); - List fDescription = new ArrayList(); + List fDescription = new ArrayList<>(); if (jobSection.contains("FullDescription")) { if (jobSection.isString("FullDescription")) fDescription.add(jobSection.getString("FullDescription")); @@ -564,7 +564,7 @@ public class ConfigManager { } // Permissions - ArrayList jobPermissions = new ArrayList(); + ArrayList jobPermissions = new ArrayList<>(); ConfigurationSection permissionsSection = jobSection.getConfigurationSection("permissions"); if (permissionsSection != null) { for (String permissionKey : permissionsSection.getKeys(false)) { @@ -582,7 +582,7 @@ public class ConfigManager { } // Conditions - ArrayList jobConditions = new ArrayList(); + ArrayList jobConditions = new ArrayList<>(); ConfigurationSection conditionsSection = jobSection.getConfigurationSection("conditions"); if (conditionsSection != null) { for (String ConditionKey : conditionsSection.getKeys(false)) { @@ -605,19 +605,19 @@ public class ConfigManager { } // Command on leave - List JobsCommandOnLeave = new ArrayList(); + List JobsCommandOnLeave = new ArrayList<>(); if (jobSection.isList("cmd-on-leave")) { JobsCommandOnLeave = jobSection.getStringList("cmd-on-leave"); } // Command on join - List JobsCommandOnJoin = new ArrayList(); + List JobsCommandOnJoin = new ArrayList<>(); if (jobSection.isList("cmd-on-join")) { JobsCommandOnJoin = jobSection.getStringList("cmd-on-join"); } // Commands - ArrayList jobCommand = new ArrayList(); + ArrayList jobCommand = new ArrayList<>(); ConfigurationSection commandsSection = jobSection.getConfigurationSection("commands"); if (commandsSection != null) { for (String commandKey : commandsSection.getKeys(false)) { @@ -628,7 +628,7 @@ public class ConfigManager { Jobs.getPluginLogger().warning("Job " + jobKey + " has an invalid command key" + commandKey + "!"); continue; } - List commands = new ArrayList(); + List commands = new ArrayList<>(); if (commandSection.isString("command")) commands.add(commandSection.getString("command")); else if (commandSection.isList("command")) @@ -640,7 +640,7 @@ public class ConfigManager { } // Items - HashMap jobItems = new HashMap(); + HashMap jobItems = new HashMap<>(); ConfigurationSection itemsSection = jobSection.getConfigurationSection("items"); if (itemsSection != null) { for (String itemKey : itemsSection.getKeys(false)) { @@ -657,13 +657,13 @@ public class ConfigManager { if (itemSection.isString("name")) name = itemSection.getString("name"); - List lore = new ArrayList(); + List lore = new ArrayList<>(); if (itemSection.getStringList("lore") != null) for (String eachLine : itemSection.getStringList("lore")) { lore.add(org.bukkit.ChatColor.translateAlternateColorCodes('&', eachLine)); } - HashMap enchants = new HashMap(); + HashMap enchants = new HashMap<>(); if (itemSection.getStringList("enchants") != null) for (String eachLine : itemSection.getStringList("enchants")) { @@ -695,7 +695,7 @@ public class ConfigManager { } // Limited Items - ArrayList jobLimitedItems = new ArrayList(); + ArrayList jobLimitedItems = new ArrayList<>(); ConfigurationSection LimitedItemsSection = jobSection.getConfigurationSection("limitedItems"); if (LimitedItemsSection != null) { for (String itemKey : LimitedItemsSection.getKeys(false)) { @@ -712,13 +712,13 @@ public class ConfigManager { if (itemSection.isString("name")) name = itemSection.getString("name"); - List lore = new ArrayList(); + List lore = new ArrayList<>(); if (itemSection.getStringList("lore") != null) for (String eachLine : itemSection.getStringList("lore")) { lore.add(org.bukkit.ChatColor.translateAlternateColorCodes('&', eachLine)); } - HashMap enchants = new HashMap(); + HashMap enchants = new HashMap<>(); if (itemSection.getStringList("enchants") != null) for (String eachLine : itemSection.getStringList("enchants")) { @@ -753,7 +753,7 @@ public class ConfigManager { if (jobSection.contains("Quests")) { - List quests = new ArrayList(); + List quests = new ArrayList<>(); ConfigurationSection qsection = jobSection.getConfigurationSection("Quests"); for (String one : qsection.getKeys(false)) { @@ -816,7 +816,7 @@ public class ConfigManager { for (ActionType actionType : ActionType.values()) { ConfigurationSection typeSection = jobSection.getConfigurationSection(actionType.getName()); - ArrayList jobInfo = new ArrayList(); + ArrayList jobInfo = new ArrayList<>(); if (typeSection != null) { for (String key : typeSection.getKeys(false)) { ConfigurationSection section = typeSection.getConfigurationSection(key);