forked from Upstream/mmocore
moved listener registration to onEnable to fix bug w/ multiple events
This commit is contained in:
parent
dbf3ee981a
commit
23e702bb2d
@ -58,6 +58,9 @@ import net.Indyuce.mmocore.listener.PlayerListener;
|
|||||||
import net.Indyuce.mmocore.listener.SpellCast;
|
import net.Indyuce.mmocore.listener.SpellCast;
|
||||||
import net.Indyuce.mmocore.listener.WaypointsListener;
|
import net.Indyuce.mmocore.listener.WaypointsListener;
|
||||||
import net.Indyuce.mmocore.listener.event.PlayerAttackEventListener;
|
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.FishingListener;
|
||||||
import net.Indyuce.mmocore.listener.profession.PlayerCollectStats;
|
import net.Indyuce.mmocore.listener.profession.PlayerCollectStats;
|
||||||
import net.Indyuce.mmocore.manager.AttributeManager;
|
import net.Indyuce.mmocore.manager.AttributeManager;
|
||||||
@ -247,6 +250,15 @@ public class MMOCore extends JavaPlugin {
|
|||||||
if (getConfig().getBoolean("debug"))
|
if (getConfig().getBoolean("debug"))
|
||||||
new DebugMode();
|
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 PlayerAttackEventListener(), this);
|
||||||
|
|
||||||
Bukkit.getPluginManager().registerEvents(new DamageManager(), this);
|
Bukkit.getPluginManager().registerEvents(new DamageManager(), this);
|
||||||
|
@ -9,7 +9,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
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.ChatInput;
|
||||||
import net.Indyuce.mmocore.api.input.PlayerInput;
|
import net.Indyuce.mmocore.api.input.PlayerInput;
|
||||||
import net.Indyuce.mmocore.api.input.PlayerInput.InputType;
|
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 {
|
public class ConfigManager {
|
||||||
|
|
||||||
@ -97,15 +93,6 @@ public class ConfigManager {
|
|||||||
regenPartyBuff = MMOCore.plugin.getConfig().getDouble("party.buff.health-regen");
|
regenPartyBuff = MMOCore.plugin.getConfig().getDouble("party.buff.health-regen");
|
||||||
partyChatPrefix = MMOCore.plugin.getConfig().getString("party.chat-prefix");
|
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();
|
neededExp.clear();
|
||||||
int line = 0;
|
int line = 0;
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user