diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIChatColor.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIChatColor.java index db21b86f..de52a807 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIChatColor.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIChatColor.java @@ -64,7 +64,7 @@ public enum CMIChatColor { public static String deColorize(String text) { if (text == null) return null; - return text.replace("�", "&"); + return text.replace("§", "&"); } public static String stripColor(String text) { @@ -86,7 +86,7 @@ public enum CMIChatColor { } public String getBukkitColorCode() { - return "�" + c; + return "§" + c; } public char getChar() { diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java index 91cfefe2..db31691e 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java @@ -694,7 +694,7 @@ public class ItemManager { BONE_MEAL(351, 15, 32458, "Bone Meal"), BOOK(340, 0, 23097, "Book"), BOOKSHELF(47, 0, 10069, "Bookshelf"), - BOW(261, 0, 8745, "Bow", "BOW"), + BOW(261, 0, 8745, "Bow"), BOWL(281, 0, 32661, "Bowl"), BRAIN_CORAL(-1, -1, 31316, "Brain Coral"), BRAIN_CORAL_BLOCK(-1, -1, 30618, "Brain Coral Block"), @@ -875,6 +875,7 @@ public class ItemManager { DRIED_KELP_BLOCK(-1, -1, 12966, "Dried Kelp Block"), DROPPER(158, 0, 31273, "Dropper"), DROWNED_SPAWN_EGG(-1, -1, 19368, "Drowned Spawn Egg"), + DOUBLE_TALL_GRASS(175, 2, 21560, "Double Tall Grass"), EGG(344, 0, 21603, "Egg"), ELDER_GUARDIAN_SPAWN_EGG(383, 4, 11418, "Spawn Elder Guardian", "Elder Guardian Spawn Egg"), ELYTRA(443, 0, 23829, "Elytra"), @@ -1146,7 +1147,7 @@ public class ItemManager { NETHER_STAR(399, 0, 12469, "Nether Star"), NETHER_WART(372, 0, 29227, "Nether Wart", "NETHER_STALK"), NETHER_WART_BLOCK(214, 0, 15486, "Nether Wart Block"), - NOTE_BLOCK(25, 0, 20979, "Note Block", "NOTE_BLOCK"), + NOTE_BLOCK(25, 0, 20979, "Note Block"), OAK_BOAT(333, 0, 17570, "Boat", "Oak Boat"), OAK_BUTTON(143, 0, 13510, "Oak Button", "wooden_button"), OAK_DOOR(324, 0, 20341, "Wooden Door", "Wood Door"), @@ -1444,7 +1445,7 @@ public class ItemManager { SUGAR(353, 0, 30638, "Sugar"), SUGAR_CANE(338, 0, 7726, "Sugar Canes", "Sugar Cane"), SUNFLOWER(175, 0, 7408, "Sunflower"), - TALL_GRASS(31, 0, 21559, "Tall Grass"), + TALL_GRASS(31, 1, 21559, "Tall Grass"), TALL_SEAGRASS(-1, -1, 27189, "Tall Seagrass"), TERRACOTTA(172, 0, 16544, "Terracotta", "HARD_CLAY"), TIPPED_ARROW(440, 0, 25164, "Tipped Arrow"), diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index e33e4ac6..3d9534da 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -300,8 +300,8 @@ public class Jobs extends JavaPlugin { pManager = new PlayerManager(); } - public static void setRestrictedBlockManager(Jobs plugin) { - RBManager = new RestrictedBlockManager(plugin); + public static void setRestrictedBlockManager() { + RBManager = new RestrictedBlockManager(); } public static RestrictedBlockManager getRestrictedBlockManager() { diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index d87c3595..d76a3980 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -771,13 +771,13 @@ public class ConfigManager { name = itemSection.getString("name"); List lore = new ArrayList<>(); - if (itemSection.getStringList("lore") != null && itemSection.getStringList("lore").size() != 0) + if (itemSection.getStringList("lore") != null && !itemSection.getStringList("lore").isEmpty()) for (String eachLine : itemSection.getStringList("lore")) { lore.add(org.bukkit.ChatColor.translateAlternateColorCodes('&', eachLine)); } HashMap enchants = new HashMap<>(); - if (itemSection.getStringList("enchants") != null && itemSection.getStringList("enchants").size() != 0) + if (itemSection.getStringList("enchants") != null && !itemSection.getStringList("enchants").isEmpty()) for (String eachLine : itemSection.getStringList("enchants")) { if (!eachLine.contains("=")) @@ -826,13 +826,13 @@ public class ConfigManager { name = itemSection.getString("name"); List lore = new ArrayList<>(); - if (itemSection.getStringList("lore") != null && itemSection.getStringList("lore").size() != 0) + if (itemSection.getStringList("lore") != null && !itemSection.getStringList("lore").isEmpty()) for (String eachLine : itemSection.getStringList("lore")) { lore.add(org.bukkit.ChatColor.translateAlternateColorCodes('&', eachLine)); } HashMap enchants = new HashMap<>(); - if (itemSection.getStringList("enchants") != null && itemSection.getStringList("enchants").size() != 0) + if (itemSection.getStringList("enchants") != null && !itemSection.getStringList("enchants").isEmpty()) for (String eachLine : itemSection.getStringList("enchants")) { if (!eachLine.contains("=")) diff --git a/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java index 276a4d15..eebfb814 100644 --- a/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java @@ -352,7 +352,7 @@ public class GeneralConfigManager { Jobs.setRestrictedAreaManager(this.plugin); Jobs.getRestrictedAreaManager().load(); // restricted blocks - Jobs.setRestrictedBlockManager(this.plugin); + Jobs.setRestrictedBlockManager(); Jobs.getRestrictedBlockManager().load(); // Item/Block/mobs name list Jobs.setNameTranslatorManager(this.plugin); @@ -552,7 +552,7 @@ public class GeneralConfigManager { c.getW().addComment("modify-chat", "Modifys chat to add chat titles. If you're using a chat manager, you may add the tag {jobs} to your chat format and disable this."); modifyChat = c.get("modify-chat.use", true); modifyChatPrefix = c.get("modify-chat.prefix", "&c[", true); - modifyChatSuffix = c.get("modify-chat.suffix", "&c]&r", true); + modifyChatSuffix = c.get("modify-chat.suffix", "&c]&r ", true); modifyChatSeparator = c.get("modify-chat.separator", " ", true); c.getW().addComment("UseCustomNames", "Do you want to use custom item/block/mob/enchant/color names", diff --git a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java index 1399d398..6f59ac92 100644 --- a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java @@ -151,7 +151,7 @@ public class NameTranslatorManager { String Name = ItemFile.getConfig().getString("ItemList." + one); ListOfNames.add(new NameList(id, meta, Name, MCName)); } - if (ListOfNames.size() != 0) + if (ListOfNames.size() > 0) Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfNames.size() + " custom item names!"); } else Jobs.consoleMsg("&c[Jobs] The ItemList section not found in " + ItemFile.fileName + " file."); @@ -168,7 +168,7 @@ public class NameTranslatorManager { String Name = ItemFile.getConfig().getString("EntityList." + one); ListOfEntities.add(new NameList(id, meta, Name, MCName)); } - if (ListOfEntities.size() != 0) + if (ListOfEntities.size() > 0) Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfEntities.size() + " custom entity names!"); } else Jobs.consoleMsg("&c[Jobs] The EntityList section not found in " + ItemFile.fileName + " file."); @@ -184,7 +184,7 @@ public class NameTranslatorManager { String Name = section.getString(one + ".Name"); ListOfEnchants.add(new NameList(id, meta, Name, MCName)); } - if (ListOfEnchants.size() != 0) + if (ListOfEnchants.size() > 0) Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfEnchants.size() + " custom enchant names!"); } else Jobs.consoleMsg("&c[Jobs] The EnchantList section not found in " + ItemFile.fileName + " file."); @@ -200,7 +200,7 @@ public class NameTranslatorManager { String Name = ItemFile.getConfig().getString("ColorList." + one); ListOfColors.add(new NameList(id, meta, Name, MCName)); } - if (ListOfColors.size() != 0) + if (ListOfColors.size() > 0) Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfColors.size() + " custom color names!"); } else Jobs.consoleMsg("&c[Jobs] The ColorList section not found in " + ItemFile.fileName + " file."); @@ -216,7 +216,7 @@ public class NameTranslatorManager { String Name = ItemFile.getConfig().getString("PotionNamesList." + one); ListOfColors.add(new NameList(id, meta, Name, MCName)); } - if (ListOfPotionNames.size() != 0) + if (ListOfPotionNames.size() > 0) Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfPotionNames.size() + " custom potion names!"); } else Jobs.consoleMsg("&c[Jobs] The PotionNamesList section not found in " + ItemFile.fileName + " file."); diff --git a/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java b/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java index 87888cb1..95669983 100644 --- a/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java @@ -13,10 +13,7 @@ public class RestrictedBlockManager { public HashMap restrictedBlocksTimer = new HashMap<>(); - private Jobs plugin; - - public RestrictedBlockManager(Jobs plugin) { - this.plugin = plugin; + public RestrictedBlockManager() { } /** diff --git a/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java b/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java index 4635113c..427b7212 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java @@ -64,8 +64,8 @@ public class JobsPlayer { private int userid = -1; - List barMap = new ArrayList<>(); - List updateBossBarFor = new ArrayList<>(); + private List barMap = new ArrayList<>(); + private List updateBossBarFor = new ArrayList<>(); // save lock // public final Object saveLock = new Object(); @@ -80,9 +80,9 @@ public class JobsPlayer { private HashMap> qProgression = new HashMap<>(); private int doneQuests = 0; - public JobsPlayer(String userName, OfflinePlayer player) { + public JobsPlayer(String userName, OfflinePlayer OffPlayer) { this.userName = userName; - this.OffPlayer = player; + this.OffPlayer = OffPlayer; this.player = Bukkit.getPlayer(userName); } diff --git a/src/main/java/com/gamingmesh/jobs/container/QuestProgression.java b/src/main/java/com/gamingmesh/jobs/container/QuestProgression.java index 71d07d23..a6f324d0 100644 --- a/src/main/java/com/gamingmesh/jobs/container/QuestProgression.java +++ b/src/main/java/com/gamingmesh/jobs/container/QuestProgression.java @@ -1,7 +1,5 @@ package com.gamingmesh.jobs.container; -import java.util.List; - import org.bukkit.Bukkit; import org.bukkit.event.server.ServerCommandEvent; @@ -77,9 +75,8 @@ public class QuestProgression { jPlayer.addDoneQuest(); - List cmds = quest.getRewardCmds(); - for (String one : cmds) { - ServerCommandEvent ev = new ServerCommandEvent(Bukkit.getConsoleSender(), one.replace("[playerName]", jPlayer.getUserName())); + for (String one : quest.getRewardCmds()) { + ServerCommandEvent ev = new ServerCommandEvent(Bukkit.getConsoleSender(), one.replace("[playerName]", jPlayer.getPlayer().getName())); Bukkit.getPluginManager().callEvent(ev); if (!ev.isCancelled()) { Bukkit.dispatchCommand(Bukkit.getConsoleSender(), ev.getCommand().startsWith("/") ? ev.getCommand().substring(1) : ev.getCommand()); diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java index f3c890b0..bae0fa4d 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java @@ -574,14 +574,6 @@ public class JobsListener implements Listener { String format = event.getFormat(); - // check if the player is in the job - if (jPlayer != null) - for (Job job : Jobs.getJobs()) { - if (!jPlayer.isInJob(job)) - format = format.replace("%1$s", ""); - return; - } - format = format.replace("%1$s", honorific + "%1$s"); event.setFormat(format); } @@ -598,13 +590,6 @@ public class JobsListener implements Listener { if (honorific.equalsIgnoreCase(" ")) honorific = ""; String format = event.getFormat(); - // check if the player is in the job - if (jPlayer != null) - for (Job job : Jobs.getJobs()) { - if (!jPlayer.isInJob(job)) - format = format.replace("{jobs}", ""); - return; - } if (!format.contains("{jobs}")) return; format = format.replace("{jobs}", honorific); @@ -623,13 +608,6 @@ public class JobsListener implements Listener { if (honorific.equalsIgnoreCase(" ")) honorific = ""; String format = event.getFormat(); - // check if the player is in the job - if (jPlayer != null) - for (Job job : Jobs.getJobs()) { - if (!jPlayer.isInJob(job)) - format = format.replace("{jobs}", ""); - return; - } if (!format.contains("{jobs}")) return; format = format.replace("{jobs}", honorific);