diff --git a/lib/MMOItems.jar b/lib/MMOItems.jar index ce98bbb7..b34c4410 100644 Binary files a/lib/MMOItems.jar and b/lib/MMOItems.jar differ diff --git a/src/main/java/net/Indyuce/mmocore/MMOCore.java b/src/main/java/net/Indyuce/mmocore/MMOCore.java index 9e53ac45..ed1f2436 100644 --- a/src/main/java/net/Indyuce/mmocore/MMOCore.java +++ b/src/main/java/net/Indyuce/mmocore/MMOCore.java @@ -1,17 +1,5 @@ package net.Indyuce.mmocore; -import java.io.File; -import java.lang.reflect.Field; -import java.util.HashSet; -import java.util.logging.Level; - -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.command.CommandMap; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.scheduler.BukkitRunnable; - import net.Indyuce.mmocore.api.ConfigFile; import net.Indyuce.mmocore.api.PlayerActionBar; import net.Indyuce.mmocore.api.loot.LootChest; @@ -97,6 +85,17 @@ import net.Indyuce.mmocore.manager.social.PartyManager; import net.Indyuce.mmocore.manager.social.RequestManager; import net.mmogroup.mmolib.comp.Metrics; import net.mmogroup.mmolib.version.SpigotPlugin; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.command.CommandMap; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; + +import java.io.File; +import java.lang.reflect.Field; +import java.util.HashSet; +import java.util.logging.Level; public class MMOCore extends JavaPlugin { public static MMOCore plugin; @@ -109,7 +108,6 @@ public class MMOCore extends JavaPlugin { public VaultEconomy economy; public HologramSupport hologramSupport; public AntiCheatSupport antiCheatSupport; - public InventoryManager inventoryManager; public RegionHandler regionHandler = new DefaultRegionHandler(); public FlagPlugin flagPlugin = new DefaultFlags(); public PlaceholderParser placeholderParser = new DefaultParser(); @@ -268,8 +266,10 @@ public class MMOCore extends JavaPlugin { /* * enable debug mode for extra debug tools. */ - if (getConfig().contains("debug")) - new DebugMode(getConfig().getInt("debug", 0)); + if (getConfig().contains("debug")) { + DebugMode.setLevel(getConfig().getInt("debug", 0)); + DebugMode.enableActionBar(); + } if (configManager.overrideVanillaExp = getConfig().getBoolean("override-vanilla-exp")) Bukkit.getPluginManager().registerEvents(new VanillaExperienceOverride(), this); @@ -412,7 +412,7 @@ public class MMOCore extends JavaPlugin { classManager.clear(); classManager.reload(); - inventoryManager = new InventoryManager(); + InventoryManager.load(); questManager.clear(); questManager.reload(); diff --git a/src/main/java/net/Indyuce/mmocore/api/util/debug/DebugMode.java b/src/main/java/net/Indyuce/mmocore/api/util/debug/DebugMode.java index 6e441059..b5033900 100644 --- a/src/main/java/net/Indyuce/mmocore/api/util/debug/DebugMode.java +++ b/src/main/java/net/Indyuce/mmocore/api/util/debug/DebugMode.java @@ -14,8 +14,11 @@ public class DebugMode { */ public static int level = 0; - public DebugMode(int i) { + public static void setLevel(int i) { level = i; + } + + public static void enableActionBar() { if (level > 2 && MMOCore.plugin.getConfig().getBoolean("debug-action-bar.enabled")) new ActionBarRunnable().runTaskTimer(MMOCore.plugin, 0, 10); } diff --git a/src/main/java/net/Indyuce/mmocore/manager/InventoryManager.java b/src/main/java/net/Indyuce/mmocore/manager/InventoryManager.java index eda90dd9..c2768f77 100644 --- a/src/main/java/net/Indyuce/mmocore/manager/InventoryManager.java +++ b/src/main/java/net/Indyuce/mmocore/manager/InventoryManager.java @@ -42,7 +42,7 @@ public class InventoryManager { public static final List list = Arrays.asList(PLAYER_STATS, ATTRIBUTE_VIEW, SKILL_LIST, CLASS_SELECT, SUBCLASS_SELECT, SUBCLASS_CONFIRM, QUEST_LIST, WAYPOINTS, CLASS_CONFIRM, FRIEND_LIST, FRIEND_REMOVAL, PARTY_VIEW, PARTY_CREATION, GUILD_VIEW, GUILD_CREATION); - public InventoryManager() { + public static void load() { list.forEach(inv -> { MMOCore.plugin.configManager.loadDefaultFile("gui", inv.getId() + ".yml"); try {