diff --git a/src/main/java/io/github/dre2n/dungeonsxl/config/MainConfig.java b/src/main/java/io/github/dre2n/dungeonsxl/config/MainConfig.java index a4f88e32..0f08f7ae 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/config/MainConfig.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/config/MainConfig.java @@ -27,7 +27,7 @@ import org.bukkit.configuration.ConfigurationSection; */ public class MainConfig extends BRConfig { - public static final int CONFIG_VERSION = 1; + public static final int CONFIG_VERSION = 2; private String language = "en"; private boolean enableEconomy = false; @@ -38,11 +38,13 @@ public class MainConfig extends BRConfig { private String tutorialStartGroup = "default"; private String tutorialEndGroup = "player"; + /* Misc */ + private boolean sendFloorTitle = true; + private List editCommandWhitelist = new ArrayList<>(); + /* Default Dungeon Settings */ private WorldConfig defaultWorldConfig; - private List editCommandWhitelist = new ArrayList<>(); - public MainConfig(File file) { super(file, CONFIG_VERSION); @@ -95,6 +97,13 @@ public class MainConfig extends BRConfig { return tutorialStartGroup; } + /** + * @return if the floor title shall be sent + */ + public boolean getSendFloorTitle() { + return sendFloorTitle; + } + /** * @return the tutorialEndGroup */ @@ -151,6 +160,10 @@ public class MainConfig extends BRConfig { config.set("tutorial.endgroup", tutorialEndGroup); } + if (!config.contains("sendFloorTitle")) { + config.set("sendFloorTitle", sendFloorTitle); + } + if (!config.contains("editCommandWhitelist")) { config.set("editCommandWhitelist", editCommandWhitelist); } @@ -190,6 +203,10 @@ public class MainConfig extends BRConfig { tutorialEndGroup = config.getString("tutorial.endgroup"); } + if (config.contains("sendFloorTitle")) { + sendFloorTitle = config.getBoolean("sendFloorTitle"); + } + if (config.contains("editCommandWhitelist")) { editCommandWhitelist = config.getStringList("editCommandWhitelist"); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java index b7e7d9ac..84ea2899 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java @@ -493,11 +493,14 @@ public class DGroup { for (Player player : getPlayers()) { DPlayer dPlayer = DPlayer.getByPlayer(player); dPlayer.respawn(); - if (dungeonName != null) { - MessageUtil.sendTitleMessage(player, "&b&l" + dungeonName.replaceAll("_", " "), "&4&l" + mapName.replaceAll("_", " ")); - } else { - MessageUtil.sendTitleMessage(player, "&4&l" + mapName.replaceAll("_", " ")); + if (plugin.getMainConfig().getSendFloorTitle()) { + if (dungeonName != null) { + MessageUtil.sendTitleMessage(player, "&b&l" + dungeonName.replaceAll("_", " "), "&4&l" + mapName.replaceAll("_", " ")); + + } else { + MessageUtil.sendTitleMessage(player, "&4&l" + mapName.replaceAll("_", " ")); + } } WorldConfig config = gameWorld.getConfig();