diff --git a/libs/MyPet-2.3.0-SNAPSHOT.jar b/libs/MyPet-2.3.0-SNAPSHOT.jar deleted file mode 100644 index b5471ecf..00000000 Binary files a/libs/MyPet-2.3.0-SNAPSHOT.jar and /dev/null differ diff --git a/libs/MyPet-3.0-SNAPSHOT.jar b/libs/MyPet-3.0-SNAPSHOT.jar new file mode 100644 index 00000000..614aaca4 Binary files /dev/null and b/libs/MyPet-3.0-SNAPSHOT.jar differ diff --git a/libs/WorldEdit6.0.0.jar b/libs/WorldEdit6.0.0.jar deleted file mode 100644 index 24fd7fc7..00000000 Binary files a/libs/WorldEdit6.0.0.jar and /dev/null differ diff --git a/libs/worldedit-bukkit-7.0.0-SNAPSHOT-dist.jar b/libs/worldedit-bukkit-7.0.0-SNAPSHOT-dist.jar new file mode 100644 index 00000000..9415f758 Binary files /dev/null and b/libs/worldedit-bukkit-7.0.0-SNAPSHOT-dist.jar differ diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffectManager.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffectManager.java index f643b22c..7dc84385 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffectManager.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffectManager.java @@ -292,7 +292,7 @@ public class CMIEffectManager { } public static List getParticleList() { - List ls = new ArrayList(); + List ls = new ArrayList<>(); for (CMIParticle one : CMIParticle.values()) { if (!one.isParticle()) continue; diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java index 9db29a13..ea700d02 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java @@ -107,7 +107,7 @@ public class CMIItemStack { ItemMeta meta = this.getItemStack().getItemMeta(); List lore = meta.getLore(); if (lore == null) - lore = new ArrayList(); + lore = new ArrayList<>(); lore.add(ChatColor.translateAlternateColorCodes('&', string)); meta.setLore(lore); this.getItemStack().setItemMeta(meta); @@ -116,7 +116,7 @@ public class CMIItemStack { public CMIItemStack clearLore() { ItemMeta meta = this.getItemStack().getItemMeta(); - List t = new ArrayList(); + List t = new ArrayList<>(); meta.setLore(t); this.getItemStack().setItemMeta(meta); return this; @@ -126,7 +126,7 @@ public class CMIItemStack { if (lore == null || lore.isEmpty()) return this; ItemMeta meta = this.getItemStack().getItemMeta(); - List t = new ArrayList(); + List t = new ArrayList<>(); for (String one : lore) { t.add(ChatColor.translateAlternateColorCodes('&', one)); } @@ -165,7 +165,7 @@ public class CMIItemStack { if (meta != null) { List lore = meta.getLore(); if (lore == null) { - lore = new ArrayList(); + lore = new ArrayList<>(); meta.setLore(lore); } diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java index dd509d67..cee02214 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java @@ -23,10 +23,10 @@ import com.gamingmesh.jobs.stuff.VersionChecker.Version; public class ItemManager { - static HashMap byId = new HashMap(); - static HashMap byBukkitName = new HashMap(); - static HashMap byMojangName = new HashMap(); - static HashMap byMaterial = new HashMap(); + static HashMap byId = new HashMap<>(); + static HashMap byBukkitName = new HashMap<>(); + static HashMap byMojangName = new HashMap<>(); + static HashMap byMaterial = new HashMap<>(); static final Version version = Jobs.getVersionCheckManager().getVersion(); public static void load() { @@ -122,7 +122,7 @@ public class ItemManager { return cm; } - static HashMap headCache = new HashMap(); + static HashMap headCache = new HashMap<>(); public static CMIItemStack getItem(String name) { if (byBukkitName.isEmpty()) @@ -279,7 +279,7 @@ public class ItemManager { } static public List getAllRecipes() { - List results = new ArrayList(); + List results = new ArrayList<>(); Iterator iter = Bukkit.recipeIterator(); while (iter.hasNext()) { Recipe recipe = iter.next(); @@ -290,7 +290,7 @@ public class ItemManager { static public List getRecipesFor(ItemStack result) { - List results = new ArrayList(); + List results = new ArrayList<>(); Iterator iter = Bukkit.recipeIterator(); while (iter.hasNext()) { Recipe recipe = iter.next(); @@ -1584,7 +1584,7 @@ public class ItemManager { public static CMIMaterial getRandom(CMIMaterial mat) { - List ls = new ArrayList(); + List ls = new ArrayList<>(); for (CMIMaterial one : CMIMaterial.values()) { if (one.getLegacyId() == -1) diff --git a/src/main/java/com/gamingmesh/jobs/Gui/GuiInfoList.java b/src/main/java/com/gamingmesh/jobs/Gui/GuiInfoList.java index cb21c3b7..5b3c0f6d 100644 --- a/src/main/java/com/gamingmesh/jobs/Gui/GuiInfoList.java +++ b/src/main/java/com/gamingmesh/jobs/Gui/GuiInfoList.java @@ -8,7 +8,7 @@ import com.gamingmesh.jobs.container.Job; public class GuiInfoList { String name; - List jobList = new ArrayList(); + List jobList = new ArrayList<>(); Boolean jobInfo = false; int backButton = 27; diff --git a/src/main/java/com/gamingmesh/jobs/Gui/GuiManager.java b/src/main/java/com/gamingmesh/jobs/Gui/GuiManager.java index 481b4659..8df6de26 100644 --- a/src/main/java/com/gamingmesh/jobs/Gui/GuiManager.java +++ b/src/main/java/com/gamingmesh/jobs/Gui/GuiManager.java @@ -25,7 +25,7 @@ import com.gamingmesh.jobs.container.JobsPlayer; public class GuiManager { - public HashMap GuiList = new HashMap(); + public HashMap GuiList = new HashMap<>(); public void CloseInventories() { for (Entry one : GuiList.entrySet()) { @@ -68,7 +68,7 @@ public class GuiManager { public Inventory CreateJobsGUI(Player player) { - ArrayList JobsList = new ArrayList(); + ArrayList JobsList = new ArrayList<>(); for (Job job : Jobs.getJobs()) { if (Jobs.getGCManager().getHideJobsWithoutPermission()) if (!Jobs.getCommandManager().hasJobPermission(player, job)) @@ -117,7 +117,7 @@ public class GuiManager { break main; Job job = JobsList.get(i); - ArrayList Lore = new ArrayList(); + ArrayList Lore = new ArrayList<>(); for (JobProgression onePJob : pJobs) { if (onePJob.getJob().getName().equalsIgnoreCase(job.getName())) @@ -198,7 +198,7 @@ public class GuiManager { int numjobs = JPlayer.getJobProgression().size(); - List items = new ArrayList(); + List items = new ArrayList<>(); int i = 0; for (ActionType actionType : ActionType.values()) { List info = job.getJobInfo(actionType); @@ -206,7 +206,7 @@ public class GuiManager { if (info == null || info.isEmpty()) continue; - ArrayList Lore = new ArrayList(); + ArrayList Lore = new ArrayList<>(); Lore.add(ChatColor.translateAlternateColorCodes('&', "&e" + Jobs.getLanguage().getMessage("command.info.output." + actionType.getName().toLowerCase() + ".info"))); int y = 1; diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index 22518c02..51c77f0b 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -96,7 +96,6 @@ import com.gamingmesh.jobs.listeners.PistonProtectionListener; import com.gamingmesh.jobs.selection.SelectionManager; import com.gamingmesh.jobs.stuff.ActionBar; import com.gamingmesh.jobs.stuff.CMIScoreboardManager; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling; import com.gamingmesh.jobs.stuff.Loging; import com.gamingmesh.jobs.stuff.RawMessage; @@ -106,7 +105,6 @@ import com.gamingmesh.jobs.tasks.BufferedPaymentThread; import com.gamingmesh.jobs.tasks.DatabaseSaveThread; public class Jobs extends JavaPlugin { -// public static Jobs plugin = new Jobs(); private static String version = ""; private static PlayerManager pManager = null; private static JobsCommands cManager = null; @@ -146,9 +144,9 @@ public class Jobs extends JavaPlugin { private static JobsDAO dao = null; private static List jobs = null; private static Job noneJob = null; - private static WeakHashMap usedSlots = new WeakHashMap(); - public static WeakHashMap actionbartoggle = new WeakHashMap(); - public static WeakHashMap BossBartoggle = new WeakHashMap(); + private static WeakHashMap usedSlots = new WeakHashMap<>(); + public static WeakHashMap actionbartoggle = new WeakHashMap<>(); + public static WeakHashMap BossBartoggle = new WeakHashMap<>(); // public static WeakHashMap GlobalBoost = new WeakHashMap(); private static BufferedEconomy economy; private static PermissionHandler permissionHandler; @@ -159,7 +157,7 @@ public class Jobs extends JavaPlugin { public static BufferedPaymentThread paymentThread = null; private static DatabaseSaveThread saveTask = null; - public static HashMap FastPayment = new HashMap(); + public static HashMap FastPayment = new HashMap<>(); private static NMS nms; @@ -552,7 +550,7 @@ public class Jobs extends JavaPlugin { public static void loadAllPlayersData() { long time = System.currentTimeMillis(); // Cloning to avoid issues - HashMap temp = new HashMap(Jobs.getPlayerManager().getPlayersInfoUUIDMap()); + HashMap temp = new HashMap<>(Jobs.getPlayerManager().getPlayersInfoUUIDMap()); HashMap> playersJobs = Jobs.getJobsDAO().getAllJobs(); HashMap playersPoints = Jobs.getJobsDAO().getAllPoints(); HashMap> playersLogs = Jobs.getJobsDAO().getAllLogs(); @@ -846,8 +844,7 @@ public class Jobs extends JavaPlugin { FurnaceBrewingHandling.load(); String message = ChatColor.translateAlternateColorCodes('&', "&e[Jobs] Plugin has been enabled succesfully."); - ConsoleCommandSender console = Bukkit.getServer().getConsoleSender(); - console.sendMessage(message); + Bukkit.getServer().getConsoleSender().sendMessage(message); lManager.reload(); cManager.fillCommands(); @@ -870,8 +867,7 @@ public class Jobs extends JavaPlugin { Jobs.shutdown(); String message = ChatColor.translateAlternateColorCodes('&', "&e[Jobs] &2Plugin has been disabled succesfully."); - ConsoleCommandSender console = Bukkit.getServer().getConsoleSender(); - console.sendMessage(message); + Bukkit.getServer().getConsoleSender().sendMessage(message); this.setEnabled(false); } @@ -995,7 +991,7 @@ public class Jobs extends JavaPlugin { Jobs.getEconomy().pay(jPlayer, income, pointAmount, 0.0); if (GconfigManager.LoggingUse) { - HashMap amounts = new HashMap(); + HashMap amounts = new HashMap<>(); amounts.put(CurrencyType.MONEY, income); loging.recordToLog(jPlayer, info, amounts); } @@ -1133,7 +1129,7 @@ public class Jobs extends JavaPlugin { int oldLevel = prog.getLevel(); if (GconfigManager.LoggingUse) { - HashMap amounts = new HashMap(); + HashMap amounts = new HashMap<>(); amounts.put(CurrencyType.MONEY, income); amounts.put(CurrencyType.EXP, expAmount); amounts.put(CurrencyType.POINTS, pointAmount); @@ -1290,7 +1286,7 @@ public class Jobs extends JavaPlugin { int oldLevel = prog.getLevel(); if (GconfigManager.LoggingUse) { - HashMap amounts = new HashMap(); + HashMap amounts = new HashMap<>(); amounts.put(CurrencyType.MONEY, payment.getAmount()); amounts.put(CurrencyType.EXP, payment.getExp()); amounts.put(CurrencyType.POINTS, payment.getPoints()); diff --git a/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobs4.java b/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobs4.java index b2bec8ba..630a9919 100644 --- a/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobs4.java +++ b/src/main/java/com/gamingmesh/jobs/MythicMobs/MythicMobs4.java @@ -6,7 +6,6 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.plugin.Plugin; import com.gamingmesh.jobs.Jobs; -import com.gamingmesh.jobs.stuff.Debug; import io.lumine.xikage.mythicmobs.MythicMobs; import io.lumine.xikage.mythicmobs.api.bukkit.BukkitAPIHelper; diff --git a/src/main/java/com/gamingmesh/jobs/PermissionHandler.java b/src/main/java/com/gamingmesh/jobs/PermissionHandler.java index 182d528f..5f721a76 100644 --- a/src/main/java/com/gamingmesh/jobs/PermissionHandler.java +++ b/src/main/java/com/gamingmesh/jobs/PermissionHandler.java @@ -66,7 +66,7 @@ public class PermissionHandler { if (hasWorldPermission(player)) { List progression = jPlayer.getJobProgression(); // calculate new permissions - HashMap permissions = new HashMap(); + HashMap permissions = new HashMap<>(); if (progression.size() == 0) { Job job = Jobs.getNoneJob(); diff --git a/src/main/java/com/gamingmesh/jobs/PermissionManager.java b/src/main/java/com/gamingmesh/jobs/PermissionManager.java index e83d65a8..d8398b84 100644 --- a/src/main/java/com/gamingmesh/jobs/PermissionManager.java +++ b/src/main/java/com/gamingmesh/jobs/PermissionManager.java @@ -32,7 +32,7 @@ import com.gamingmesh.jobs.container.JobsPlayer; public class PermissionManager { - HashMap permDelay = new HashMap(); + HashMap permDelay = new HashMap<>(); private enum prm { // jobs_join_JOBNAME(remade("jobs.join.%JOBNAME%"), 60 * 1000), @@ -70,7 +70,7 @@ public class PermissionManager { } private static List remade(String perm) { - List perms = new ArrayList(); + List perms = new ArrayList<>(); for (Job oneJ : Jobs.getJobs()) { String t = perm; if (t.contains("%JOBNAME%")) @@ -107,7 +107,7 @@ public class PermissionManager { } private static HashMap getAll(Player player) { - HashMap mine = new HashMap(); + HashMap mine = new HashMap<>(); for (PermissionAttachmentInfo permission : player.getEffectivePermissions()) { if (permission.getPermission().startsWith("jobs.")) mine.put(permission.getPermission(), permission.getValue()); diff --git a/src/main/java/com/gamingmesh/jobs/PlayerManager.java b/src/main/java/com/gamingmesh/jobs/PlayerManager.java index d81c3ce4..4944601d 100644 --- a/src/main/java/com/gamingmesh/jobs/PlayerManager.java +++ b/src/main/java/com/gamingmesh/jobs/PlayerManager.java @@ -63,17 +63,17 @@ import com.gamingmesh.jobs.stuff.PerformCommands; public class PlayerManager { // private Map players = Collections.synchronizedMap(new HashMap()); - private ConcurrentHashMap playersCache = new ConcurrentHashMap(); - private ConcurrentHashMap playersUUIDCache = new ConcurrentHashMap(); - private ConcurrentHashMap players = new ConcurrentHashMap(); - private ConcurrentHashMap playersUUID = new ConcurrentHashMap(); + private ConcurrentHashMap playersCache = new ConcurrentHashMap<>(); + private ConcurrentHashMap playersUUIDCache = new ConcurrentHashMap<>(); + private ConcurrentHashMap players = new ConcurrentHashMap<>(); + private ConcurrentHashMap playersUUID = new ConcurrentHashMap<>(); private PointsData PointsDatabase = new PointsData(); private final String mobSpawnerMetadata = "jobsMobSpawner"; - private HashMap PlayerUUIDMap = new HashMap(); - private HashMap PlayerIDMap = new HashMap(); - private HashMap PlayerNameMap = new HashMap(); + private HashMap PlayerUUIDMap = new HashMap<>(); + private HashMap PlayerIDMap = new HashMap<>(); + private HashMap PlayerNameMap = new HashMap<>(); Jobs plugin; public PlayerManager(Jobs plugin) { @@ -214,7 +214,7 @@ public class PlayerManager { * 2) Perform save on all players on copied list. * 3) Garbage collect the real list to remove any offline players with saved data */ - ArrayList list = new ArrayList(this.players.values()); + ArrayList list = new ArrayList<>(this.players.values()); for (JobsPlayer jPlayer : list) { jPlayer.save(); @@ -414,7 +414,7 @@ public class PlayerManager { * @param jPlayer */ public void leaveAllJobs(JobsPlayer jPlayer) { - List jobs = new ArrayList(); + List jobs = new ArrayList<>(); jobs.addAll(jPlayer.getJobProgression()); for (JobProgression job : jobs) { leaveJob(jPlayer, job.getJob()); @@ -729,7 +729,7 @@ public class PlayerManager { } } - HashMap> cache = new HashMap>(); + HashMap> cache = new HashMap<>(); public void resetiItemBonusCache(UUID uuid) { cache.remove(uuid); diff --git a/src/main/java/com/gamingmesh/jobs/Signs/SignInfo.java b/src/main/java/com/gamingmesh/jobs/Signs/SignInfo.java index 3c63ce2e..43455c9d 100644 --- a/src/main/java/com/gamingmesh/jobs/Signs/SignInfo.java +++ b/src/main/java/com/gamingmesh/jobs/Signs/SignInfo.java @@ -5,7 +5,7 @@ import java.util.List; public class SignInfo { - List AllSigns = new ArrayList(); + List AllSigns = new ArrayList<>(); public SignInfo() { } diff --git a/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java b/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java index 07a5910c..23049b80 100644 --- a/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java +++ b/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java @@ -16,7 +16,6 @@ import org.bukkit.configuration.file.YamlConfiguration; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.config.CommentedYamlConfiguration; import com.gamingmesh.jobs.container.TopList; -import com.gamingmesh.jobs.stuff.Debug; public class SignUtil { @@ -41,7 +40,7 @@ public class SignUtil { return; ConfigurationSection ConfCategory = f.getConfigurationSection("Signs"); - ArrayList categoriesList = new ArrayList(ConfCategory.getKeys(false)); + ArrayList categoriesList = new ArrayList<>(ConfCategory.getKeys(false)); if (categoriesList.size() == 0) return; for (String category : categoriesList) { @@ -108,7 +107,7 @@ public class SignUtil { double SignsZ = one.GetZ(); int number = one.GetNumber() - 1; - List PlayerList = new ArrayList(); + List PlayerList = new ArrayList<>(); if (!JobName.equalsIgnoreCase("gtoplist")) { PlayerList = Jobs.getJobsDAO().toplist(SignJobName, number); } else { @@ -202,7 +201,6 @@ public class SignUtil { Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { @Override - @SuppressWarnings("deprecation") public void run() { org.bukkit.material.Sign signMat = (org.bukkit.material.Sign) sign.getData(); diff --git a/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java b/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java index ef2f79b0..00dcc9b8 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java +++ b/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java @@ -42,8 +42,8 @@ import com.gamingmesh.jobs.stuff.RawMessage; public class JobsCommands implements CommandExecutor { private static final String label = "jobs"; private static final String packagePath = "com.gamingmesh.jobs.commands.list"; - private static final List hidenCommands = new ArrayList(); - Map CommandList = new HashMap(); + private static final List hidenCommands = new ArrayList<>(); + Map CommandList = new HashMap<>(); protected Jobs plugin; @@ -109,10 +109,6 @@ public class JobsCommands implements CommandExecutor { } } -// if (cmdClass == null) { -// return help(sender, 1); -// } - boolean back = cmdClass.perform(plugin, sender, myArgs); if (back) return true; @@ -184,7 +180,7 @@ public class JobsCommands implements CommandExecutor { } private static List getClassesFromPackage(String pckgname) throws ClassNotFoundException { - List result = new ArrayList(); + List result = new ArrayList<>(); try { for (URL jarURL : ((URLClassLoader) Jobs.class.getClassLoader()).getURLs()) { try { @@ -201,7 +197,7 @@ public class JobsCommands implements CommandExecutor { private static List getClassesInSamePackageFromJar(String packageName, String jarPath) { JarFile jarFile = null; - List listOfCommands = new ArrayList(); + List listOfCommands = new ArrayList<>(); try { jarFile = new JarFile(jarPath); Enumeration en = jarFile.entries(); @@ -228,7 +224,7 @@ public class JobsCommands implements CommandExecutor { } public Map GetCommands(CommandSender sender) { - Map temp = new HashMap(); + Map temp = new HashMap<>(); for (Entry cmd : CommandList.entrySet()) { if (!hasCommandPermission(sender, cmd.getKey())) continue; @@ -238,8 +234,8 @@ public class JobsCommands implements CommandExecutor { } public void fillCommands() { - List lm = new ArrayList(); - HashMap> classes = new HashMap>(); + List lm = new ArrayList<>(); + HashMap> classes = new HashMap<>(); try { lm = getClassesFromPackage(packagePath); } catch (ClassNotFoundException e) { @@ -289,14 +285,14 @@ public class JobsCommands implements CommandExecutor { } private static Map sort(Map unsortMap) { - List> list = new LinkedList>(unsortMap.entrySet()); + List> list = new LinkedList<>(unsortMap.entrySet()); Collections.sort(list, new Comparator>() { @Override public int compare(Map.Entry o1, Map.Entry o2) { return (o1.getValue()).compareTo(o2.getValue()); } }); - Map sortedMap = new LinkedHashMap(); + Map sortedMap = new LinkedHashMap<>(); for (Iterator> it = list.iterator(); it.hasNext();) { Map.Entry entry = it.next(); sortedMap.put(entry.getKey(), entry.getValue()); @@ -351,7 +347,7 @@ public class JobsCommands implements CommandExecutor { type = type.toLowerCase(); } - List message = new ArrayList(); + List message = new ArrayList<>(); int showAllTypes = 1; for (ActionType actionType : ActionType.values()) { diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/area.java b/src/main/java/com/gamingmesh/jobs/commands/list/area.java index fd12705d..a39d03a4 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/area.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/area.java @@ -17,7 +17,6 @@ import com.gamingmesh.jobs.container.RestrictedArea; public class area implements Cmd { - @SuppressWarnings("deprecation") @Override @JobCommand(300) public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) { diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/bp.java b/src/main/java/com/gamingmesh/jobs/commands/list/bp.java index 2409cf54..a4661875 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/bp.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/bp.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/edititembonus.java b/src/main/java/com/gamingmesh/jobs/commands/list/edititembonus.java index 8262652e..92df4ae4 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/edititembonus.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/edititembonus.java @@ -11,7 +11,6 @@ import com.gamingmesh.jobs.commands.JobCommand; import com.gamingmesh.jobs.container.BoostMultiplier; import com.gamingmesh.jobs.container.CurrencyType; import com.gamingmesh.jobs.container.Job; -import com.gamingmesh.jobs.container.JobItemBonus; import com.gamingmesh.jobs.container.JobItems; import com.gamingmesh.jobs.container.JobsPlayer; import com.gamingmesh.jobs.stuff.ChatColor; diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java b/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java index 5b201046..b237518f 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java @@ -3,7 +3,6 @@ package com.gamingmesh.jobs.commands.list; import java.lang.reflect.InvocationTargetException; import java.util.List; -import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.command.CommandSender; import org.bukkit.enchantments.Enchantment; diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/gtop.java b/src/main/java/com/gamingmesh/jobs/commands/list/gtop.java index 9d867784..550068b2 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/gtop.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/gtop.java @@ -3,14 +3,9 @@ package com.gamingmesh.jobs.commands.list; import java.util.ArrayList; import java.util.List; -import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.scoreboard.DisplaySlot; -import org.bukkit.scoreboard.Objective; -import org.bukkit.scoreboard.Score; -import org.bukkit.scoreboard.Scoreboard; -import org.bukkit.scoreboard.ScoreboardManager; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.commands.Cmd; diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/log.java b/src/main/java/com/gamingmesh/jobs/commands/list/log.java index 161b7e1a..87608d09 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/log.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/log.java @@ -1,7 +1,6 @@ package com.gamingmesh.jobs.commands.list; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Map.Entry; diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/top.java b/src/main/java/com/gamingmesh/jobs/commands/list/top.java index 103cdc38..074ece38 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/top.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/top.java @@ -3,14 +3,9 @@ package com.gamingmesh.jobs.commands.list; import java.util.ArrayList; import java.util.List; -import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.scoreboard.DisplaySlot; -import org.bukkit.scoreboard.Objective; -import org.bukkit.scoreboard.Score; -import org.bukkit.scoreboard.Scoreboard; -import org.bukkit.scoreboard.ScoreboardManager; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.commands.Cmd; diff --git a/src/main/java/com/gamingmesh/jobs/config/BlockProtectionManager.java b/src/main/java/com/gamingmesh/jobs/config/BlockProtectionManager.java index 72e53797..453b0896 100644 --- a/src/main/java/com/gamingmesh/jobs/config/BlockProtectionManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/BlockProtectionManager.java @@ -14,8 +14,7 @@ import com.gamingmesh.jobs.container.DBAction; public class BlockProtectionManager { - private HashMap>>> map = - new HashMap>>>(); + private HashMap>>> map = new HashMap<>(); public Long timer = 0L; @@ -60,15 +59,15 @@ public class BlockProtectionManager { String v = loc.getBlockX() + ":" + loc.getBlockY() + ":" + loc.getBlockZ(); HashMap>> regions = map.get(loc.getWorld()); if (regions == null) - regions = new HashMap>>(); + regions = new HashMap<>(); String region = locToRegion(loc); HashMap> chunks = regions.get(region); if (chunks == null) - chunks = new HashMap>(); + chunks = new HashMap<>(); String chunk = locToChunk(loc); HashMap Bpm = chunks.get(chunk); if (Bpm == null) - Bpm = new HashMap(); + Bpm = new HashMap<>(); BlockProtection Bp = Bpm.get(v); diff --git a/src/main/java/com/gamingmesh/jobs/config/BossBarManager.java b/src/main/java/com/gamingmesh/jobs/config/BossBarManager.java index 926a4ba6..98a59e9f 100644 --- a/src/main/java/com/gamingmesh/jobs/config/BossBarManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/BossBarManager.java @@ -35,7 +35,7 @@ public class BossBarManager { if (player == null) return; - List temp = new ArrayList(); + List temp = new ArrayList<>(); temp.addAll(player.getUpdateBossBarFor()); diff --git a/src/main/java/com/gamingmesh/jobs/config/CommentedYamlConfiguration.java b/src/main/java/com/gamingmesh/jobs/config/CommentedYamlConfiguration.java index fd2a04a3..808a00e9 100644 --- a/src/main/java/com/gamingmesh/jobs/config/CommentedYamlConfiguration.java +++ b/src/main/java/com/gamingmesh/jobs/config/CommentedYamlConfiguration.java @@ -37,7 +37,7 @@ public class CommentedYamlConfiguration extends YamlConfiguration { public CommentedYamlConfiguration() { super(); - comments = new HashMap(); + comments = new HashMap<>(); } @Override diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index 701819ee..81fc9ff2 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -32,7 +32,6 @@ import java.util.UUID; import org.apache.commons.lang.StringEscapeUtils; import org.bukkit.Bukkit; -import org.bukkit.Material; import org.bukkit.OfflinePlayer; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; @@ -58,7 +57,6 @@ import com.gamingmesh.jobs.container.JobPermission; import com.gamingmesh.jobs.container.Quest; import com.gamingmesh.jobs.resources.jfep.Parser; import com.gamingmesh.jobs.stuff.ChatColor; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.VersionChecker.Version; public class ConfigManager { @@ -363,12 +361,11 @@ public class ConfigManager { * loads from Jobs/jobConfig.yml * @throws IOException */ - @SuppressWarnings("deprecation") private void loadJobSettings() throws IOException { 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 +443,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 +561,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 +579,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 +602,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 +625,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 +637,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 +654,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 +692,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 +709,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 +750,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 +813,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); diff --git a/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java b/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java index c1419c35..0ce62155 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java @@ -2,11 +2,8 @@ package com.gamingmesh.jobs.config; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.Map.Entry; -import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -18,11 +15,10 @@ import com.gamingmesh.jobs.container.ExploreChunk; import com.gamingmesh.jobs.container.ExploreRegion; import com.gamingmesh.jobs.container.ExploreRespond; import com.gamingmesh.jobs.dao.JobsDAO.ExploreDataTableFields; -import com.gamingmesh.jobs.stuff.Debug; public class ExploreManager { - private HashMap worlds = new HashMap(); + private HashMap worlds = new HashMap<>(); private boolean exploreEnabled = false; private int playerAmount = 1; diff --git a/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java index 3e7a9070..792cde0a 100644 --- a/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java @@ -45,7 +45,7 @@ import com.gamingmesh.jobs.stuff.VersionChecker.Version; public class GeneralConfigManager { private Jobs plugin; - public List BroadcastingLevelUpLevels = new ArrayList(); + public List BroadcastingLevelUpLevels = new ArrayList<>(); protected Locale locale; protected int savePeriod; protected boolean economyAsync; @@ -70,14 +70,14 @@ public class GeneralConfigManager { public boolean PaymentMethodsMoney; public boolean PaymentMethodsPoints; public boolean PaymentMethodsExp; - private HashMap generalMulti = new HashMap(); + private HashMap generalMulti = new HashMap<>(); public int getSelectionTooldID; private int ResetTimeHour; private int ResetTimeMinute; // Limits - public HashMap currencyLimitUse = new HashMap(); + public HashMap currencyLimitUse = new HashMap<>(); public boolean PayForRenaming, PayForEachCraft, SignsEnabled, SignsColorizeJobName, ShowToplistInScoreboard, useGlobalTimer, useCoreProtect, BlockPlaceUse, @@ -147,11 +147,11 @@ public class GeneralConfigManager { public Parser DynamicPaymentEquation; public boolean DisabledWorldsUse; - public List DisabledWorldsList = new ArrayList(); + public List DisabledWorldsList = new ArrayList<>(); - public List BoostSchedule = new ArrayList(); + public List BoostSchedule = new ArrayList<>(); - public HashMap> commandArgs = new HashMap>(); + public HashMap> commandArgs = new HashMap<>(); public boolean DBCleaningJobsUse; public int DBCleaningJobsLvl; @@ -371,7 +371,6 @@ public class GeneralConfigManager { * * loads from Jobs/generalConfig.yml */ - @SuppressWarnings("deprecation") private synchronized void loadGeneralSettings() { File f = new File(plugin.getDataFolder(), "generalConfig.yml"); YamlConfiguration conf = YamlConfiguration.loadConfiguration(f); @@ -640,7 +639,7 @@ public class GeneralConfigManager { c.getW().addComment("Economy.Limit.Money", "Money gain limit", "With this enabled, players will be limited how much they can make in defined time", "Time in seconds: 60 = 1min, 3600 = 1 hour, 86400 = 24 hours"); limit.setEnabled(c.get("Economy.Limit.Money.Use", false)); - List list = new ArrayList(); + List list = new ArrayList<>(); c.getW().addComment("Economy.Limit.Money.StopWithExp", "Do you want to stop money gain when exp limit reached?"); if (c.get("Economy.Limit.Money.StopWithExp", false)) list.add(CurrencyType.EXP); @@ -672,7 +671,7 @@ public class GeneralConfigManager { // Point limit limit = new CurrencyLimit(); - list = new ArrayList(); + list = new ArrayList<>(); c.getW().addComment("Economy.Limit.Point", "Point gain limit", "With this enabled, players will be limited how much they can make in defined time"); limit.setEnabled(c.get("Economy.Limit.Point.Use", false)); c.getW().addComment("Economy.Limit.Point.StopWithExp", "Do you want to stop Point gain when exp limit reached?"); @@ -706,7 +705,7 @@ public class GeneralConfigManager { // Exp limit limit = new CurrencyLimit(); - list = new ArrayList(); + list = new ArrayList<>(); c.getW().addComment("Economy.Limit.Exp", "Exp gain limit", "With this enabled, players will be limited how much they can get in defined time", "Time in seconds: 60 = 1min, 3600 = 1 hour, 86400 = 24 hours"); limit.setEnabled(c.get("Economy.Limit.Exp.Use", false)); diff --git a/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java b/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java index e4c399ef..5aabe876 100644 --- a/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java @@ -23,7 +23,7 @@ public class LanguageManager { this.plugin = plugin; } - List languages = new ArrayList(); + List languages = new ArrayList<>(); public List getLanguages() { return languages; @@ -46,7 +46,7 @@ public class LanguageManager { private static List getClassesInSamePackageFromJar(String packageName, String jarPath, String cleaner) { JarFile jarFile = null; - List listOfCommands = new ArrayList(); + List listOfCommands = new ArrayList<>(); try { jarFile = new JarFile(jarPath); Enumeration en = jarFile.entries(); @@ -80,7 +80,7 @@ public class LanguageManager { * loads from Jobs/locale/messages_en.yml */ synchronized void load() { - languages = new ArrayList(); + languages = new ArrayList<>(); try { languages.addAll(getClassesFromPackage("locale", "messages_")); diff --git a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java index e7d0e5c9..4388b513 100644 --- a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java @@ -20,10 +20,10 @@ public class NameTranslatorManager { private Jobs plugin; - public ArrayList ListOfNames = new ArrayList(); - public ArrayList ListOfEntities = new ArrayList(); - public ArrayList ListOfEnchants = new ArrayList(); - public ArrayList ListOfColors = new ArrayList(); + public ArrayList ListOfNames = new ArrayList<>(); + public ArrayList ListOfEntities = new ArrayList<>(); + public ArrayList ListOfEnchants = new ArrayList<>(); + public ArrayList ListOfColors = new ArrayList<>(); public NameTranslatorManager(Jobs plugin) { this.plugin = plugin; diff --git a/src/main/java/com/gamingmesh/jobs/config/RestrictedAreaManager.java b/src/main/java/com/gamingmesh/jobs/config/RestrictedAreaManager.java index 69d7d18f..50dce5ab 100644 --- a/src/main/java/com/gamingmesh/jobs/config/RestrictedAreaManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/RestrictedAreaManager.java @@ -21,7 +21,7 @@ import com.gamingmesh.jobs.stuff.ChatColor; public class RestrictedAreaManager { - protected HashMap restrictedAreas = new HashMap(); + protected HashMap restrictedAreas = new HashMap<>(); private Jobs plugin; @@ -114,7 +114,7 @@ public class RestrictedAreaManager { } public synchronized List getRestrictedAreasByLoc(Location loc) { - List areas = new ArrayList(); + List areas = new ArrayList<>(); for (Entry area : restrictedAreas.entrySet()) { if (area.getValue().inRestrictedArea(loc)) areas.add(area.getValue()); @@ -128,7 +128,7 @@ public class RestrictedAreaManager { } public synchronized List getRestrictedAreasByName(String name) { - List areas = new ArrayList(); + List areas = new ArrayList<>(); for (Entry area : restrictedAreas.entrySet()) { if (area.getKey().equalsIgnoreCase(name)) areas.add(area.getValue()); diff --git a/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java b/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java index 08ffcc69..7ac511f5 100644 --- a/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java @@ -16,7 +16,7 @@ import com.gamingmesh.jobs.stuff.ChatColor; public class RestrictedBlockManager { - public HashMap restrictedBlocksTimer = new HashMap(); + public HashMap restrictedBlocksTimer = new HashMap<>(); private Jobs plugin; diff --git a/src/main/java/com/gamingmesh/jobs/config/ScheduleManager.java b/src/main/java/com/gamingmesh/jobs/config/ScheduleManager.java index cf630c71..bdc696e7 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ScheduleManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ScheduleManager.java @@ -20,7 +20,6 @@ import com.gamingmesh.jobs.container.CurrencyType; import com.gamingmesh.jobs.container.Job; import com.gamingmesh.jobs.container.Schedule; import com.gamingmesh.jobs.stuff.ChatColor; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.TimeManage; public class ScheduleManager { @@ -180,7 +179,7 @@ public class ScheduleManager { if (!conf.contains("Boost")) return; - ArrayList sections = new ArrayList(conf.getConfigurationSection("Boost").getKeys(false)); + ArrayList sections = new ArrayList<>(conf.getConfigurationSection("Boost").getKeys(false)); for (String OneSection : sections) { ConfigurationSection path = conf.getConfigurationSection("Boost." + OneSection); diff --git a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java index 95f120c8..86abd813 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java @@ -32,8 +32,8 @@ import com.gamingmesh.jobs.stuff.Perm; public class ShopManager { private Jobs plugin; - public List list = new ArrayList(); - public HashMap GuiList = new HashMap(); + public List list = new ArrayList<>(); + public HashMap GuiList = new HashMap<>(); public ShopManager(Jobs plugin) { this.plugin = plugin; @@ -123,7 +123,6 @@ public class ShopManager { } for (JobItems one : item.getitems()) { - @SuppressWarnings("deprecation") CMIMaterial mat = CMIMaterial.get(one.getId(), one.getData()); if (mat == null) @@ -167,7 +166,7 @@ public class ShopManager { } private List getItemsByPage(Integer page) { - List ls = new ArrayList(); + List ls = new ArrayList<>(); for (ShopItem one : list) { if (one.getPage() == page) ls.add(one); @@ -237,9 +236,8 @@ public class ShopManager { ShopItem item = ls.get(i); - ArrayList Lore = new ArrayList(); + ArrayList Lore = new ArrayList<>(); - @SuppressWarnings("deprecation") CMIMaterial mat = CMIMaterial.get(item.getIconId(), item.getIconData()); if (item.isHideWithoutPerm()) { @@ -330,7 +328,7 @@ public class ShopManager { return; ConfigurationSection ConfCategory = f.getConfigurationSection("Items"); - ArrayList categoriesList = new ArrayList(ConfCategory.getKeys(false)); + ArrayList categoriesList = new ArrayList<>(ConfCategory.getKeys(false)); if (categoriesList.size() == 0) return; int i = 0; @@ -363,7 +361,7 @@ public class ShopManager { Sitem.setIconName(ChatColor.translateAlternateColorCodes('&', NameSection.getString("Icon.Name"))); if (NameSection.isList("Icon.Lore")) { - List lore = new ArrayList(); + List lore = new ArrayList<>(); if (NameSection.getStringList("Icon.Lore") != null) for (String eachLine : NameSection.getStringList("Icon.Lore")) { lore.add(org.bukkit.ChatColor.translateAlternateColorCodes('&', eachLine)); @@ -382,7 +380,7 @@ public class ShopManager { Sitem.setRequiredTotalLevels(NameSection.getInt("RequiredTotalLevels")); if (NameSection.isList("RequiredJobLevels")) { - HashMap RequiredJobs = new HashMap(); + HashMap RequiredJobs = new HashMap<>(); for (String one : NameSection.getStringList("RequiredJobLevels")) { if (!one.contains("-")) continue; @@ -400,7 +398,7 @@ public class ShopManager { } if (NameSection.isList("PerformCommands")) { - List cmd = new ArrayList(); + List cmd = new ArrayList<>(); if (NameSection.getStringList("PerformCommands") != null) for (String eachLine : NameSection.getStringList("PerformCommands")) { cmd.add(org.bukkit.ChatColor.translateAlternateColorCodes('&', eachLine)); @@ -412,7 +410,7 @@ public class ShopManager { ConfigurationSection itemsSection = NameSection.getConfigurationSection("GiveItems"); Set itemKeys = itemsSection.getKeys(false); - List items = new ArrayList(); + List items = new ArrayList<>(); for (String oneItemName : itemKeys) { @@ -434,13 +432,13 @@ public class ShopManager { if (itemSection.isString("Name")) name = org.bukkit.ChatColor.translateAlternateColorCodes('&', 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")) { diff --git a/src/main/java/com/gamingmesh/jobs/config/TitleManager.java b/src/main/java/com/gamingmesh/jobs/config/TitleManager.java index 57004d62..8417d566 100644 --- a/src/main/java/com/gamingmesh/jobs/config/TitleManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/TitleManager.java @@ -16,7 +16,7 @@ import com.gamingmesh.jobs.stuff.ChatColor; public class TitleManager { - protected List titles = new ArrayList<Title>(); + protected List<Title> titles = new ArrayList<>(); private Jobs plugin; diff --git a/src/main/java/com/gamingmesh/jobs/config/YmlMaker.java b/src/main/java/com/gamingmesh/jobs/config/YmlMaker.java index 28889267..41ed6bda 100644 --- a/src/main/java/com/gamingmesh/jobs/config/YmlMaker.java +++ b/src/main/java/com/gamingmesh/jobs/config/YmlMaker.java @@ -4,7 +4,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.logging.Level; diff --git a/src/main/java/com/gamingmesh/jobs/container/ArchivedJobs.java b/src/main/java/com/gamingmesh/jobs/container/ArchivedJobs.java index d6cdb72d..e1dc0d62 100644 --- a/src/main/java/com/gamingmesh/jobs/container/ArchivedJobs.java +++ b/src/main/java/com/gamingmesh/jobs/container/ArchivedJobs.java @@ -5,7 +5,7 @@ import java.util.Set; public class ArchivedJobs { - private Set<JobProgression> jobs = new HashSet<JobProgression>(); + private Set<JobProgression> jobs = new HashSet<>(); public Set<JobProgression> getArchivedJobs() { return jobs; diff --git a/src/main/java/com/gamingmesh/jobs/container/Boost.java b/src/main/java/com/gamingmesh/jobs/container/Boost.java index 421fc711..4f49f779 100644 --- a/src/main/java/com/gamingmesh/jobs/container/Boost.java +++ b/src/main/java/com/gamingmesh/jobs/container/Boost.java @@ -6,7 +6,7 @@ import com.gamingmesh.jobs.PlayerManager.BoostOf; public class Boost { - HashMap<BoostOf, BoostMultiplier> map = new HashMap<BoostOf, BoostMultiplier>(); + HashMap<BoostOf, BoostMultiplier> map = new HashMap<>(); public Boost() { for (BoostOf one : BoostOf.values()) { diff --git a/src/main/java/com/gamingmesh/jobs/container/BoostMultiplier.java b/src/main/java/com/gamingmesh/jobs/container/BoostMultiplier.java index 60521417..d00d77d2 100644 --- a/src/main/java/com/gamingmesh/jobs/container/BoostMultiplier.java +++ b/src/main/java/com/gamingmesh/jobs/container/BoostMultiplier.java @@ -4,7 +4,7 @@ import java.util.HashMap; public class BoostMultiplier { - HashMap<CurrencyType, Double> map = new HashMap<CurrencyType, Double>(); + HashMap<CurrencyType, Double> map = new HashMap<>(); @Override public BoostMultiplier clone() { diff --git a/src/main/java/com/gamingmesh/jobs/container/ExploreChunk.java b/src/main/java/com/gamingmesh/jobs/container/ExploreChunk.java index 21ebf62c..fa15f909 100644 --- a/src/main/java/com/gamingmesh/jobs/container/ExploreChunk.java +++ b/src/main/java/com/gamingmesh/jobs/container/ExploreChunk.java @@ -5,13 +5,12 @@ import java.util.HashSet; import java.util.Set; import com.gamingmesh.jobs.Jobs; -import com.gamingmesh.jobs.stuff.Debug; public class ExploreChunk { int x; int z; - Set<String> playerNames = new HashSet<String>(); + Set<String> playerNames = new HashSet<>(); private Integer dbId = null; private boolean updated = false; diff --git a/src/main/java/com/gamingmesh/jobs/container/ExploreRegion.java b/src/main/java/com/gamingmesh/jobs/container/ExploreRegion.java index 4c49ba39..ed5a3ef7 100644 --- a/src/main/java/com/gamingmesh/jobs/container/ExploreRegion.java +++ b/src/main/java/com/gamingmesh/jobs/container/ExploreRegion.java @@ -8,7 +8,7 @@ public class ExploreRegion { int x; int z; - HashMap<String, ExploreChunk> chunks = new HashMap<String, ExploreChunk>(); + HashMap<String, ExploreChunk> chunks = new HashMap<>(); public ExploreRegion(int x, int z) { this.x = x; diff --git a/src/main/java/com/gamingmesh/jobs/container/Job.java b/src/main/java/com/gamingmesh/jobs/container/Job.java index 0aff905c..6378a13c 100644 --- a/src/main/java/com/gamingmesh/jobs/container/Job.java +++ b/src/main/java/com/gamingmesh/jobs/container/Job.java @@ -33,11 +33,10 @@ import org.bukkit.inventory.ItemStack; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.resources.jfep.Parser; import com.gamingmesh.jobs.stuff.ChatColor; -import com.gamingmesh.jobs.stuff.Debug; public class Job { // job info - private EnumMap<ActionType, List<JobInfo>> jobInfo = new EnumMap<ActionType, List<JobInfo>>(ActionType.class); + private EnumMap<ActionType, List<JobInfo>> jobInfo = new EnumMap<>(ActionType.class); // permissions private List<JobPermission> jobPermissions; // commands @@ -67,9 +66,9 @@ public class Job { // max number of people allowed with this job on the server. private Integer maxSlots; // Commands to be performed on player job join - private List<String> CmdOnJoin = new ArrayList<String>(); + private List<String> CmdOnJoin = new ArrayList<>(); // Commands to be performed on player job leave - private List<String> CmdOnLeave = new ArrayList<String>(); + private List<String> CmdOnLeave = new ArrayList<>(); // Item for GUI private ItemStack GUIitem; // Item for GUI @@ -83,9 +82,9 @@ public class Job { private Parser moneyEquation, xpEquation, pointsEquation; - private List<String> fDescription = new ArrayList<String>(); + private List<String> fDescription = new ArrayList<>(); - private List<Quest> quests = new ArrayList<Quest>(); + private List<Quest> quests = new ArrayList<>(); private int maxDailyQuests = 1; /** @@ -454,7 +453,7 @@ public class Job { // } public Quest getNextQuest(List<String> excludeQuests, Integer level) { - List<Quest> ls = new ArrayList<Quest>(this.quests); + List<Quest> ls = new ArrayList<>(this.quests); Collections.shuffle(ls); int i = 0; diff --git a/src/main/java/com/gamingmesh/jobs/container/JobCommands.java b/src/main/java/com/gamingmesh/jobs/container/JobCommands.java index db4cad0f..0cd23210 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobCommands.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobCommands.java @@ -23,7 +23,7 @@ import java.util.List; public class JobCommands { private String node; - private List<String> commands = new ArrayList<String>(); + private List<String> commands = new ArrayList<>(); private int levelFrom; private int levelUntil; diff --git a/src/main/java/com/gamingmesh/jobs/container/JobConditions.java b/src/main/java/com/gamingmesh/jobs/container/JobConditions.java index e69e4f31..3a26ed8b 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobConditions.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobConditions.java @@ -24,9 +24,9 @@ import java.util.List; public class JobConditions { private String node; - private List<String> requiresPerm = new ArrayList<String>(); - private HashMap<String, Integer> requiresJobs = new HashMap<String, Integer>(); - private HashMap<String, Boolean> performPerm = new HashMap<String, Boolean>(); + private List<String> requiresPerm = new ArrayList<>(); + private HashMap<String, Integer> requiresJobs = new HashMap<>(); + private HashMap<String, Boolean> performPerm = new HashMap<>(); public JobConditions(String node, List<String> requires, List<String> perform) { this.node = node; diff --git a/src/main/java/com/gamingmesh/jobs/container/JobItems.java b/src/main/java/com/gamingmesh/jobs/container/JobItems.java index ead4a7ae..587ca810 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobItems.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobItems.java @@ -70,7 +70,7 @@ public class JobItems { if (this.name != null) meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name)); if (lore != null) { - List<String> TranslatedLore = new ArrayList<String>(); + List<String> TranslatedLore = new ArrayList<>(); for (String oneLore : lore) { TranslatedLore.add(ChatColor.translateAlternateColorCodes('&', oneLore.replace("[player]", player.getName()))); } diff --git a/src/main/java/com/gamingmesh/jobs/container/JobProgression.java b/src/main/java/com/gamingmesh/jobs/container/JobProgression.java index 5ebcc166..3fae2730 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobProgression.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobProgression.java @@ -148,14 +148,14 @@ public class JobProgression { * Reloads max experience */ public void reloadMaxExperience() { - HashMap<String, Double> param = new HashMap<String, Double>(); + HashMap<String, Double> param = new HashMap<>(); param.put("joblevel", (double) level); param.put("numjobs", (double) jPlayer.getJobProgression().size()); this.maxExperience = (int) job.getMaxExp(param); } public int getMaxExperience(int level) { - HashMap<String, Double> param = new HashMap<String, Double>(); + HashMap<String, Double> param = new HashMap<>(); param.put("joblevel", (double) level); param.put("numjobs", (double) jPlayer.getJobProgression().size()); return (int) job.getMaxExp(param); diff --git a/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java b/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java index e7a940af..d5493106 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java @@ -42,12 +42,12 @@ public class JobsPlayer { private String userName; // progression of the player in each job public UUID playerUUID; - public ArrayList<JobProgression> progression = new ArrayList<JobProgression>(); + public ArrayList<JobProgression> progression = new ArrayList<>(); private ArchivedJobs archivedJobs = new ArchivedJobs(); private PaymentData paymentLimits = null; - private HashMap<String, ArrayList<BoostCounter>> boostCounter = new HashMap<String, ArrayList<BoostCounter>>(); + private HashMap<String, ArrayList<BoostCounter>> boostCounter = new HashMap<>(); // display honorific private String honorific; @@ -59,24 +59,24 @@ public class JobsPlayer { private OfflinePlayer OffPlayer = null; private Player player = null; - private HashMap<CurrencyType, Integer> limits = new HashMap<CurrencyType, Integer>(); + private HashMap<CurrencyType, Integer> limits = new HashMap<>(); private int userid = -1; - List<BossBarInfo> barMap = new ArrayList<BossBarInfo>(); - List<String> updateBossBarFor = new ArrayList<String>(); + List<BossBarInfo> barMap = new ArrayList<>(); + List<String> updateBossBarFor = new ArrayList<>(); // save lock // public final Object saveLock = new Object(); // log - private HashMap<String, Log> logList = new HashMap<String, Log>(); + private HashMap<String, Log> logList = new HashMap<>(); private Long seen = System.currentTimeMillis(); private HashMap<String, Boolean> permissionsCache = null; private Long lastPermissionUpdate = -1L; - private HashMap<String, List<QuestProgression>> qProgression = new HashMap<String, List<QuestProgression>>(); + private HashMap<String, List<QuestProgression>> qProgression = new HashMap<>(); private int doneQuests = 0; public JobsPlayer(String userName, OfflinePlayer player) { @@ -239,7 +239,7 @@ public class JobsPlayer { Boost = getPlayerBoostNew(JobName, type); - ArrayList<BoostCounter> counterList = new ArrayList<BoostCounter>(); + ArrayList<BoostCounter> counterList = new ArrayList<>(); counterList.add(new BoostCounter(type, Boost, time)); boostCounter.put(JobName, counterList); @@ -840,7 +840,7 @@ public class JobsPlayer { } private List<String> getQuestNameList(Job job, ActionType type) { - List<String> ls = new ArrayList<String>(); + List<String> ls = new ArrayList<>(); if (!this.isInJob(job)) return ls; @@ -868,7 +868,7 @@ public class JobsPlayer { } public List<QuestProgression> getQuestProgressions() { - List<QuestProgression> g = new ArrayList<QuestProgression>(); + List<QuestProgression> g = new ArrayList<>(); for (JobProgression one : this.getJobProgression()) { g.addAll(this.getQuestProgressions(one.getJob())); } @@ -882,12 +882,12 @@ public class JobsPlayer { public List<QuestProgression> getQuestProgressions(Job job, ActionType type) { if (!this.isInJob(job)) return null; - List<QuestProgression> g = new ArrayList<QuestProgression>(); + List<QuestProgression> g = new ArrayList<>(); if (this.qProgression.get(job.getName()) != null) - g = new ArrayList<QuestProgression>(this.qProgression.get(job.getName())); + g = new ArrayList<>(this.qProgression.get(job.getName())); - List<QuestProgression> tmp = new ArrayList<QuestProgression>(); + List<QuestProgression> tmp = new ArrayList<>(); if (!g.isEmpty()) { if (g.get(0).isEnded()) { diff --git a/src/main/java/com/gamingmesh/jobs/container/Log.java b/src/main/java/com/gamingmesh/jobs/container/Log.java index dcafd31c..3fa0798c 100644 --- a/src/main/java/com/gamingmesh/jobs/container/Log.java +++ b/src/main/java/com/gamingmesh/jobs/container/Log.java @@ -7,7 +7,7 @@ import com.gamingmesh.jobs.stuff.TimeManage; public final class Log { private String action; private int day; - private HashMap<String, LogAmounts> amountMap = new HashMap<String, LogAmounts>(); + private HashMap<String, LogAmounts> amountMap = new HashMap<>(); public Log(String action) { this.action = action; @@ -60,4 +60,4 @@ public final class Log { return this.amountMap.get(item).get(type); return 0; } -} \ No newline at end of file +} diff --git a/src/main/java/com/gamingmesh/jobs/container/LogAmounts.java b/src/main/java/com/gamingmesh/jobs/container/LogAmounts.java index 0d00764b..cf19b600 100644 --- a/src/main/java/com/gamingmesh/jobs/container/LogAmounts.java +++ b/src/main/java/com/gamingmesh/jobs/container/LogAmounts.java @@ -11,7 +11,7 @@ public final class LogAmounts { private String item; private int count = 0; - private HashMap<CurrencyType, Double> amounts = new HashMap<CurrencyType, Double>(); + private HashMap<CurrencyType, Double> amounts = new HashMap<>(); private boolean newEntry = true; @@ -81,4 +81,4 @@ public final class LogAmounts { return this.action; } -} \ No newline at end of file +} diff --git a/src/main/java/com/gamingmesh/jobs/container/Quest.java b/src/main/java/com/gamingmesh/jobs/container/Quest.java index aad2e313..8e4896cd 100644 --- a/src/main/java/com/gamingmesh/jobs/container/Quest.java +++ b/src/main/java/com/gamingmesh/jobs/container/Quest.java @@ -24,8 +24,8 @@ public class Quest { private int amount = Integer.MAX_VALUE; - private List<String> rewardCmds = new ArrayList<String>(); - private List<String> rewards = new ArrayList<String>(); + private List<String> rewardCmds = new ArrayList<>(); + private List<String> rewards = new ArrayList<>(); public Quest(String questName, Job job, ActionType action) { this.questName = questName; diff --git a/src/main/java/com/gamingmesh/jobs/container/Schedule.java b/src/main/java/com/gamingmesh/jobs/container/Schedule.java index 6c57b761..4a291600 100644 --- a/src/main/java/com/gamingmesh/jobs/container/Schedule.java +++ b/src/main/java/com/gamingmesh/jobs/container/Schedule.java @@ -22,13 +22,13 @@ public class Schedule { String Name = null; - List<String> Days = new ArrayList<String>(Arrays.asList("all")); - List<Job> JobsList = new ArrayList<Job>(); + List<String> Days = new ArrayList<>(Arrays.asList("all")); + List<Job> JobsList = new ArrayList<>(); - List<String> MessageOnStart = new ArrayList<String>(); - List<String> MessageOnStop = new ArrayList<String>(); + List<String> MessageOnStart = new ArrayList<>(); + List<String> MessageOnStop = new ArrayList<>(); - List<String> MessageToBroadcast = new ArrayList<String>(); + List<String> MessageToBroadcast = new ArrayList<>(); boolean started = false; boolean stoped = true; @@ -173,7 +173,7 @@ public class Schedule { } public void setMessageOnStart(List<String> msg, String From, String Until) { - List<String> temp = new ArrayList<String>(); + List<String> temp = new ArrayList<>(); for (String one : msg) { temp.add(ChatColor.translateAlternateColorCodes('&', one.replace("[until]", Until).replace("[from]", From))); } @@ -185,7 +185,7 @@ public class Schedule { } public void setMessageOnStop(List<String> msg, String From, String Until) { - List<String> temp = new ArrayList<String>(); + List<String> temp = new ArrayList<>(); for (String one : msg) { temp.add(ChatColor.translateAlternateColorCodes('&', one.replace("[until]", Until).replace("[from]", From))); } @@ -197,7 +197,7 @@ public class Schedule { } public void setMessageToBroadcast(List<String> msg, String From, String Until) { - List<String> temp = new ArrayList<String>(); + List<String> temp = new ArrayList<>(); for (String one : msg) { temp.add(ChatColor.translateAlternateColorCodes('&', one.replace("[until]", Until).replace("[from]", From))); } diff --git a/src/main/java/com/gamingmesh/jobs/container/ShopItem.java b/src/main/java/com/gamingmesh/jobs/container/ShopItem.java index 29cb7071..18233715 100644 --- a/src/main/java/com/gamingmesh/jobs/container/ShopItem.java +++ b/src/main/java/com/gamingmesh/jobs/container/ShopItem.java @@ -17,17 +17,17 @@ public class ShopItem { private int IconData = 0; private int IconAmount = 1; private String IconName = null; - private List<String> IconLore = new ArrayList<String>(); + private List<String> IconLore = new ArrayList<>(); private boolean HideWithoutPerm = false; private int RequiredTotalLevels = -1; - private List<String> RequiredPerm = new ArrayList<String>(); - private HashMap<String, Integer> RequiredJobs = new HashMap<String, Integer>(); + private List<String> RequiredPerm = new ArrayList<>(); + private HashMap<String, Integer> RequiredJobs = new HashMap<>(); - private List<String> Commands = new ArrayList<String>(); + private List<String> Commands = new ArrayList<>(); - private List<JobItems> items = new ArrayList<JobItems>(); + private List<JobItems> items = new ArrayList<>(); public ShopItem(String NodeName, double price, int IconId) { this.NodeName = NodeName; diff --git a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java index 127a9622..03d994c8 100644 --- a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java +++ b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java @@ -500,7 +500,7 @@ public abstract class JobsDAO { else userData = Jobs.getPlayerManager().getPlayerInfo(uuid); - ArrayList<JobsDAOData> jobs = new ArrayList<JobsDAOData>(); + ArrayList<JobsDAOData> jobs = new ArrayList<>(); if (userData == null) { recordNewPlayer(playerName, uuid); @@ -531,7 +531,7 @@ public abstract class JobsDAO { } public HashMap<Integer, List<JobsDAOData>> getAllJobs() { - HashMap<Integer, List<JobsDAOData>> map = new HashMap<Integer, List<JobsDAOData>>(); + HashMap<Integer, List<JobsDAOData>> map = new HashMap<>(); JobsConnection conn = getConnection(); if (conn == null) return map; @@ -544,7 +544,7 @@ public abstract class JobsDAO { int id = res.getInt("userid"); List<JobsDAOData> ls = map.get(id); if (ls == null) - ls = new ArrayList<JobsDAOData>(); + ls = new ArrayList<>(); ls.add(new JobsDAOData(res.getString("job"), res.getInt("level"), res.getInt("experience"))); map.put(id, ls); } @@ -558,7 +558,7 @@ public abstract class JobsDAO { } public HashMap<Integer, PlayerPoints> getAllPoints() { - HashMap<Integer, PlayerPoints> map = new HashMap<Integer, PlayerPoints>(); + HashMap<Integer, PlayerPoints> map = new HashMap<>(); JobsConnection conn = getConnection(); if (conn == null) return map; @@ -580,7 +580,7 @@ public abstract class JobsDAO { } public HashMap<Integer, ArchivedJobs> getAllArchivedJobs() { - HashMap<Integer, ArchivedJobs> map = new HashMap<Integer, ArchivedJobs>(); + HashMap<Integer, ArchivedJobs> map = new HashMap<>(); JobsConnection conn = getConnection(); if (conn == null) return map; @@ -621,7 +621,7 @@ public abstract class JobsDAO { } public HashMap<Integer, HashMap<String, Log>> getAllLogs() { - HashMap<Integer, HashMap<String, Log>> map = new HashMap<Integer, HashMap<String, Log>>(); + HashMap<Integer, HashMap<String, Log>> map = new HashMap<>(); JobsConnection conn = getConnection(); if (conn == null) return map; @@ -638,14 +638,14 @@ public abstract class JobsDAO { HashMap<String, Log> m = map.get(id); if (m == null) - m = new HashMap<String, Log>(); + m = new HashMap<>(); String action = res.getString("action"); Log log = m.get(action); if (log == null) log = new Log(action); - HashMap<CurrencyType, Double> amounts = new HashMap<CurrencyType, Double>(); + HashMap<CurrencyType, Double> amounts = new HashMap<>(); amounts.put(CurrencyType.MONEY, res.getDouble("money")); amounts.put(CurrencyType.EXP, res.getDouble("exp")); amounts.put(CurrencyType.POINTS, res.getDouble("points")); @@ -667,7 +667,7 @@ public abstract class JobsDAO { return map; } - private HashMap<Integer, ArrayList<JobsDAOData>> map = new HashMap<Integer, ArrayList<JobsDAOData>>(); + private HashMap<Integer, ArrayList<JobsDAOData>> map = new HashMap<>(); public List<JobsDAOData> getAllJobs(PlayerInfo pInfo) { List<JobsDAOData> list = map.get(pInfo.getID()); @@ -796,7 +796,7 @@ public abstract class JobsDAO { */ public synchronized List<JobsDAOData> getAllJobsOffline(String userName) { - ArrayList<JobsDAOData> jobs = new ArrayList<JobsDAOData>(); + ArrayList<JobsDAOData> jobs = new ArrayList<>(); PlayerInfo info = Jobs.getPlayerManager().getPlayerInfo(userName); if (info == null) @@ -900,7 +900,7 @@ public abstract class JobsDAO { } public synchronized HashMap<Integer, PaymentData> loadPlayerLimits() { - HashMap<Integer, PaymentData> map = new HashMap<Integer, PaymentData>(); + HashMap<Integer, PaymentData> map = new HashMap<>(); JobsConnection conn = getConnection(); if (conn == null) return map; @@ -993,7 +993,7 @@ public abstract class JobsDAO { if (conn == null) return null; - List<Convert> list = new ArrayList<Convert>(); + List<Convert> list = new ArrayList<>(); PreparedStatement prest = null; ResultSet res = null; try { @@ -1139,7 +1139,7 @@ public abstract class JobsDAO { public List<TopList> getGlobalTopList(int start) { JobsConnection conn = getConnection(); - List<TopList> names = new ArrayList<TopList>(); + List<TopList> names = new ArrayList<>(); if (conn == null) return names; @@ -1558,7 +1558,7 @@ public abstract class JobsDAO { res = prest.executeQuery(); while (res.next()) { - HashMap<CurrencyType, Double> amounts = new HashMap<CurrencyType, Double>(); + HashMap<CurrencyType, Double> amounts = new HashMap<>(); amounts.put(CurrencyType.MONEY, res.getDouble("money")); amounts.put(CurrencyType.EXP, res.getDouble("exp")); amounts.put(CurrencyType.POINTS, res.getDouble("points")); @@ -1789,7 +1789,7 @@ public abstract class JobsDAO { conn.setAutoCommit(false); int i = 0; - HashMap<String, ExploreRegion> temp = new HashMap<String, ExploreRegion>(Jobs.getExplore().getWorlds()); + HashMap<String, ExploreRegion> temp = new HashMap<>(Jobs.getExplore().getWorlds()); for (Entry<String, ExploreRegion> worlds : temp.entrySet()) { for (Entry<String, ExploreChunk> oneChunk : worlds.getValue().getChunks().entrySet()) { @@ -1838,7 +1838,7 @@ public abstract class JobsDAO { int i = 0; - HashMap<String, ExploreRegion> temp = new HashMap<String, ExploreRegion>(Jobs.getExplore().getWorlds()); + HashMap<String, ExploreRegion> temp = new HashMap<>(Jobs.getExplore().getWorlds()); for (Entry<String, ExploreRegion> worlds : temp.entrySet()) { for (Entry<String, ExploreChunk> oneChunk : worlds.getValue().getChunks().entrySet()) { @@ -1935,7 +1935,7 @@ public abstract class JobsDAO { */ public List<Integer> getLognameList(int fromtime, int untiltime) { JobsConnection conn = getConnection(); - List<Integer> nameList = new ArrayList<Integer>(); + List<Integer> nameList = new ArrayList<>(); if (conn == null) return nameList; PreparedStatement prest = null; @@ -1964,7 +1964,7 @@ public abstract class JobsDAO { * @return */ public ArrayList<TopList> toplist(String jobsname, int limit) { - ArrayList<TopList> jobs = new ArrayList<TopList>(); + ArrayList<TopList> jobs = new ArrayList<>(); JobsConnection conn = getConnection(); if (conn == null) return jobs; diff --git a/src/main/java/com/gamingmesh/jobs/economy/BufferedEconomy.java b/src/main/java/com/gamingmesh/jobs/economy/BufferedEconomy.java index 930a325f..7948c7ce 100644 --- a/src/main/java/com/gamingmesh/jobs/economy/BufferedEconomy.java +++ b/src/main/java/com/gamingmesh/jobs/economy/BufferedEconomy.java @@ -36,8 +36,8 @@ import com.gamingmesh.jobs.tasks.BufferedPaymentTask; public class BufferedEconomy { private Jobs plugin; private Economy economy; - private LinkedBlockingQueue<BufferedPayment> payments = new LinkedBlockingQueue<BufferedPayment>(); - private final Map<UUID, BufferedPayment> paymentCache = Collections.synchronizedMap(new HashMap<UUID, BufferedPayment>()); + private LinkedBlockingQueue<BufferedPayment> payments = new LinkedBlockingQueue<>(); + private final Map<UUID, BufferedPayment> paymentCache = Collections.synchronizedMap(new HashMap<>()); private OfflinePlayer ServerAccount = null; private OfflinePlayer ServerTaxesAccount = null; diff --git a/src/main/java/com/gamingmesh/jobs/economy/PaymentData.java b/src/main/java/com/gamingmesh/jobs/economy/PaymentData.java index abfe8a9f..9bb03f0e 100644 --- a/src/main/java/com/gamingmesh/jobs/economy/PaymentData.java +++ b/src/main/java/com/gamingmesh/jobs/economy/PaymentData.java @@ -8,8 +8,8 @@ import com.gamingmesh.jobs.container.CurrencyType; public class PaymentData { Long lastAnnouced = 0L; - HashMap<CurrencyType, Double> payments = new HashMap<CurrencyType, Double>(); - HashMap<CurrencyType, Long> paymentsTimes = new HashMap<CurrencyType, Long>(); + HashMap<CurrencyType, Double> payments = new HashMap<>(); + HashMap<CurrencyType, Long> paymentsTimes = new HashMap<>(); private boolean Informed = false; private boolean Reseted = false; diff --git a/src/main/java/com/gamingmesh/jobs/economy/PointsData.java b/src/main/java/com/gamingmesh/jobs/economy/PointsData.java index 47a90cae..e054a849 100644 --- a/src/main/java/com/gamingmesh/jobs/economy/PointsData.java +++ b/src/main/java/com/gamingmesh/jobs/economy/PointsData.java @@ -7,7 +7,7 @@ import com.gamingmesh.jobs.container.PlayerPoints; public class PointsData { - HashMap<UUID, PlayerPoints> Pointbase = new HashMap<UUID, PlayerPoints>(); + HashMap<UUID, PlayerPoints> Pointbase = new HashMap<>(); public PointsData() { } diff --git a/src/main/java/com/gamingmesh/jobs/i18n/Language.java b/src/main/java/com/gamingmesh/jobs/i18n/Language.java index 843cb4d9..6c7e6ef1 100644 --- a/src/main/java/com/gamingmesh/jobs/i18n/Language.java +++ b/src/main/java/com/gamingmesh/jobs/i18n/Language.java @@ -65,11 +65,11 @@ public class Language { String msg = ""; try { if (customlocale == null || !customlocale.contains(key)) - msg = enlocale.contains(key) == true ? ChatColor.translateAlternateColorCodes('&', enlocale.getString(key)) : missing; + msg = enlocale.contains(key) == true ? Colors(enlocale.getString(key)) : missing; else - msg = customlocale.contains(key) == true ? ChatColor.translateAlternateColorCodes('&', customlocale.getString(key)) : missing; + msg = customlocale.contains(key) == true ? Colors(customlocale.getString(key)) : missing; } catch (Exception e) { - String message = ChatColor.translateAlternateColorCodes('&', "&e[Jobs] &2Cant read language file. Plugin will be disabled."); + String message = Colors("&e[Jobs] &2Cant read language file. Plugin will be disabled."); ConsoleCommandSender console = Bukkit.getServer().getConsoleSender(); console.sendMessage(message); throw e; @@ -105,7 +105,7 @@ public class Language { msg = msg.replace(String.valueOf(variables[y]), String.valueOf(variables[y + 1])); } msg = filterNewLine(msg); - ls.set(i, ChatColor.translateAlternateColorCodes('&', msg)); + ls.set(i, Colors(msg)); } return ls; @@ -121,7 +121,7 @@ public class Language { } public List<String> ColorsArray(List<String> text, Boolean colorize) { - List<String> temp = new ArrayList<String>(); + List<String> temp = new ArrayList<>(); for (String part : text) { if (colorize) part = Colors(part); @@ -141,7 +141,7 @@ public class Language { * @return the message */ public String getDefaultMessage(String key) { - return enlocale.contains(key) == true ? ChatColor.translateAlternateColorCodes('&', enlocale.getString(key)) : "Cant find locale"; + return enlocale.contains(key) == true ? Colors(enlocale.getString(key)) : "Cant find locale"; } /** diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java index 9e96a52e..928344ff 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java @@ -81,14 +81,13 @@ import com.gamingmesh.jobs.container.JobProgression; import com.gamingmesh.jobs.container.JobsArmorChangeEvent; import com.gamingmesh.jobs.container.JobsArmorChangeEvent.EquipMethod; import com.gamingmesh.jobs.container.JobsPlayer; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.Util; public class JobsListener implements Listener { // hook to the main plugin private Jobs plugin; - private HashMap<UUID, Long> interactDelay = new HashMap<UUID, Long>(); + private HashMap<UUID, Long> interactDelay = new HashMap<>(); public JobsListener(Jobs plugin) { this.plugin = plugin; @@ -662,7 +661,7 @@ public class JobsListener implements Listener { String name = null; List<String> lore = new ArrayList<String>(); - Map<Enchantment, Integer> enchants = new HashMap<Enchantment, Integer>(); + Map<Enchantment, Integer> enchants = new HashMap<>(); try { enchants = iih.getEnchantments(); } catch (Exception e) { @@ -834,8 +833,6 @@ public class JobsListener implements Listener { @EventHandler public void playerInteractEvent(PlayerInteractEvent event) { -// if (event.isCancelled()) -// return; Action action = event.getAction(); if (action == Action.PHYSICAL) diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 0cb72fd4..403e5767 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -564,7 +564,7 @@ public class JobsPaymentListener implements Listener { // Checking if item is been repaired, not crafted. Combining 2 items ItemStack[] sourceItems = event.getInventory().getContents(); // For dye check - List<ItemStack> DyeStack = new ArrayList<ItemStack>(); + List<ItemStack> DyeStack = new ArrayList<>(); int y = -1; int first = 0; int second = 0; diff --git a/src/main/java/com/gamingmesh/jobs/listeners/McMMOlistener.java b/src/main/java/com/gamingmesh/jobs/listeners/McMMOlistener.java index 02384b2a..ce6cdb6b 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/McMMOlistener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/McMMOlistener.java @@ -26,7 +26,7 @@ public class McMMOlistener implements Listener { private Jobs plugin; public boolean mcMMOPresent = false; - HashMap<String, HashMap<AbilityType, Long>> map = new HashMap<String, HashMap<AbilityType, Long>>(); + HashMap<String, HashMap<AbilityType, Long>> map = new HashMap<>(); public McMMOlistener(Jobs plugin) { this.plugin = plugin; @@ -61,7 +61,7 @@ public class McMMOlistener implements Listener { @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void OnAbilityOn(McMMOPlayerAbilityActivateEvent event) { - HashMap<AbilityType, Long> InfoMap = new HashMap<AbilityType, Long>(); + HashMap<AbilityType, Long> InfoMap = new HashMap<>(); if (map.containsKey(event.getPlayer().getName())) InfoMap = map.get(event.getPlayer().getName()); InfoMap.put(event.getAbility(), System.currentTimeMillis() + (event.getAbility().getMaxLength() * 1000)); diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_10.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_10.java index 40d9f161..00542fc9 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_10.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_10.java @@ -23,7 +23,7 @@ import com.gamingmesh.jobs.NMS; public class v1_10 implements NMS { @Override public List<Block> getPistonRetractBlocks(BlockPistonRetractEvent event) { - List<Block> blocks = new ArrayList<Block>(); + List<Block> blocks = new ArrayList<>(); blocks.addAll(event.getBlocks()); return blocks; } diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_11.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_11.java index 044abad9..69e00d56 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_11.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_11.java @@ -16,7 +16,7 @@ import com.gamingmesh.jobs.NMS; public class v1_11 implements NMS { @Override public List<Block> getPistonRetractBlocks(BlockPistonRetractEvent event) { - List<Block> blocks = new ArrayList<Block>(); + List<Block> blocks = new ArrayList<>(); blocks.addAll(event.getBlocks()); return blocks; } diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java index 359cfa95..619f5e1d 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java @@ -16,7 +16,7 @@ import com.gamingmesh.jobs.NMS; public class v1_12 implements NMS { @Override public List<Block> getPistonRetractBlocks(BlockPistonRetractEvent event) { - List<Block> blocks = new ArrayList<Block>(); + List<Block> blocks = new ArrayList<>(); blocks.addAll(event.getBlocks()); return blocks; } diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_13.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_13.java index 4a78761e..75b80952 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_13.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_13.java @@ -13,7 +13,7 @@ import com.gamingmesh.jobs.NMS; public class v1_13 implements NMS { @Override public List<Block> getPistonRetractBlocks(BlockPistonRetractEvent event) { - List<Block> blocks = new ArrayList<Block>(); + List<Block> blocks = new ArrayList<>(); blocks.addAll(event.getBlocks()); return blocks; } diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_7.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_7.java index 1c6533a5..0b6891c1 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_7.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_7.java @@ -1,7 +1,6 @@ package com.gamingmesh.jobs.nmsUtil; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; import org.bukkit.block.Block; @@ -20,7 +19,7 @@ import com.gamingmesh.jobs.NMS; public class v1_7 implements NMS { @Override public List<Block> getPistonRetractBlocks(BlockPistonRetractEvent event) { - List<Block> blocks = new ArrayList<Block>(); + List<Block> blocks = new ArrayList<>(); blocks.add(event.getBlock()); return blocks; } @@ -52,7 +51,6 @@ public class v1_7 implements NMS { return name; } - @SuppressWarnings("deprecation") @Override public ItemStack getItemInMainHand(Player player) { return player.getInventory().getItemInHand(); diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_8.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_8.java index 7669bb81..f7e67b4f 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_8.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_8.java @@ -2,9 +2,7 @@ package com.gamingmesh.jobs.nmsUtil; import java.util.ArrayList; import java.util.List; -import java.util.Set; -import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Entity; import org.bukkit.entity.Guardian; @@ -22,7 +20,7 @@ import com.gamingmesh.jobs.NMS; public class v1_8 implements NMS { @Override public List<Block> getPistonRetractBlocks(BlockPistonRetractEvent event) { - List<Block> blocks = new ArrayList<Block>(); + List<Block> blocks = new ArrayList<>(); blocks.addAll(event.getBlocks()); return blocks; } @@ -59,7 +57,6 @@ public class v1_8 implements NMS { return name; } - @SuppressWarnings("deprecation") @Override public ItemStack getItemInMainHand(Player player) { return player.getInventory().getItemInHand(); diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_9.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_9.java index cb279413..b0e679de 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_9.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_9.java @@ -22,7 +22,7 @@ import com.gamingmesh.jobs.NMS; public class v1_9 implements NMS { @Override public List<Block> getPistonRetractBlocks(BlockPistonRetractEvent event) { - List<Block> blocks = new ArrayList<Block>(); + List<Block> blocks = new ArrayList<>(); blocks.addAll(event.getBlocks()); return blocks; } diff --git a/src/main/java/com/gamingmesh/jobs/resources/jfep/Parser.java b/src/main/java/com/gamingmesh/jobs/resources/jfep/Parser.java index 0f05ef7b..2950c49c 100644 --- a/src/main/java/com/gamingmesh/jobs/resources/jfep/Parser.java +++ b/src/main/java/com/gamingmesh/jobs/resources/jfep/Parser.java @@ -76,8 +76,8 @@ public class Parser { root = null; inp_cur = 0; this.error = error; - functions = new HashSet<String>(); - variables = new HashSet<String>(); + functions = new HashSet<>(); + variables = new HashSet<>(); } /** diff --git a/src/main/java/com/gamingmesh/jobs/selection/SelectionManager.java b/src/main/java/com/gamingmesh/jobs/selection/SelectionManager.java index ad83f9b7..7b3c327b 100644 --- a/src/main/java/com/gamingmesh/jobs/selection/SelectionManager.java +++ b/src/main/java/com/gamingmesh/jobs/selection/SelectionManager.java @@ -14,8 +14,8 @@ public class SelectionManager { public static final int MIN_HEIGHT = 0; public SelectionManager() { - playerLoc1 = Collections.synchronizedMap(new HashMap<String, Location>()); - playerLoc2 = Collections.synchronizedMap(new HashMap<String, Location>()); + playerLoc1 = Collections.synchronizedMap(new HashMap<>()); + playerLoc2 = Collections.synchronizedMap(new HashMap<>()); } public void updateLocations(Player player, Location loc1, Location loc2) { diff --git a/src/main/java/com/gamingmesh/jobs/stuff/CMIScoreboardManager.java b/src/main/java/com/gamingmesh/jobs/stuff/CMIScoreboardManager.java index 025cda30..d6546891 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/CMIScoreboardManager.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/CMIScoreboardManager.java @@ -23,7 +23,7 @@ import com.gamingmesh.jobs.stuff.VersionChecker.Version; public class CMIScoreboardManager { - private ConcurrentHashMap<UUID, ScoreboardInfo> timerMap = new ConcurrentHashMap<UUID, ScoreboardInfo>(); + private ConcurrentHashMap<UUID, ScoreboardInfo> timerMap = new ConcurrentHashMap<>(); private Jobs plugin; public CMIScoreboardManager(Jobs plugin) { diff --git a/src/main/java/com/gamingmesh/jobs/stuff/ChatColor.java b/src/main/java/com/gamingmesh/jobs/stuff/ChatColor.java index 3f195f89..e4d9d1ae 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/ChatColor.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/ChatColor.java @@ -43,9 +43,9 @@ public enum ChatColor { private final char code; private final int intCode; private final String toString; - private final static Map<Integer, ChatColor> intMap = new HashMap<Integer, ChatColor>(); - private final static Map<Character, ChatColor> charMap = new HashMap<Character, ChatColor>(); - private final static Map<String, ChatColor> stringMap = new HashMap<String, ChatColor>(); + private final static Map<Integer, ChatColor> intMap = new HashMap<>(); + private final static Map<Character, ChatColor> charMap = new HashMap<>(); + private final static Map<String, ChatColor> stringMap = new HashMap<>(); private ChatColor(char code, int intCode) { this.code = code; diff --git a/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java b/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java index 6fae72af..c4ecbc42 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java @@ -26,8 +26,8 @@ public class FurnaceBrewingHandling { public FurnaceBrewingHandling() { } - static HashMap<UUID, List<blockLoc>> furnaceMap = new HashMap<UUID, List<blockLoc>>(); - static HashMap<UUID, List<blockLoc>> brewingMap = new HashMap<UUID, List<blockLoc>>(); + static HashMap<UUID, List<blockLoc>> furnaceMap = new HashMap<>(); + static HashMap<UUID, List<blockLoc>> brewingMap = new HashMap<>(); public static void load() { YmlMaker f = new YmlMaker(Jobs.getInstance(), "furnaceBrewingStands.yml"); @@ -39,14 +39,14 @@ public class FurnaceBrewingHandling { int totalf = 0; int totalb = 0; - if (Jobs.getGCManager().isFurnacesReassign()) + if (Jobs.getGCManager().isFurnacesReassign()) { if (config.contains("Furnace")) { ConfigurationSection section = config.getConfigurationSection("Furnace"); try { for (String one : section.getKeys(false)) { String value = section.getString(one); - List<String> ls = new ArrayList<String>(); + List<String> ls = new ArrayList<>(); if (value.contains(";")) ls.addAll(Arrays.asList(value.split(";"))); else @@ -55,7 +55,7 @@ public class FurnaceBrewingHandling { if (uuid == null) continue; - List<blockLoc> blist = new ArrayList<blockLoc>(); + List<blockLoc> blist = new ArrayList<>(); for (String oneL : ls) { blockLoc bl = new blockLoc(oneL); Block block = bl.getBlock(); @@ -76,6 +76,7 @@ public class FurnaceBrewingHandling { e.printStackTrace(); } } + } if (Jobs.getGCManager().isBrewingStandsReassign()) if (config.contains("Brewing")) { @@ -84,7 +85,7 @@ public class FurnaceBrewingHandling { try { for (String one : section.getKeys(false)) { String value = section.getString(one); - List<String> ls = new ArrayList<String>(); + List<String> ls = new ArrayList<>(); if (value.contains(";")) ls.addAll(Arrays.asList(value.split(";"))); else @@ -94,7 +95,7 @@ public class FurnaceBrewingHandling { if (uuid == null) continue; - List<blockLoc> blist = new ArrayList<blockLoc>(); + List<blockLoc> blist = new ArrayList<>(); for (String oneL : ls) { blockLoc bl = new blockLoc(oneL); Block block = bl.getBlock(); @@ -284,7 +285,7 @@ public class FurnaceBrewingHandling { List<blockLoc> ls = furnaceMap.get(player.getUniqueId()); if (ls == null) - ls = new ArrayList<blockLoc>(); + ls = new ArrayList<>(); ls.add(new blockLoc(block.getLocation())); furnaceMap.put(player.getUniqueId(), ls); @@ -329,7 +330,7 @@ public class FurnaceBrewingHandling { List<blockLoc> ls = brewingMap.get(player.getUniqueId()); if (ls == null) - ls = new ArrayList<blockLoc>(); + ls = new ArrayList<>(); ls.add(new blockLoc(block.getLocation())); brewingMap.put(player.getUniqueId(), ls); diff --git a/src/main/java/com/gamingmesh/jobs/stuff/GiveItem.java b/src/main/java/com/gamingmesh/jobs/stuff/GiveItem.java index 39c2dae1..91dfa1fb 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/GiveItem.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/GiveItem.java @@ -6,7 +6,6 @@ import java.util.List; import java.util.Map.Entry; import org.bukkit.ChatColor; -import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -16,13 +15,12 @@ import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; public class GiveItem { public static boolean GiveItemForPlayer(Player player, int id, int meta, int qty, String name, List<String> lore, HashMap<Enchantment, Integer> hashMap) { - @SuppressWarnings("deprecation") ItemStack itemStack = CMIMaterial.get(id, meta).newItemStack(); itemStack.setAmount(qty); ItemMeta ItemMeta = itemStack.getItemMeta(); if (lore != null) { - List<String> TranslatedLore = new ArrayList<String>(); + List<String> TranslatedLore = new ArrayList<>(); for (String oneLore : lore) { TranslatedLore.add(ChatColor.translateAlternateColorCodes('&', oneLore.replace("[player]", player.getName()))); } diff --git a/src/main/java/com/gamingmesh/jobs/stuff/RawMessage.java b/src/main/java/com/gamingmesh/jobs/stuff/RawMessage.java index c3f50e88..02f51aa9 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/RawMessage.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/RawMessage.java @@ -9,14 +9,14 @@ import org.bukkit.entity.Player; public class RawMessage { - List<String> parts = new ArrayList<String>(); - List<String> cleanParts = new ArrayList<String>(); + List<String> parts = new ArrayList<>(); + List<String> cleanParts = new ArrayList<>(); String combined = ""; String combinedClean = ""; public void clear() { - parts = new ArrayList<String>(); - cleanParts = new ArrayList<String>(); + parts = new ArrayList<>(); + cleanParts = new ArrayList<>(); combined = ""; combinedClean = ""; } diff --git a/src/main/java/com/gamingmesh/jobs/stuff/Sorting.java b/src/main/java/com/gamingmesh/jobs/stuff/Sorting.java index 0dfd95f4..ce90ffde 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/Sorting.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/Sorting.java @@ -14,7 +14,7 @@ public class Sorting { public static Map<String, Integer> sortDESC(Map<String, Integer> unsortMap) { // Convert Map to List - List<Map.Entry<String, Integer>> list = new LinkedList<Map.Entry<String, Integer>>(unsortMap.entrySet()); + List<Map.Entry<String, Integer>> list = new LinkedList<>(unsortMap.entrySet()); // Sort list with comparator, to compare the Map values Collections.sort(list, new Comparator<Map.Entry<String, Integer>>() { @@ -25,7 +25,7 @@ public class Sorting { }); // Convert sorted map back to a Map - Map<String, Integer> sortedMap = new LinkedHashMap<String, Integer>(); + Map<String, Integer> sortedMap = new LinkedHashMap<>(); for (Iterator<Map.Entry<String, Integer>> it = list.iterator(); it.hasNext();) { Map.Entry<String, Integer> entry = it.next(); sortedMap.put(entry.getKey(), entry.getValue()); @@ -36,7 +36,7 @@ public class Sorting { public static Map<String, Double> sortDoubleDESC(Map<String, Double> unsortMap) { // Convert Map to List - List<Map.Entry<String, Double>> list = new LinkedList<Map.Entry<String, Double>>(unsortMap.entrySet()); + List<Map.Entry<String, Double>> list = new LinkedList<>(unsortMap.entrySet()); // Sort list with comparator, to compare the Map values Collections.sort(list, new Comparator<Map.Entry<String, Double>>() { @@ -47,7 +47,7 @@ public class Sorting { }); // Convert sorted map back to a Map - Map<String, Double> sortedMap = new LinkedHashMap<String, Double>(); + Map<String, Double> sortedMap = new LinkedHashMap<>(); for (Iterator<Map.Entry<String, Double>> it = list.iterator(); it.hasNext();) { Map.Entry<String, Double> entry = it.next(); sortedMap.put(entry.getKey(), entry.getValue()); @@ -58,7 +58,7 @@ public class Sorting { public static Map<LogAmounts, Double> sortDoubleDESCByLog(Map<LogAmounts, Double> unsortMap) { // Convert Map to List - List<Map.Entry<LogAmounts, Double>> list = new LinkedList<Map.Entry<LogAmounts, Double>>(unsortMap.entrySet()); + List<Map.Entry<LogAmounts, Double>> list = new LinkedList<>(unsortMap.entrySet()); // Sort list with comparator, to compare the Map values Collections.sort(list, new Comparator<Map.Entry<LogAmounts, Double>>() { @@ -69,7 +69,7 @@ public class Sorting { }); // Convert sorted map back to a Map - Map<LogAmounts, Double> sortedMap = new LinkedHashMap<LogAmounts, Double>(); + Map<LogAmounts, Double> sortedMap = new LinkedHashMap<>(); for (Iterator<Map.Entry<LogAmounts, Double>> it = list.iterator(); it.hasNext();) { Map.Entry<LogAmounts, Double> entry = it.next(); sortedMap.put(entry.getKey(), entry.getValue()); @@ -80,7 +80,7 @@ public class Sorting { public static Map<String, Integer> sortASC(Map<String, Integer> unsortMap) { // Convert Map to List - List<Map.Entry<String, Integer>> list = new LinkedList<Map.Entry<String, Integer>>(unsortMap.entrySet()); + List<Map.Entry<String, Integer>> list = new LinkedList<>(unsortMap.entrySet()); // Sort list with comparator, to compare the Map values Collections.sort(list, new Comparator<Map.Entry<String, Integer>>() { @@ -91,7 +91,7 @@ public class Sorting { }); // Convert sorted map back to a Map - Map<String, Integer> sortedMap = new LinkedHashMap<String, Integer>(); + Map<String, Integer> sortedMap = new LinkedHashMap<>(); for (Iterator<Map.Entry<String, Integer>> it = list.iterator(); it.hasNext();) { Map.Entry<String, Integer> entry = it.next(); sortedMap.put(entry.getKey(), entry.getValue()); diff --git a/src/main/java/com/gamingmesh/jobs/stuff/TabComplete.java b/src/main/java/com/gamingmesh/jobs/stuff/TabComplete.java index 9fe84381..183f6c28 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/TabComplete.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/TabComplete.java @@ -15,7 +15,6 @@ import org.bukkit.util.StringUtil; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.container.ActionType; import com.gamingmesh.jobs.container.Job; -import com.gamingmesh.jobs.container.JobItemBonus; import com.gamingmesh.jobs.container.JobItems; import com.gamingmesh.jobs.container.JobProgression; import com.gamingmesh.jobs.container.JobsPlayer; @@ -28,7 +27,7 @@ public class TabComplete implements TabCompleter { if (args.length == 1) { String PartOfCommand = args[0]; - List<String> temp = new ArrayList<String>(); + List<String> temp = new ArrayList<>(); for (Entry<String, Integer> BCmd : Jobs.getCommandManager().GetCommands(sender).entrySet()) { temp.add(BCmd.getKey()); @@ -50,7 +49,7 @@ public class TabComplete implements TabCompleter { continue; String arg = ArgsList.get(i - 1); - List<String> temp = new ArrayList<String>(); + List<String> temp = new ArrayList<>(); if (arg.contains("%%")) for (String one : arg.split("%%")) { diff --git a/src/main/java/com/gamingmesh/jobs/stuff/Util.java b/src/main/java/com/gamingmesh/jobs/stuff/Util.java index 3b2329f2..b22b326e 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/Util.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/Util.java @@ -24,7 +24,7 @@ public class Util { public Util() { } - private static HashMap<UUID, String> jobsEditorMap = new HashMap<UUID, String>(); + private static HashMap<UUID, String> jobsEditorMap = new HashMap<>(); @SuppressWarnings("deprecation") public static ItemStack setEntityType(ItemStack is, EntityType type) throws IllegalArgumentException { @@ -86,7 +86,7 @@ public class Util { distance = 15 * 16; if (distance < 1) distance = 1; - ArrayList<Block> blocks = new ArrayList<Block>(); + ArrayList<Block> blocks = new ArrayList<>(); Iterator<Block> itr = new BlockIterator(player, distance); while (itr.hasNext()) { Block block = itr.next(); diff --git a/src/main/java/com/gamingmesh/jobs/stuff/VersionChecker.java b/src/main/java/com/gamingmesh/jobs/stuff/VersionChecker.java index f20a039d..46b69feb 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/VersionChecker.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/VersionChecker.java @@ -108,20 +108,20 @@ public class VersionChecker { return null; } - public boolean isLower(Version version) { - return this.version.getValue() < version.getValue(); + public boolean isLower(Version v) { + return version.getValue() < v.getValue(); } - public boolean isLowerEquals(Version version) { - return this.version.getValue() <= version.getValue(); + public boolean isLowerEquals(Version v) { + return version.getValue() <= v.getValue(); } - public boolean isHigher(Version version) { - return this.version.getValue() > version.getValue(); + public boolean isHigher(Version v) { + return version.getValue() > v.getValue(); } - public boolean isHigherEquals(Version version) { - return this.version.getValue() >= version.getValue(); + public boolean isHigherEquals(Version v) { + return version.getValue() >= v.getValue(); } public void VersionCheck(final Player player) {