diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ActionBarTitleMessages.java b/src/main/java/com/gamingmesh/jobs/CMILib/ActionBarTitleMessages.java index d4f69731..09ae10cd 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ActionBarTitleMessages.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ActionBarTitleMessages.java @@ -66,14 +66,14 @@ public class ActionBarTitleMessages { } } - public static void send(CommandSender receivingPacket, String msg) { + public void send(CommandSender receivingPacket, String msg) { if (receivingPacket instanceof Player) send((Player) receivingPacket, msg); else receivingPacket.sendMessage(msg); } - public static void send(Player receivingPacket, String msg) { + public void send(Player receivingPacket, String msg) { if (receivingPacket == null) return; if (!receivingPacket.isOnline()) @@ -116,7 +116,8 @@ public class ActionBarTitleMessages { public static void sendTitle(final Player receivingPacket, final Object title, final Object subtitle, final int fadeIn, final int keep, final int fadeOut) { Bukkit.getScheduler().runTaskAsynchronously(Jobs.getInstance(), new Runnable() { - @Override + @SuppressWarnings("deprecation") + @Override public void run() { String t = title == null ? null : CMIChatColor.translateAlternateColorCodes((String) title); diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIChatColor.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIChatColor.java index 9352bb82..db21b86f 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIChatColor.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIChatColor.java @@ -138,7 +138,7 @@ public enum CMIChatColor { } public static CMIChatColor getRandomColor() { - List ls = new ArrayList(); + List ls = new ArrayList<>(); for (CMIChatColor one : CMIChatColor.values()) { if (!one.isColor()) continue; diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/RawMessage.java b/src/main/java/com/gamingmesh/jobs/CMILib/RawMessage.java index 9936bf07..c9bbad0c 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/RawMessage.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/RawMessage.java @@ -22,22 +22,22 @@ import com.gamingmesh.jobs.CMILib.VersionChecker.Version; public class RawMessage { - List parts = new ArrayList(); - List cleanParts = new ArrayList(); - String colorReplacerPlaceholder = "%#%"; + private List parts = new ArrayList<>(); + private List cleanParts = new ArrayList<>(); + private String colorReplacerPlaceholder = "%#%"; private String unfinished = ""; private String unfinishedClean = ""; private String combined = ""; - String combinedClean = ""; + private String combinedClean = ""; private boolean breakLine = true; // private boolean colorizeEntireWithLast = true; public void clear() { - parts = new ArrayList(); - cleanParts = new ArrayList(); + parts = new ArrayList<>(); + cleanParts = new ArrayList<>(); combined = ""; combinedClean = ""; } @@ -71,17 +71,17 @@ public class RawMessage { return add(text, hoverText, command, suggestion, null); } - Set formats = new HashSet(); - CMIChatColor lastColor = null; + private Set formats = new HashSet<>(); + private CMIChatColor lastColor = null; - Set savedFormats = new HashSet(); - CMIChatColor savedLastColor = null; + private Set savedFormats = new HashSet<>(); + private CMIChatColor savedLastColor = null; - CMIChatColor firstBlockColor = null; + private CMIChatColor firstBlockColor = null; private String makeMessyText(String text) { text = CMIChatColor.deColorize(text); - List splited = new ArrayList(); + List splited = new ArrayList<>(); if (text.contains(" ")) { for (String one : text.split(" ")) { @@ -348,7 +348,7 @@ public class RawMessage { } } - List Lore = new ArrayList(); + List Lore = new ArrayList<>(); // if (CMIMaterial.isShulkerBox(item.getType())) { // List items = CMI.getInstance().getShulkerBoxManager().getShulkerBoxContents(item); @@ -437,7 +437,7 @@ public class RawMessage { } public List softCombine() { - List ls = new ArrayList(); + List ls = new ArrayList<>(); String f = ""; for (String part : parts) { if (f.isEmpty()) diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/VersionChecker.java b/src/main/java/com/gamingmesh/jobs/CMILib/VersionChecker.java index 01318422..db991ebb 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/VersionChecker.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/VersionChecker.java @@ -14,7 +14,7 @@ import org.bukkit.entity.Player; import com.gamingmesh.jobs.Jobs; public class VersionChecker { - Jobs plugin; + private Jobs plugin; private static int resource = 4216; public VersionChecker(Jobs plugin) { @@ -182,7 +182,7 @@ public class VersionChecker { if (version.length() <= 7) return version; } catch (Exception ex) { - Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "Failed to check for " + plugin.getDescription().getName() + " update on spigot web page."); + Jobs.consoleMsg("&cFailed to check for " + plugin.getDescription().getName() + " update on spigot web page."); } return null; } 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 8333558b..476f2477 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java @@ -20,7 +20,6 @@ import com.gamingmesh.jobs.container.CurrencyType; import com.gamingmesh.jobs.container.Job; import com.gamingmesh.jobs.container.JobInfo; import com.gamingmesh.jobs.stuff.ChatColor; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.PageInfo; import com.gamingmesh.jobs.CMILib.RawMessage; import com.gamingmesh.jobs.stuff.Util; @@ -35,7 +34,7 @@ public class editjobs implements Cmd { if (!(sender instanceof Player)) return false; - + Player player = (Player) sender; if (args.length == 0) diff --git a/src/main/java/com/gamingmesh/jobs/economy/BufferedEconomy.java b/src/main/java/com/gamingmesh/jobs/economy/BufferedEconomy.java index e51df960..e332b583 100644 --- a/src/main/java/com/gamingmesh/jobs/economy/BufferedEconomy.java +++ b/src/main/java/com/gamingmesh/jobs/economy/BufferedEconomy.java @@ -31,7 +31,6 @@ import org.bukkit.entity.Player; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.api.JobsPaymentEvent; import com.gamingmesh.jobs.container.JobsPlayer; -import com.gamingmesh.jobs.CMILib.ActionBarTitleMessages; import com.gamingmesh.jobs.CMILib.VersionChecker.Version; import com.gamingmesh.jobs.tasks.BufferedPaymentTask; @@ -148,7 +147,7 @@ public class BufferedEconomy { Jobs.getActionbarToggleList().put(ServerTaxesAccountname, true); if (Jobs.getActionbarToggleList().containsKey(ServerTaxesAccountname) && Jobs.getActionbarToggleList().get(ServerTaxesAccountname)) { Jobs.getActionBar(); - ActionBarTitleMessages.send(Bukkit.getPlayer(ServerAccountname), Jobs.getLanguage().getMessage("message.taxes", "[amount]", (int) (TotalAmount * 100) + Jobs.getActionBar().send(Bukkit.getPlayer(ServerAccountname), Jobs.getLanguage().getMessage("message.taxes", "[amount]", (int) (TotalAmount * 100) / 100.0)); } } @@ -182,7 +181,7 @@ public class BufferedEconomy { if (Jobs.getGCManager().UseServerAccount) { if (!hasMoney) { Jobs.getActionBar(); - ActionBarTitleMessages.send(payment.getOfflinePlayer().getPlayer(), Jobs.getLanguage().getMessage("economy.error.nomoney")); + Jobs.getActionBar().send(payment.getOfflinePlayer().getPlayer(), Jobs.getLanguage().getMessage("economy.error.nomoney")); continue; } if (Jobs.getGCManager().isEconomyAsync()) { @@ -242,7 +241,7 @@ public class BufferedEconomy { Message = Message + " " + Jobs.getLanguage().getMessage("command.toggle.output.paid.exp", new Object[] { "[exp]", String.format(Jobs.getGCManager().getDecimalPlacesExp(), new Object[] { Double.valueOf(payment.getExp()) }) }); } - ActionBarTitleMessages.send(abp, Message); + Jobs.getActionBar().send(abp, Message); } } } diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 53e5529b..b20b7f93 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -27,7 +27,6 @@ import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.ChatColor; -import org.bukkit.CropState; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material;