diff --git a/src/main/java/net/Indyuce/mmocore/MMOCore.java b/src/main/java/net/Indyuce/mmocore/MMOCore.java index d867ab2a..69f8a7a7 100644 --- a/src/main/java/net/Indyuce/mmocore/MMOCore.java +++ b/src/main/java/net/Indyuce/mmocore/MMOCore.java @@ -58,6 +58,9 @@ import net.Indyuce.mmocore.listener.PlayerListener; import net.Indyuce.mmocore.listener.SpellCast; import net.Indyuce.mmocore.listener.WaypointsListener; import net.Indyuce.mmocore.listener.event.PlayerAttackEventListener; +import net.Indyuce.mmocore.listener.option.DeathExperienceLoss; +import net.Indyuce.mmocore.listener.option.HealthScale; +import net.Indyuce.mmocore.listener.option.VanillaExperienceOverride; import net.Indyuce.mmocore.listener.profession.FishingListener; import net.Indyuce.mmocore.listener.profession.PlayerCollectStats; import net.Indyuce.mmocore.manager.AttributeManager; @@ -247,6 +250,15 @@ public class MMOCore extends JavaPlugin { if (getConfig().getBoolean("debug")) new DebugMode(); + if (configManager.overrideVanillaExp = getConfig().getBoolean("override-vanilla-exp")) + Bukkit.getPluginManager().registerEvents(new VanillaExperienceOverride(), this); + + if (getConfig().getBoolean("health-scale.enabled")) + Bukkit.getPluginManager().registerEvents(new HealthScale(), this); + + if (getConfig().getBoolean("death-exp-loss.enabled")) + Bukkit.getPluginManager().registerEvents(new DeathExperienceLoss(), this); + Bukkit.getPluginManager().registerEvents(new PlayerAttackEventListener(), this); Bukkit.getPluginManager().registerEvents(new DamageManager(), this); diff --git a/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java b/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java index 2d9916dc..5b0a7dcb 100644 --- a/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java +++ b/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java @@ -9,7 +9,6 @@ import java.util.ArrayList; import java.util.List; import java.util.logging.Level; -import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; @@ -21,9 +20,6 @@ import net.Indyuce.mmocore.api.input.AnvilGUI; import net.Indyuce.mmocore.api.input.ChatInput; import net.Indyuce.mmocore.api.input.PlayerInput; import net.Indyuce.mmocore.api.input.PlayerInput.InputType; -import net.Indyuce.mmocore.listener.option.DeathExperienceLoss; -import net.Indyuce.mmocore.listener.option.HealthScale; -import net.Indyuce.mmocore.listener.option.VanillaExperienceOverride; public class ConfigManager { @@ -97,15 +93,6 @@ public class ConfigManager { regenPartyBuff = MMOCore.plugin.getConfig().getDouble("party.buff.health-regen"); partyChatPrefix = MMOCore.plugin.getConfig().getString("party.chat-prefix"); - if (overrideVanillaExp = MMOCore.plugin.getConfig().getBoolean("override-vanilla-exp")) - Bukkit.getPluginManager().registerEvents(new VanillaExperienceOverride(), MMOCore.plugin); - - if (MMOCore.plugin.getConfig().getBoolean("health-scale.enabled")) - Bukkit.getPluginManager().registerEvents(new HealthScale(), MMOCore.plugin); - - if (MMOCore.plugin.getConfig().getBoolean("death-exp-loss.enabled")) - Bukkit.getPluginManager().registerEvents(new DeathExperienceLoss(), MMOCore.plugin); - neededExp.clear(); int line = 0; try {