From 7f670df8c5d11bfcc721e59a4f58a36cb01bffa5 Mon Sep 17 00:00:00 2001 From: Indyuce Date: Thu, 18 Aug 2022 23:38:13 +0200 Subject: [PATCH] Debug logs to prevent server crash --- .../net/Indyuce/mmocore/manager/SkillManager.java | 12 ++++++++---- pom.xml | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/SkillManager.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/SkillManager.java index 19b1d5ac..df79de35 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/SkillManager.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/SkillManager.java @@ -3,12 +3,12 @@ package net.Indyuce.mmocore.manager; import io.lumine.mythic.lib.MythicLib; import io.lumine.mythic.lib.skill.handler.SkillHandler; import net.Indyuce.mmocore.MMOCore; +import net.Indyuce.mmocore.api.ConfigFile; import net.Indyuce.mmocore.api.util.MMOCoreUtils; import net.Indyuce.mmocore.skill.RegisteredSkill; -import net.Indyuce.mmocore.skill.list.Sneaky_Picky; -import net.Indyuce.mmocore.api.ConfigFile; import net.Indyuce.mmocore.skill.list.Ambers; import net.Indyuce.mmocore.skill.list.Neptune_Gift; +import net.Indyuce.mmocore.skill.list.Sneaky_Picky; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -83,8 +83,12 @@ public class SkillManager implements MMOCoreManager { config.save(); } - RegisteredSkill skill = new RegisteredSkill(handler, config.getConfig()); - this.skills.put(handler.getId(), skill); + try { + final RegisteredSkill skill = new RegisteredSkill(handler, config.getConfig()); + this.skills.put(handler.getId(), skill); + } catch (RuntimeException exception) { + MMOCore.plugin.getLogger().log(Level.WARNING, "Could not load skill '" + handler.getId() + "': " + exception.getMessage()); + } } } } diff --git a/pom.xml b/pom.xml index 12594de3..867ca9e9 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Offer your players a brand new RPG experience!! - 1.10-SNAPSHOT + 1.10.1-SNAPSHOT false false UTF-8