diff --git a/core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java b/core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java index ab11142b..db7b224c 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java +++ b/core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java @@ -535,7 +535,11 @@ public class DungeonsXL extends DREPlugin implements DungeonsAPI { @Override public void registerGroupAdapter(GroupAdapter groupAdapter) { - groupAdapters.add(groupAdapter); + if (mainConfig.areGroupAdaptersEnabled()) { + groupAdapters.add(groupAdapter); + } else { + MessageUtil.log(this, "&4The group adapter &6" + groupAdapter.getClass().getName() + " &4was not registered because the feature is disabled."); + } } /** diff --git a/core/src/main/java/de/erethon/dungeonsxl/config/MainConfig.java b/core/src/main/java/de/erethon/dungeonsxl/config/MainConfig.java index 18a5a75c..980b10ab 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/config/MainConfig.java +++ b/core/src/main/java/de/erethon/dungeonsxl/config/MainConfig.java @@ -48,10 +48,11 @@ public class MainConfig extends DREConfig { NEVER } - public static final int CONFIG_VERSION = 16; + public static final int CONFIG_VERSION = 17; private String language = "english"; private boolean enableEconomy = false; + private boolean groupAdaptersEnabled = false; /* Chat */ private boolean chatEnabled = true; @@ -149,6 +150,20 @@ public class MainConfig extends DREConfig { enableEconomy = enabled; } + /** + * @return if DungeonsXL should use group adapters + */ + public boolean areGroupAdaptersEnabled() { + return groupAdaptersEnabled; + } + + /** + * @param enabled if DungeonsXL should use group adapters + */ + public void setGroupAdaptersEnabled(boolean enabled) { + groupAdaptersEnabled = enabled; + } + /** * @return if the dungeon chat is enabled */ @@ -472,6 +487,10 @@ public class MainConfig extends DREConfig { config.set("enableEconomy", enableEconomy); } + if (!config.contains("groupAdaptersEnabled")) { + config.set("groupAdaptersEnabled", groupAdaptersEnabled); + } + if (!config.contains("chatEnabled")) { config.set("chatEnabled", chatEnabled); } @@ -581,6 +600,7 @@ public class MainConfig extends DREConfig { language = config.getString("language", language); plugin.getMessageHandler().setDefaultLanguage(language); enableEconomy = config.getBoolean("enableEconomy", enableEconomy); + groupAdaptersEnabled = config.getBoolean("groupAdaptersEnabled", groupAdaptersEnabled); chatEnabled = config.getBoolean("chatEnabled", chatEnabled); chatFormatEdit = config.getString("chatFormat.edit", chatFormatEdit); chatFormatGame = config.getString("chatFormat.game", chatFormatGame);