From 50a63b90faaaf95c6208bf625d866b4e646f7164 Mon Sep 17 00:00:00 2001 From: Zrips Date: Mon, 27 Jan 2020 12:14:27 +0200 Subject: [PATCH] Lets not check mythycMobs if plugin is not present --- .../com/gamingmesh/jobs/config/ConfigManager.java | 5 ++--- .../com/gamingmesh/jobs/hooks/HookManager.java | 6 +++++- src/main/java/com/gamingmesh/jobs/stuff/Debug.java | 14 +++++++------- src/main/resources/jobConfig.yml | 2 -- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index 15bf1661..1296544c 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -210,7 +210,6 @@ public class ConfigManager { "he will no longer have option to get this quest"); cfg.get(pt + ".Quests.1.toLevel", 5); - cfg.save(); } @@ -673,7 +672,7 @@ public class ConfigManager { } Parser maxExpEquation; - String maxExpEquationInput = jobSection.getString("leveling-progression-equation"); + String maxExpEquationInput = jobKey.equalsIgnoreCase("None") ? "0" : jobSection.getString("leveling-progression-equation"); try { maxExpEquation = new Parser(maxExpEquationInput); // test equation @@ -702,7 +701,7 @@ public class ConfigManager { } Parser expEquation; - String expEquationInput = jobSection.getString("experience-progression-equation"); + String expEquationInput = jobKey.equalsIgnoreCase("None") ? "0" : jobSection.getString("experience-progression-equation"); try { expEquation = new Parser(expEquationInput); // test equation diff --git a/src/main/java/com/gamingmesh/jobs/hooks/HookManager.java b/src/main/java/com/gamingmesh/jobs/hooks/HookManager.java index 6f69f62a..09e850fa 100644 --- a/src/main/java/com/gamingmesh/jobs/hooks/HookManager.java +++ b/src/main/java/com/gamingmesh/jobs/hooks/HookManager.java @@ -33,7 +33,7 @@ public class HookManager { if (Jobs.getGCManager().MythicMobsEnabled && MythicManager != null && MythicManager.Check()) MythicManager.registerListener(); - } + } public static MyPetManager getMyPetManager() { if (myPetManager == null) { @@ -73,6 +73,10 @@ public class HookManager { } private static void setMythicManager() { + + if (pm.getPlugin("MythicMobs") == null) + return; + try { Class.forName("net.elseland.xikage.MythicMobs.API.MythicMobsAPI"); MythicManager = new MythicMobs2(Jobs.getInstance()); diff --git a/src/main/java/com/gamingmesh/jobs/stuff/Debug.java b/src/main/java/com/gamingmesh/jobs/stuff/Debug.java index e8ed4bd9..4264afb5 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/Debug.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/Debug.java @@ -4,11 +4,11 @@ import org.bukkit.Bukkit; import org.bukkit.entity.Player; public class Debug { - public static void D(Object message) { - Player player = Bukkit.getPlayer("Zrips"); - if (player == null) - return; - player.sendMessage(org.bukkit.ChatColor.translateAlternateColorCodes('&', "&8[Jobs Debug]&3 " + String.valueOf(message))); - return; - } + public static void D(Object message) { + Player player = Bukkit.getPlayer("Zrips"); + if (player == null) + return; + player.sendMessage(org.bukkit.ChatColor.translateAlternateColorCodes('&', "&8[JD]&3 " + String.valueOf(message))); + return; + } } diff --git a/src/main/resources/jobConfig.yml b/src/main/resources/jobConfig.yml index 8213f5c5..363e8034 100644 --- a/src/main/resources/jobConfig.yml +++ b/src/main/resources/jobConfig.yml @@ -3362,8 +3362,6 @@ Jobs: shortname: N ChatColour: WHITE chat-display: none - #max-level: 10 - #slots: 10 leveling-progression-equation: 10*(joblevel)+(joblevel*joblevel*4) income-progression-equation: baseincome+(baseincome*(joblevel-1)*0.01)-((baseincome+(joblevel-1)*0.01) * ((numjobs-1)*0.05)) points-progression-equation: basepoints+(basepoints*(joblevel-1)*0.01)-((basepoints+(joblevel-1)*0.01) * ((numjobs-1)*0.05))