diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffectManager.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffectManager.java index 5af1b308..d55371ec 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffectManager.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIEffectManager.java @@ -136,6 +136,7 @@ public class CMIEffectManager { private Effect effect; private Object EnumParticle; private int[] extra; + @SuppressWarnings("unused") private CMIParticleDataType dataType = CMIParticleDataType.Void; CMIParticle(String name, int id, CMIParticleType type) { diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java index 2274a179..d1b6bf13 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java @@ -32,7 +32,8 @@ public class ItemManager { static HashMap byMaterial = new HashMap<>(); static final Version version = Jobs.getVersionCheckManager().getVersion(); - public static void load() { + @SuppressWarnings("deprecation") + public static void load() { for (CMIMaterial one : CMIMaterial.values()) { if (one == null) @@ -127,7 +128,8 @@ public class ItemManager { static HashMap headCache = new HashMap<>(); - public static CMIItemStack getItem(String name) { + @SuppressWarnings("deprecation") + public static CMIItemStack getItem(String name) { if (byBukkitName.isEmpty()) load(); CMIItemStack cm = null; @@ -182,7 +184,7 @@ public class ItemManager { if (d.length() == 36) { try { OfflinePlayer offPlayer = Bukkit.getOfflinePlayer(UUID.fromString(d)); - skullMeta.setOwningPlayer(offPlayer); + skullMeta.setOwner(offPlayer.getName()); } catch (Exception e) { break main; } @@ -308,7 +310,8 @@ public class ItemManager { return results; } - static public Material getMaterial(String name) { + @SuppressWarnings("deprecation") + static public Material getMaterial(String name) { CMIItemStack cm = getItem(name); if (cm == null) return Material.AIR; @@ -1522,6 +1525,7 @@ public class ItemManager { return mat == null ? null : mat; } + @SuppressWarnings("deprecation") public void updateMaterial() { if (mat == null) { for (Material one : Material.class.getEnumConstants()) { @@ -1557,6 +1561,7 @@ public class ItemManager { } } + @SuppressWarnings("deprecation") public ItemStack newItemStack() { if (mat == null) { for (Material one : Material.class.getEnumConstants()) { @@ -1699,6 +1704,7 @@ public class ItemManager { return CMIMaterial.NONE; } + @SuppressWarnings("deprecation") public static CMIMaterial get(Material mat) { for (CMIMaterial one : CMIMaterial.values()) { if (one.getMaterial() == null) @@ -1710,6 +1716,7 @@ public class ItemManager { return CMIMaterial.NONE; } + @SuppressWarnings("deprecation") public static CMIMaterial get(int id) { for (CMIMaterial one : CMIMaterial.values()) { if (one.getMaterial() == null) @@ -1731,7 +1738,8 @@ public class ItemManager { // int tid = CMI.getInstance().getNMS().getEggId(item); // return get(item.getType().getId(), tid); // } - CMIMaterial m = get(item.getType().getId(), item.getData().getData()); + @SuppressWarnings("deprecation") + CMIMaterial m = get(item.getType().getId(), item.getData().getData()); if (m == null) { CMIItemStack cm = byBukkitName.get(item.getType().toString().toLowerCase().replace("_", "")); @@ -1743,7 +1751,8 @@ public class ItemManager { } public static CMIMaterial get(Block block) { - CMIMaterial m = get(block.getType().getId(), block.getData()); + @SuppressWarnings("deprecation") + CMIMaterial m = get(block.getType().getId(), block.getData()); if (m == null) { CMIItemStack cm = byBukkitName.get(block.getType().toString().replace("_", "").toLowerCase()); if (cm != null) @@ -2304,7 +2313,8 @@ public class ItemManager { } } - private static SlabType checkSlab(Block block) { + @SuppressWarnings("deprecation") + private static SlabType checkSlab(Block block) { if (!CMIMaterial.isSlab(block.getType())) return SlabType.NOTSLAB; diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java index 8ea1b23b..034ee8d4 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java @@ -87,7 +87,8 @@ public class ItemReflection { try { Object nmsStack = asNMSCopy(item); Method itemMeth = Item.getMethod("getById", int.class); - Object res = itemMeth.invoke(Item, item.getType().getId()); + @SuppressWarnings("deprecation") + Object res = itemMeth.invoke(Item, item.getType().getId()); String ff = "b"; switch (Jobs.getVersionCheckManager().getVersion()) { @@ -135,7 +136,8 @@ public class ItemReflection { try { Object nmsStack = asNMSCopy(item); Method itemMeth = Item.getMethod("getById", int.class); - Object res = itemMeth.invoke(Item, item.getType().getId()); + @SuppressWarnings("deprecation") + Object res = itemMeth.invoke(Item, item.getType().getId()); Method nameThingy = Item.getMethod("j", IStack); Object resThingy = nameThingy.invoke(res, nmsStack); return resThingy.toString(); diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index 51c77f0b..deac6f21 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -871,7 +871,8 @@ public class Jobs extends JavaPlugin { this.setEnabled(false); } - @Deprecated + @SuppressWarnings("unused") + @Deprecated private static void checkDailyQuests(JobsPlayer jPlayer, JobProgression prog, ActionInfo info) { checkDailyQuests(jPlayer, prog.getJob(), info); } @@ -1354,4 +1355,8 @@ public class Jobs extends JavaPlugin { if (pageCount != 0) rm.show(sender); } + + public static boolean isRunning() { + return running; + } } diff --git a/src/main/java/com/gamingmesh/jobs/Reflections.java b/src/main/java/com/gamingmesh/jobs/Reflections.java index 876bee37..0a69d72e 100644 --- a/src/main/java/com/gamingmesh/jobs/Reflections.java +++ b/src/main/java/com/gamingmesh/jobs/Reflections.java @@ -20,7 +20,8 @@ public class Reflections { private Class CraftItemStack; private Class Item; private Class IStack; - private Jobs plugin; + @SuppressWarnings("unused") + private Jobs plugin; public Reflections(Jobs plugin) { this.plugin = plugin; @@ -78,7 +79,8 @@ public class Reflections { try { Object nmsStack = asNMSCopy(item); Method itemMeth = Item.getMethod("getById", int.class); - Object res = itemMeth.invoke(Item, item.getType().getId()); + @SuppressWarnings("deprecation") + Object res = itemMeth.invoke(Item, item.getType().getId()); String ff = "b"; switch (Jobs.getVersionCheckManager().getVersion()) { diff --git a/src/main/java/com/gamingmesh/jobs/WorldGuard/WorldGuardManager.java b/src/main/java/com/gamingmesh/jobs/WorldGuard/WorldGuardManager.java index f493e5bb..a6ea6d20 100644 --- a/src/main/java/com/gamingmesh/jobs/WorldGuard/WorldGuardManager.java +++ b/src/main/java/com/gamingmesh/jobs/WorldGuard/WorldGuardManager.java @@ -18,7 +18,8 @@ import com.sk89q.worldguard.protection.regions.ProtectedRegion; public class WorldGuardManager { - private Jobs plugin; + @SuppressWarnings("unused") + private Jobs plugin; WorldGuardPlugin wg; public WorldGuardManager(Jobs plugin) { 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 a4661875..c5cd102b 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/bp.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/bp.java @@ -34,7 +34,7 @@ public class bp implements Cmd { Location loc = player.getLocation(); - final List changedBlocks = new ArrayList(); + final List changedBlocks = new ArrayList<>(); for (int x = -10; x < 10; x++) { for (int y = -10; y < 10; y++) { diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/browse.java b/src/main/java/com/gamingmesh/jobs/commands/list/browse.java index cd11a2d7..f6d7eae8 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/browse.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/browse.java @@ -22,7 +22,7 @@ public class browse implements Cmd { public boolean perform(Jobs plugin, CommandSender sender, final String[] args) { if (Jobs.getGCManager().BrowseUseNewLook) { - List jobList = new ArrayList(Jobs.getJobs()); + List jobList = new ArrayList<>(Jobs.getJobs()); if (jobList.size() == 0) { sender.sendMessage(ChatColor.RED + Jobs.getLanguage().getMessage("command.browse.error.nojobs")); @@ -151,7 +151,7 @@ public class browse implements Cmd { } else { - ArrayList lines = new ArrayList(); + ArrayList lines = new ArrayList<>(); for (Job job : Jobs.getJobs()) { if (Jobs.getGCManager().getHideJobsWithoutPermission()) { if (!Jobs.getCommandManager().hasJobPermission(sender, job)) 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 b237518f..e5587bf4 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java @@ -26,7 +26,8 @@ import com.gamingmesh.jobs.stuff.VersionChecker.Version; public class editjobs implements Cmd { - @Override + @SuppressWarnings("deprecation") + @Override @JobCommand(475) public boolean perform(Jobs plugin, CommandSender sender, String[] args) { diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/glog.java b/src/main/java/com/gamingmesh/jobs/commands/list/glog.java index ad8d9e04..e0afe21e 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/glog.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/glog.java @@ -30,7 +30,7 @@ public class glog implements Cmd { Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() { @Override public void run() { - Map unsortMap = new HashMap(); + Map unsortMap = new HashMap<>(); int time = TimeManage.timeInInt(); 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 550068b2..cb39f761 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/gtop.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/gtop.java @@ -63,7 +63,7 @@ public class gtop implements Cmd { } } else { - List ls = new ArrayList(); + List ls = new ArrayList<>(); int i = st; for (TopList one : FullList) { diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/itembonus.java b/src/main/java/com/gamingmesh/jobs/commands/list/itembonus.java index d024cb69..f735da38 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/itembonus.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/itembonus.java @@ -39,7 +39,7 @@ public class itembonus implements Cmd { ItemStack iih = Jobs.getNms().getItemInMainHand(player); - List items = new ArrayList(); + List items = new ArrayList<>(); if (iih != null && !iih.getType().equals(Material.AIR)) items.add(iih); 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 87608d09..dc3c6215 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/log.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/log.java @@ -55,7 +55,7 @@ public class log implements Cmd { return true; } - Map unsortMap = new HashMap(); + Map unsortMap = new HashMap<>(); for (Entry l : logList.entrySet()) { Log one = l.getValue(); diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/quests.java b/src/main/java/com/gamingmesh/jobs/commands/list/quests.java index 3c2c2fbd..b3d65e91 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/quests.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/quests.java @@ -65,7 +65,7 @@ public class quests implements Cmd { "[required]", q.getQuest().getAmount()); List hoverMsgs = Jobs.getLanguage().getMessageList("command.quests.output.hover"); - List hoverList = new ArrayList(); + List hoverList = new ArrayList<>(); for (int i = 0; i < hoverMsgs.size(); i++) { String current = hoverMsgs.get(i); diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/reload.java b/src/main/java/com/gamingmesh/jobs/commands/list/reload.java index 92643eb1..5fc0fcbc 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/reload.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/reload.java @@ -2,7 +2,6 @@ package com.gamingmesh.jobs.commands.list; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; -import org.bukkit.command.ConsoleCommandSender; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.commands.Cmd; @@ -19,8 +18,7 @@ public class reload implements Cmd { } catch (Exception e) { sender.sendMessage(ChatColor.RED + Jobs.getLanguage().getMessage("general.admin.error")); String message = org.bukkit.ChatColor.translateAlternateColorCodes('&', "&4There was an error when performing a reload: "); - ConsoleCommandSender console = Bukkit.getServer().getConsoleSender(); - console.sendMessage(message); + Bukkit.getServer().getConsoleSender().sendMessage(message); e.printStackTrace(); } return true; 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 074ece38..4598b11f 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/top.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/top.java @@ -77,7 +77,7 @@ public class top implements Cmd { } } else { - List ls = new ArrayList(); + List ls = new ArrayList<>(); int i = st; for (TopList one : FullList) { diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index 77a85d8c..671adb0a 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -166,7 +166,8 @@ public class ConfigManager { } - public KeyValues getKeyValue(String myKey, ActionType actionType, String jobName) { + @SuppressWarnings("deprecation") + public KeyValues getKeyValue(String myKey, ActionType actionType, String jobName) { String type = null; String subType = ""; diff --git a/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java b/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java index 5aabe876..ce58191e 100644 --- a/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java @@ -30,7 +30,7 @@ public class LanguageManager { } public static List getClassesFromPackage(String pckgname, String cleaner) throws ClassNotFoundException { - List result = new ArrayList(); + List result = new ArrayList<>(); try { for (URL jarURL : ((URLClassLoader) Jobs.class.getClassLoader()).getURLs()) { try { diff --git a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java index 4388b513..46e02832 100644 --- a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java @@ -114,6 +114,8 @@ public class NameTranslatorManager { case MMKILL: return Jobs.getMythicManager().getDisplayName(materialName); + default: + break; } return materialName; @@ -180,7 +182,7 @@ public class NameTranslatorManager { file.renameTo(file2); // Just copying default language files, except en, that one will be generated - List languages = new ArrayList(); + List languages = new ArrayList<>(); try { languages.addAll(LanguageManager.getClassesFromPackage("TranslatableWords", "Words_")); diff --git a/src/main/java/com/gamingmesh/jobs/dao/JobsMySQL.java b/src/main/java/com/gamingmesh/jobs/dao/JobsMySQL.java index 7c0d24a8..24cf738e 100644 --- a/src/main/java/com/gamingmesh/jobs/dao/JobsMySQL.java +++ b/src/main/java/com/gamingmesh/jobs/dao/JobsMySQL.java @@ -10,7 +10,8 @@ import com.gamingmesh.jobs.dao.JobsManager.DataBaseType; public class JobsMySQL extends JobsDAO { private String database; - private Jobs plugin; + @SuppressWarnings("unused") + private Jobs plugin; JobsMySQL(Jobs plugin, String hostname, String database, String username, String password, String prefix, boolean certificate, boolean ssl) { super(plugin, "com.mysql.jdbc.Driver", "jdbc:mysql://" + hostname + "/" + database + "?autoReconnect=true&useSSL=" + ssl + "&verifyServerCertificate=" + certificate, username, password, prefix); diff --git a/src/main/java/com/gamingmesh/jobs/dao/JobsSQLite.java b/src/main/java/com/gamingmesh/jobs/dao/JobsSQLite.java index 78e8bf5e..bef91d9a 100644 --- a/src/main/java/com/gamingmesh/jobs/dao/JobsSQLite.java +++ b/src/main/java/com/gamingmesh/jobs/dao/JobsSQLite.java @@ -11,7 +11,8 @@ import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.dao.JobsManager.DataBaseType; public class JobsSQLite extends JobsDAO { - private Jobs plugin; + @SuppressWarnings("unused") + private Jobs plugin; public void initialize() { try { diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 403e5767..c4efd565 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -651,7 +651,8 @@ public class JobsPaymentListener implements Listener { } - @Deprecated + @SuppressWarnings("unused") + @Deprecated private Integer schedulePostDetection(final HumanEntity player, final ItemStack compareItem, final JobsPlayer jPlayer, final ItemStack resultStack) { return schedulePostDetection(player, compareItem, jPlayer, resultStack, ActionType.CRAFT); }