diff --git a/src/main/java/de/fanta/challenges/guis/settingsgui/MainGui.java b/src/main/java/de/fanta/challenges/guis/settingsgui/MainGui.java index 916ae80..08540f8 100644 --- a/src/main/java/de/fanta/challenges/guis/settingsgui/MainGui.java +++ b/src/main/java/de/fanta/challenges/guis/settingsgui/MainGui.java @@ -1,6 +1,7 @@ package de.fanta.challenges.guis.settingsgui; import de.fanta.challenges.Challenges; +import de.fanta.challenges.ServerType; import de.fanta.challenges.utils.ChatUtil; import de.fanta.challenges.utils.guiutils.AbstractWindow; import de.fanta.challenges.utils.guiutils.GUIUtils; @@ -41,7 +42,11 @@ int slot = event.getSlot(); switch (slot) { - case CHALLENGES_INDEX -> new ChallengesGui(player).open(); + case CHALLENGES_INDEX -> { + if (plugin.getServerType() != ServerType.ADVENTURE) { + new ChallengesGui(player).open(); + } + } case OTHER_SETTINGS_INDEX -> new OtherSettingsGui(player).open(); case SERVER_SETTINGS_INDEX -> new ServerSettingsGui(player).open(); case CLOSE_IDEX -> player.closeInventory(); @@ -55,7 +60,13 @@ for (int i = 0; i < WINDOW_SIZE; i++) { ItemStack item; switch (i) { - case CHALLENGES_INDEX -> item = GUIUtils.createGuiItem(Material.REPEATER, ChatUtil.GREEN + "Challenges"); + case CHALLENGES_INDEX -> { + if (plugin.getServerType() != ServerType.ADVENTURE) { + item = GUIUtils.createGuiItem(Material.REPEATER, ChatUtil.GREEN + "Challenges"); + } else { + item = GUIUtils.createGuiItem(Material.BARRIER, ChatUtil.RED + "Challenges sind nur bei /tt challenge verfügbar"); + } + } case OTHER_SETTINGS_INDEX -> item = GUIUtils.createGuiItem(Material.COMPARATOR, ChatUtil.GREEN + "Andere Einstellungen"); case SERVER_SETTINGS_INDEX -> item = GUIUtils.createGuiItem(Material.COMMAND_BLOCK, ChatUtil.GREEN + "Server Einstellungen"); case CLOSE_IDEX -> {