diff --git a/src/main/java/com/gamingmesh/jobs/McMMO/McMMOManager.java b/src/main/java/com/gamingmesh/jobs/McMMO/McMMOManager.java index 2948cb45..34ebe9c1 100644 --- a/src/main/java/com/gamingmesh/jobs/McMMO/McMMOManager.java +++ b/src/main/java/com/gamingmesh/jobs/McMMO/McMMOManager.java @@ -13,7 +13,6 @@ import com.gmail.nossr50.datatypes.skills.SuperAbilityType; public class McMMOManager { public boolean mcMMOPresent = false; - public boolean mcMMOOverHaul = false; private HashMap> map = new HashMap<>(); @@ -26,28 +25,49 @@ public class McMMOManager { HashMap InfoMap = map.get(player.getUniqueId()); if (InfoMap == null) return 0D; - - if (mcMMOOverHaul = true) { - Long t = InfoMap.get(SuperAbilityType.TREE_FELLER); - if (t != null) { - if (t < System.currentTimeMillis()) - return -(1 - Jobs.getGCManager().TreeFellerMultiplier); - InfoMap.remove(SuperAbilityType.TREE_FELLER); - } - t = InfoMap.get(SuperAbilityType.GIGA_DRILL_BREAKER); - if (t != null) { - if (t < System.currentTimeMillis()) - return -(1 - Jobs.getGCManager().gigaDrillMultiplier); - InfoMap.remove(SuperAbilityType.GIGA_DRILL_BREAKER); - } + if (mcMMOOverHaul) { + Long t = InfoMap.get(SuperAbilityType.TREE_FELLER); + if (t != null) { + if (t < System.currentTimeMillis()) + return -(1 - Jobs.getGCManager().TreeFellerMultiplier); + InfoMap.remove(SuperAbilityType.TREE_FELLER); + } - t = InfoMap.get(SuperAbilityType.SUPER_BREAKER); - if (t != null) { - if (t < System.currentTimeMillis()) - return -(1 - Jobs.getGCManager().superBreakerMultiplier); - InfoMap.remove(SuperAbilityType.SUPER_BREAKER); - } + t = InfoMap.get(SuperAbilityType.GIGA_DRILL_BREAKER); + if (t != null) { + if (t < System.currentTimeMillis()) + return -(1 - Jobs.getGCManager().gigaDrillMultiplier); + InfoMap.remove(SuperAbilityType.GIGA_DRILL_BREAKER); + } + + t = InfoMap.get(SuperAbilityType.SUPER_BREAKER); + if (t != null) { + if (t < System.currentTimeMillis()) + return -(1 - Jobs.getGCManager().superBreakerMultiplier); + InfoMap.remove(SuperAbilityType.SUPER_BREAKER); + } + } else if (mcMMOPresent) { + Long t = InfoMap.get("TREE_FELLER"); + if (t != null) { + if (t < System.currentTimeMillis()) + return -(1 - Jobs.getGCManager().TreeFellerMultiplier); + InfoMap.remove("TREE_FELLER"); + } + + t = InfoMap.get("GIGA_DRILL_BREAKER"); + if (t != null) { + if (t < System.currentTimeMillis()) + return -(1 - Jobs.getGCManager().gigaDrillMultiplier); + InfoMap.remove("GIGA_DRILL_BREAKER"); + } + + t = InfoMap.get("SUPER_BREAKER"); + if (t != null) { + if (t < System.currentTimeMillis()) + return -(1 - Jobs.getGCManager().superBreakerMultiplier); + InfoMap.remove("SUPER_BREAKER"); + } } return 0D; @@ -57,12 +77,20 @@ public class McMMOManager { Plugin McMMO = Bukkit.getPluginManager().getPlugin("mcMMO"); if (McMMO != null) { try { - Class.forName("com.gmail.nossr50.api.AbilityAPI"); Class.forName("com.gmail.nossr50.datatypes.skills.SuperAbilityType"); - } catch (ClassNotFoundException e) { + } catch (ClassNotFoundException c) { // Disabling skill API check; - mcMMOPresent = false; + mcMMOOverHaul = false; Jobs.consoleMsg("&e[Jobs] &6mcMMO was found - &cBut your McMMO version is outdated, please update for full support."); + try { + Class.forName("com.gmail.nossr50.api.AbilityAPI"); + } catch (ClassNotFoundException e) { + // Disabling skill API check; + mcMMOPresent = false; + Jobs.consoleMsg("&e[Jobs] &6mcMMO was found - &cBut your McMMO version is outdated, please update for full support."); + // Still enabling event listener for repair + return true; + } // Still enabling event listener for repair return true; } diff --git a/src/main/java/com/gamingmesh/jobs/PlayerManager.java b/src/main/java/com/gamingmesh/jobs/PlayerManager.java index 147e99c0..09a71bd3 100644 --- a/src/main/java/com/gamingmesh/jobs/PlayerManager.java +++ b/src/main/java/com/gamingmesh/jobs/PlayerManager.java @@ -847,7 +847,7 @@ public class PlayerManager { if (player == null || prog == null) return boost; - if (Jobs.getMcMMOlistener().mcMMOPresent) + if (Jobs.getMcMMOlistener().mcMMOPresent || Jobs.getMcMMOlistener().mcMMOOverHaul) boost.add(BoostOf.McMMO, new BoostMultiplier().add(Jobs.getMcMMOlistener().getMultiplier(player.getPlayer()))); if (ent != null && (ent instanceof Tameable)) { diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/bonus.java b/src/main/java/com/gamingmesh/jobs/commands/list/bonus.java index a8f033c5..f73f9096 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/bonus.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/bonus.java @@ -56,7 +56,7 @@ public class bonus implements Cmd { printBoost(sender, boost, BoostOf.NearSpawner); printBoost(sender, boost, BoostOf.PetPay); - if (Jobs.getMcMMOlistener().mcMMOPresent && boost.get(BoostOf.McMMO, CurrencyType.EXP) != 0D) + if (Jobs.getMcMMOlistener().mcMMOPresent || Jobs.getMcMMOlistener().mcMMOOverHaul && boost.get(BoostOf.McMMO, CurrencyType.EXP) != 0D) printBoost(sender, boost, BoostOf.McMMO); sender.sendMessage(Jobs.getLanguage().getMessage("general.info.separator")); diff --git a/src/main/java/com/gamingmesh/jobs/container/Job.java b/src/main/java/com/gamingmesh/jobs/container/Job.java index 99fabca5..f48930ba 100644 --- a/src/main/java/com/gamingmesh/jobs/container/Job.java +++ b/src/main/java/com/gamingmesh/jobs/container/Job.java @@ -33,7 +33,6 @@ 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 diff --git a/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java b/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java index 87e5bb13..ad8c1378 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java @@ -690,7 +690,8 @@ public class JobsPlayer { honorific = builder.toString().trim(); if (honorific.length() > 0) - honorific = Jobs.getGCManager().getModifyChatPrefix() + honorific + Jobs.getGCManager().getModifyChatSuffix(); + honorific = org.bukkit.ChatColor.translateAlternateColorCodes('&', + Jobs.getGCManager().getModifyChatPrefix() + honorific + Jobs.getGCManager().getModifyChatSuffix()); }