From 6ffdaa73881e7a3be5f13df9d383b311cfcede8b Mon Sep 17 00:00:00 2001 From: Auxilor Date: Tue, 4 Oct 2022 01:15:48 +0100 Subject: [PATCH] Improved enchant GUI --- .../kotlin/com/willfp/ecoenchants/enchants/EnchantGUI.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EnchantGUI.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EnchantGUI.kt index 5cfc7b97..6844b729 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EnchantGUI.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EnchantGUI.kt @@ -7,7 +7,6 @@ import com.willfp.eco.core.gui.GUIComponent import com.willfp.eco.core.gui.menu import com.willfp.eco.core.gui.menu.Menu import com.willfp.eco.core.gui.menu.MenuLayer -import com.willfp.eco.core.gui.onRender import com.willfp.eco.core.gui.page.Page import com.willfp.eco.core.gui.page.PageChanger import com.willfp.eco.core.gui.slot @@ -75,9 +74,7 @@ object EnchantGUI { onRender { player, menu -> val atCaptive = menu.getCaptiveItem(player, captiveRow, captiveColumn) - if (atCaptive.isEmpty || atCaptive == null) { - menu.addState(player, "enchants", emptyList()) - } else if (atCaptive.type == Material.BOOK) { + if (atCaptive.isEmpty || atCaptive == null || atCaptive.type == Material.BOOK) { menu.addState(player, "enchants", EcoEnchants.values().sortForDisplay()) } else { menu.addState(player, "enchants", atCaptive.applicableEnchantments.sortForDisplay())