From db822010518628f7b4a4b841d417679c4cd3bc3a Mon Sep 17 00:00:00 2001 From: montlikadani Date: Mon, 29 Jun 2020 13:19:12 +0200 Subject: [PATCH] Clean up - Fix when points are not added to the player account, Fixes #833 --- .../gamingmesh/jobs/CMIGUI/CMIGuiButton.java | 6 +- .../gamingmesh/jobs/CMIGUI/GUIListener.java | 11 +-- .../gamingmesh/jobs/CMIGUI/GUIManager.java | 6 +- .../gamingmesh/jobs/CMILib/CMIChatColor.java | 3 +- .../gamingmesh/jobs/CMILib/CMIEntityType.java | 5 +- .../gamingmesh/jobs/CMILib/CMIItemStack.java | 1 - .../gamingmesh/jobs/CMILib/CMIMaterial.java | 32 +++---- .../jobs/CMILib/CMIReflections.java | 9 +- .../gamingmesh/jobs/CMILib/ItemManager.java | 1 - .../jobs/CMILib/ItemReflection.java | 1 - .../gamingmesh/jobs/CMILib/RawMessage.java | 26 +++--- .../jobs/CMILib/VersionChecker.java | 91 ------------------- src/main/java/com/gamingmesh/jobs/Jobs.java | 1 - .../com/gamingmesh/jobs/Signs/SignUtil.java | 6 +- .../jobs/commands/JobsCommands.java | 3 +- .../jobs/commands/list/blockinfo.java | 2 +- .../jobs/commands/list/editjobs.java | 2 +- .../jobs/commands/list/editpoints.java | 1 - .../jobs/commands/list/editquests.java | 2 +- .../gamingmesh/jobs/config/ShopManager.java | 1 - .../gamingmesh/jobs/container/JobItems.java | 1 - .../jobs/economy/BufferedEconomy.java | 9 +- .../jobs/stuff/CMIScoreboardManager.java | 6 +- 23 files changed, 61 insertions(+), 165 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/CMIGUI/CMIGuiButton.java b/src/main/java/com/gamingmesh/jobs/CMIGUI/CMIGuiButton.java index 08921319..f6ace65e 100644 --- a/src/main/java/com/gamingmesh/jobs/CMIGUI/CMIGuiButton.java +++ b/src/main/java/com/gamingmesh/jobs/CMIGUI/CMIGuiButton.java @@ -17,7 +17,7 @@ import com.gamingmesh.jobs.CMIGUI.GUIManager.GUIClickType; import com.gamingmesh.jobs.CMIGUI.GUIManager.GUIFieldType; import com.gamingmesh.jobs.CMILib.CMIItemStack; import com.gamingmesh.jobs.CMILib.CMIMaterial; -import com.gamingmesh.jobs.CMILib.Reflections; +import com.gamingmesh.jobs.CMILib.CMIReflections; public class CMIGuiButton { @@ -25,7 +25,7 @@ public class CMIGuiButton { private GUIFieldType fieldType = GUIFieldType.Locked; private boolean closeInv = false; - private HashMap> commandMap = new HashMap>(); + private HashMap> commandMap = new HashMap<>(); private List permissions = new ArrayList(); private ItemStack item = null; @@ -260,7 +260,7 @@ public class CMIGuiButton { ItemStack i = item.clone(); if (isLocked()) { - i = Reflections.setNbt(item, GUIManager.CMIGUIIcon, GUIManager.LIProtection); + i = CMIReflections.setNbt(item, GUIManager.CMIGUIIcon, GUIManager.LIProtection); } ItemMeta meta = i.getItemMeta(); diff --git a/src/main/java/com/gamingmesh/jobs/CMIGUI/GUIListener.java b/src/main/java/com/gamingmesh/jobs/CMIGUI/GUIListener.java index a8584fc1..50a0ce77 100644 --- a/src/main/java/com/gamingmesh/jobs/CMIGUI/GUIListener.java +++ b/src/main/java/com/gamingmesh/jobs/CMIGUI/GUIListener.java @@ -18,8 +18,7 @@ import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.ItemStack; import com.gamingmesh.jobs.Jobs; -import com.gamingmesh.jobs.CMILib.Reflections; - +import com.gamingmesh.jobs.CMILib.CMIReflections; public class GUIListener implements Listener { Jobs plugin; @@ -41,14 +40,14 @@ public class GUIListener implements Listener { private static void clearIconItems(Player player) { for (ItemStack one : player.getInventory().getContents()) { - Object res = Reflections.getNbt(one, GUIManager.CMIGUIIcon); + Object res = CMIReflections.getNbt(one, GUIManager.CMIGUIIcon); if (res == null || !(res instanceof String) || !((String) res).equalsIgnoreCase(GUIManager.LIProtection)) continue; player.getInventory().remove(one); } } - private HashMap LastClick = new HashMap(); + private HashMap LastClick = new HashMap<>(); private boolean canClickByTimer(UUID uuid) { Long time = LastClick.get(uuid); @@ -97,7 +96,7 @@ public class GUIListener implements Listener { return; } - final List buttons = new ArrayList(); + final List buttons = new ArrayList<>(); buttons.add(event.getRawSlot()); if (!GUIManager.canClick(player, buttons)) { event.setCancelled(true); @@ -142,7 +141,7 @@ public class GUIListener implements Listener { return; } - final List buttons = new ArrayList(); + final List buttons = new ArrayList<>(); buttons.addAll(event.getRawSlots()); if (!GUIManager.canClick(player, buttons)) { event.setCancelled(true); diff --git a/src/main/java/com/gamingmesh/jobs/CMIGUI/GUIManager.java b/src/main/java/com/gamingmesh/jobs/CMIGUI/GUIManager.java index f3b069d2..750f9b20 100644 --- a/src/main/java/com/gamingmesh/jobs/CMIGUI/GUIManager.java +++ b/src/main/java/com/gamingmesh/jobs/CMIGUI/GUIManager.java @@ -16,11 +16,11 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import com.gamingmesh.jobs.Jobs; -import com.gamingmesh.jobs.CMILib.Reflections; +import com.gamingmesh.jobs.CMILib.CMIReflections; public class GUIManager { - private static HashMap map = new HashMap(); + private static HashMap map = new HashMap<>(); public final static String CMIGUIIcon = "CMIGUIIcon"; public final static String LIProtection = "LIProtection"; @@ -346,7 +346,7 @@ public class GUIManager { ItemStack item = one.getValue().getItem(gui.getPlayer()); item = item == null ? null : item.clone(); if (item != null && one.getValue().isLocked()) { - item = Reflections.setNbt(item, CMIGUIIcon, LIProtection); + item = CMIReflections.setNbt(item, CMIGUIIcon, LIProtection); } GuiInv.setItem(one.getKey(), item); } catch (ArrayIndexOutOfBoundsException e) { diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIChatColor.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIChatColor.java index 59182fae..a3cba5d5 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIChatColor.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIChatColor.java @@ -11,7 +11,6 @@ import java.util.regex.Pattern; import org.bukkit.ChatColor; import org.bukkit.Color; -import org.jetbrains.annotations.Nullable; public class CMIChatColor { @@ -203,7 +202,7 @@ public class CMIChatColor { } public static CMIChatColor getRandomColor() { - List ls = new ArrayList(); + List ls = new ArrayList<>(); for (Entry one : BY_NAME.entrySet()) { if (!one.getValue().isColor()) continue; diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIEntityType.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIEntityType.java index 19530202..2f811857 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIEntityType.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIEntityType.java @@ -2,16 +2,13 @@ package com.gamingmesh.jobs.CMILib; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.HashMap; import java.util.List; -import java.util.Map.Entry; import org.bukkit.block.CreatureSpawner; import org.bukkit.entity.EntityType; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.BlockStateMeta; -import org.bukkit.inventory.meta.ItemMeta; public enum CMIEntityType { @@ -264,7 +261,7 @@ public enum CMIEntityType { private String name; private String secondaryName; EntityType type = null; - public static HashMap cache = new HashMap(); + public static HashMap cache = new HashMap<>(); CMIEntityType(int id, String name, List headTextures) { this(id, name, null, headTextures); diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java index 58fdabb9..dc102bf4 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIItemStack.java @@ -17,7 +17,6 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import com.gamingmesh.jobs.Jobs; -import com.gamingmesh.jobs.CMILib.VersionChecker.Version; public class CMIItemStack { diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIMaterial.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIMaterial.java index 8747ce64..7632e712 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIMaterial.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIMaterial.java @@ -1218,7 +1218,6 @@ public enum CMIMaterial { } CMIMaterial(Integer legacyId, Integer legacyData, Integer id, List criteria, String name, String... legacyName) { - this.legacyId = legacyId; this.legacyData = legacyData; this.id = id; @@ -1354,8 +1353,7 @@ public enum CMIMaterial { } public static CMIMaterial getRandom(CMIMaterial mat) { - - List ls = new ArrayList(); + List ls = new ArrayList<>(); for (CMIMaterial one : CMIMaterial.values()) { if (one.getLegacyId() == null) @@ -1401,16 +1399,15 @@ public enum CMIMaterial { } public static CMIMaterial get(String id) { - if (id == null) return CMIMaterial.NONE; - Integer ids = null; + Integer data = null; id = id.replace("_", "").replace(" ", "").replace("minecraft:", "").toLowerCase(); if (id.contains(":")) { try { - ids = Integer.parseInt(id.split(":")[0]); + Integer ids = Integer.parseInt(id.split(":")[0]); data = Integer.parseInt(id.split(":")[1]); if (ids <= 0) return CMIMaterial.NONE; @@ -1498,12 +1495,8 @@ public enum CMIMaterial { if (block == null) return CMIMaterial.NONE; - try { - if (Bukkit.getWorld(block.getWorld().getUID()) == null) - return CMIMaterial.NONE; - } catch (Throwable e) { - e.printStackTrace(); - } + if (Bukkit.getWorld(block.getWorld().getUID()) == null) + return CMIMaterial.NONE; if (Version.isCurrentEqualOrHigher(Version.v1_14_R1)) { return ItemManager.byRealMaterial.get(block.getType()); @@ -2408,6 +2401,8 @@ public enum CMIMaterial { case CRIMSON_WALL_SIGN: case WARPED_WALL_SIGN: return true; + default: + break; } return false; } @@ -2644,7 +2639,8 @@ public enum CMIMaterial { return false; } - public static CMISlabType getSlabType(Block block) { + @SuppressWarnings("deprecation") + public static CMISlabType getSlabType(Block block) { if (!isSlab(block.getType())) return CMISlabType.NOTSLAB; @@ -2658,6 +2654,8 @@ public enum CMIMaterial { return CMISlabType.BOTTOM; case DOUBLE: return CMISlabType.DOUBLE; + default: + break; } } @@ -2705,6 +2703,8 @@ public enum CMIMaterial { default: return CMISlabType.DOUBLE; } + default: + break; } } @@ -2770,14 +2770,12 @@ public enum CMIMaterial { } public List getLegacyNames() { - if (legacyName == null) - return new ArrayList(); - return legacyName; + return legacyName == null ? new ArrayList<>() : legacyName; } public void addLegacyName(String legacyName) { if (legacyName == null) - this.legacyName = new ArrayList(); + this.legacyName = new ArrayList<>(); this.legacyName.add(legacyName); } diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIReflections.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIReflections.java index e5505f29..9047d0f4 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIReflections.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIReflections.java @@ -7,15 +7,14 @@ package com.gamingmesh.jobs.CMILib; import java.lang.reflect.Field; import java.lang.reflect.Method; -import org.bukkit.Bukkit; import org.bukkit.inventory.ItemStack; import com.gamingmesh.jobs.Jobs; public class CMIReflections { - private Class CraftServerClass; - private Object CraftServer; + //private Class CraftServerClass; + //private Object CraftServer; private static Class NBTTagCompound; private Class NBTBase; @@ -31,8 +30,8 @@ public class CMIReflections { private void initialize() { try { - CraftServerClass = getBukkitClass("CraftServer"); - CraftServer = CraftServerClass.cast(Bukkit.getServer()); + //CraftServerClass = getBukkitClass("CraftServer"); + //CraftServer = CraftServerClass.cast(Bukkit.getServer()); NBTTagCompound = getMinecraftClass("NBTTagCompound"); NBTBase = getMinecraftClass("NBTBase"); /*try { diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java index 293f9b70..a400ea45 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java @@ -15,7 +15,6 @@ import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionType; import com.gamingmesh.jobs.Jobs; -import com.gamingmesh.jobs.CMILib.Version; import com.gamingmesh.jobs.container.Potion; import com.gamingmesh.jobs.stuff.Util; diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java index cd1be69c..5cde12f5 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java @@ -12,7 +12,6 @@ import org.bukkit.entity.Entity; import org.bukkit.inventory.ItemStack; import com.gamingmesh.jobs.Jobs; -import com.gamingmesh.jobs.CMILib.VersionChecker.Version; public class ItemReflection { diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/RawMessage.java b/src/main/java/com/gamingmesh/jobs/CMILib/RawMessage.java index 4a07b251..09a36ff0 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/RawMessage.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/RawMessage.java @@ -15,8 +15,8 @@ import org.bukkit.inventory.ItemStack; public class RawMessage { - List parts = new ArrayList(); - List cleanParts = new ArrayList(); + List parts = new ArrayList<>(); + List cleanParts = new ArrayList<>(); private String unfinished = ""; private String unfinishedClean = ""; @@ -29,8 +29,8 @@ public class RawMessage { // private boolean colorizeEntireWithLast = true; public void clear() { - parts = new ArrayList(); - cleanParts = new ArrayList(); + parts = new ArrayList<>(); + cleanParts = new ArrayList<>(); combined = ""; combinedClean = ""; } @@ -63,10 +63,10 @@ public class RawMessage { return add(text, hoverText, command, suggestion, null); } - Set formats = new HashSet(); + Set formats = new HashSet<>(); CMIChatColor lastColor = null; - Set savedFormats = new HashSet(); + Set savedFormats = new HashSet<>(); CMIChatColor savedLastColor = null; CMIChatColor firstBlockColor = null; @@ -91,7 +91,7 @@ public class RawMessage { text = text.replaceAll(decolmatch.group(), string); } - List splited = new ArrayList(); + List splited = new ArrayList<>(); if (text.contains(" ")) { for (String one : text.split(" ")) { // if (this.isBreakLine() && one.contains("\\n")) { @@ -120,7 +120,7 @@ public class RawMessage { Pattern prepattern = Pattern.compile(CMIChatColor.hexColorRegex); - List plt = new ArrayList(splited); + List plt = new ArrayList<>(splited); splited.clear(); for (String one : plt) { Matcher match = prepattern.matcher(one); @@ -234,10 +234,10 @@ public class RawMessage { } one = one.replace(c.getColorCode(), c.getColorCode() + form); } else if (c.getHex() != null) { - String form = ""; - for (CMIChatColor oneC : formats) { - form += oneC.getColorCode(); - } + //String form = ""; + //for (CMIChatColor oneC : formats) { + //form += oneC.getColorCode(); + //} // CMIDebug.d("*"+net.md_5.bungee.api.ChatColor.of("#" + c.getHex())+ "_"+net.md_5.bungee.api.ChatColor.of("#FF00FF")+ "+"); @@ -567,7 +567,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 9045bed5..76c26a44 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/VersionChecker.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/VersionChecker.java @@ -44,97 +44,6 @@ public class VersionChecker { return version; } - public enum Version { - v1_7_R1, - v1_7_R2, - v1_7_R3, - v1_7_R4, - v1_8_R1, - v1_8_R2, - v1_8_R3, - v1_9_R1, - v1_9_R2, - v1_10_R1, - v1_11_R1, - v1_12_R1, - v1_13_R1, - v1_13_R2, - v1_14_R1, - v1_14_R2, - v1_15_R1, - v1_15_R2, - v1_16_R1, - v1_16_R2, - v1_17_R1, - v1_17_R2; - - private Integer value; - private String shortVersion; - private static Version current = null; - - Version() { - try { - this.value = Integer.valueOf(this.name().replaceAll("[^\\d.]", "")); - } catch (Exception e) { - } - shortVersion = this.name().substring(0, this.name().length() - 3); - } - - public Integer getValue() { - return value; - } - - public String getShortVersion() { - return shortVersion; - } - - public static Version getCurrent() { - if (current != null) - return current; - String[] v = Bukkit.getServer().getClass().getPackage().getName().split("\\."); - String vv = v[v.length - 1]; - for (Version one : values()) { - if (one.name().equalsIgnoreCase(vv)) { - current = one; - break; - } - } - return current; - } - - public boolean isLower(Version version) { - return getValue() < version.getValue(); - } - - public boolean isHigher(Version version) { - return getValue() > version.getValue(); - } - - public boolean isEqualOrLower(Version version) { - return getValue() <= version.getValue(); - } - - public boolean isEqualOrHigher(Version version) { - return getValue() >= version.getValue(); - } - - public static boolean isCurrentEqualOrHigher(Version v) { - return getCurrent().getValue() >= v.getValue(); - } - - public static boolean isCurrentHigher(Version v) { - return getCurrent().getValue() > v.getValue(); - } - - public static boolean isCurrentLower(Version v) { - return getCurrent().getValue() < v.getValue(); - } - - public static boolean isCurrentEqualOrLower(Version v) { - return getCurrent().getValue() <= v.getValue(); - } - } - public void VersionCheck(final Player player) { if (!Jobs.getGCManager().isShowNewVersion()) return; diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index c55fadaf..92d5a2bb 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -49,7 +49,6 @@ import com.gamingmesh.jobs.stuff.*; import com.gamingmesh.jobs.tasks.BufferedPaymentThread; import com.gamingmesh.jobs.tasks.DatabaseSaveThread; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.block.Block; import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; diff --git a/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java b/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java index df573013..52d088c3 100644 --- a/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java +++ b/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java @@ -19,14 +19,14 @@ import org.bukkit.configuration.file.YamlConfiguration; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.CMILib.CMIMaterial; import com.gamingmesh.jobs.CMILib.ConfigReader; -import com.gamingmesh.jobs.CMILib.VersionChecker.Version; +import com.gamingmesh.jobs.CMILib.Version; import com.gamingmesh.jobs.container.Job; import com.gamingmesh.jobs.container.TopList; public class SignUtil { - private HashMap> SignsByType = new HashMap>(); - private HashMap SignsByLocation = new HashMap(); + private HashMap> SignsByType = new HashMap<>(); + private HashMap SignsByLocation = new HashMap<>(); public HashMap> getSigns() { return SignsByType; diff --git a/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java b/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java index eca002ec..b54b0715 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java +++ b/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java @@ -15,6 +15,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ActionBarManager; import com.gamingmesh.jobs.CMILib.RawMessage; import com.gamingmesh.jobs.container.ActionType; import com.gamingmesh.jobs.container.Boost; @@ -142,7 +143,7 @@ public class JobsCommands implements CommandExecutor { PageInfo pi = new PageInfo(7, commands.size(), page); if (page > pi.getTotalPages() || page < 1) { - Jobs.getActionBar().send(sender, Jobs.getLanguage().getMessage("general.error.noHelpPage")); + ActionBarManager.send(sender, Jobs.getLanguage().getMessage("general.error.noHelpPage")); return true; } diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/blockinfo.java b/src/main/java/com/gamingmesh/jobs/commands/list/blockinfo.java index 5375bc10..bf1510c9 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/blockinfo.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/blockinfo.java @@ -5,7 +5,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.CMILib.CMIMaterial; -import com.gamingmesh.jobs.CMILib.VersionChecker.Version; +import com.gamingmesh.jobs.CMILib.Version; import com.gamingmesh.jobs.commands.Cmd; import com.gamingmesh.jobs.commands.JobCommand; import com.gamingmesh.jobs.stuff.Util; 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 c706b9f7..a9b3151a 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java @@ -4,7 +4,7 @@ import com.gamingmesh.jobs.CMILib.CMIEntityType; import com.gamingmesh.jobs.CMILib.CMIMaterial; import com.gamingmesh.jobs.CMILib.ItemReflection; import com.gamingmesh.jobs.CMILib.RawMessage; -import com.gamingmesh.jobs.CMILib.VersionChecker.Version; +import com.gamingmesh.jobs.CMILib.Version; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.commands.Cmd; import com.gamingmesh.jobs.commands.JobCommand; diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/editpoints.java b/src/main/java/com/gamingmesh/jobs/commands/list/editpoints.java index f838a5a7..8dc654b3 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/editpoints.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/editpoints.java @@ -58,7 +58,6 @@ public class editpoints implements Cmd { } Jobs.getJobsDAO().savePoints(jPlayer); - Jobs.getJobsDAO().loadPoints(jPlayer); return true; } } diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/editquests.java b/src/main/java/com/gamingmesh/jobs/commands/list/editquests.java index 26f024f2..0b47c83f 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/editquests.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/editquests.java @@ -17,7 +17,7 @@ import com.gamingmesh.jobs.CMILib.CMIEntityType; import com.gamingmesh.jobs.CMILib.CMIMaterial; import com.gamingmesh.jobs.CMILib.ItemReflection; import com.gamingmesh.jobs.CMILib.RawMessage; -import com.gamingmesh.jobs.CMILib.VersionChecker.Version; +import com.gamingmesh.jobs.CMILib.Version; import com.gamingmesh.jobs.commands.Cmd; import com.gamingmesh.jobs.commands.JobCommand; import com.gamingmesh.jobs.container.ActionType; diff --git a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java index db793be7..5d02f16e 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java @@ -8,7 +8,6 @@ import java.util.Map.Entry; import java.util.Set; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.OfflinePlayer; import org.bukkit.configuration.ConfigurationSection; diff --git a/src/main/java/com/gamingmesh/jobs/container/JobItems.java b/src/main/java/com/gamingmesh/jobs/container/JobItems.java index a725f72d..fff4c7bd 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobItems.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobItems.java @@ -23,7 +23,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map.Entry; -import org.bukkit.ChatColor; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/com/gamingmesh/jobs/economy/BufferedEconomy.java b/src/main/java/com/gamingmesh/jobs/economy/BufferedEconomy.java index 2a10c7e6..4d5d3c41 100644 --- a/src/main/java/com/gamingmesh/jobs/economy/BufferedEconomy.java +++ b/src/main/java/com/gamingmesh/jobs/economy/BufferedEconomy.java @@ -18,8 +18,9 @@ package com.gamingmesh.jobs.economy; -import com.gamingmesh.jobs.CMILib.VersionChecker.Version; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.ActionBarManager; +import com.gamingmesh.jobs.CMILib.Version; import com.gamingmesh.jobs.api.JobsPaymentEvent; import com.gamingmesh.jobs.container.CurrencyType; import com.gamingmesh.jobs.container.JobsPlayer; @@ -159,7 +160,7 @@ public class BufferedEconomy { if (ServerTaxesAccount.isOnline()) { if (Jobs.getGCManager().ActionBarsMessageByDefault) { - Jobs.getActionBar().send(Bukkit.getPlayer(ServerAccountname), + ActionBarManager.send(Bukkit.getPlayer(ServerAccountname), Jobs.getLanguage().getMessage("message.taxes", "[amount]", (int) (TotalAmount * 100) / 100.0)); } } @@ -191,7 +192,7 @@ public class BufferedEconomy { if (Jobs.getGCManager().UseServerAccount) { if (!hasMoney) { - Jobs.getActionBar().send(payment.getOfflinePlayer().getPlayer(), Jobs.getLanguage().getMessage("economy.error.nomoney")); + ActionBarManager.send(payment.getOfflinePlayer().getPlayer(), Jobs.getLanguage().getMessage("economy.error.nomoney")); continue; } } @@ -242,7 +243,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.get(CurrencyType.EXP)) }) }); } - Jobs.getActionBar().send(abp, Message); + ActionBarManager.send(abp, Message); } } } diff --git a/src/main/java/com/gamingmesh/jobs/stuff/CMIScoreboardManager.java b/src/main/java/com/gamingmesh/jobs/stuff/CMIScoreboardManager.java index 5a3eee67..9c0d481f 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/CMIScoreboardManager.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/CMIScoreboardManager.java @@ -17,8 +17,8 @@ import org.bukkit.scoreboard.Objective; import org.bukkit.scoreboard.Scoreboard; import com.gamingmesh.jobs.Jobs; -import com.gamingmesh.jobs.CMILib.Reflections; -import com.gamingmesh.jobs.CMILib.VersionChecker.Version; +import com.gamingmesh.jobs.CMILib.CMIReflections; +import com.gamingmesh.jobs.CMILib.Version; import com.gamingmesh.jobs.container.ScoreboardInfo; public class CMIScoreboardManager { @@ -204,7 +204,7 @@ public class CMIScoreboardManager { } private static Class getNMSClass(String nmsClassString) throws ClassNotFoundException { - return Reflections.getMinecraftClass(nmsClassString); + return CMIReflections.getMinecraftClass(nmsClassString); } private static Object getConnection(Player player) throws Exception {