mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-25 15:35:11 +01:00
Improved enchant GUI
This commit is contained in:
parent
cc856989f6
commit
6ffdaa7388
@ -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<EcoEnchant>())
|
||||
} 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())
|
||||
|
Loading…
Reference in New Issue
Block a user