diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomenus/components/ConfigurableSlot.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomenus/components/ConfigurableSlot.kt index 183e64d..10555b5 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomenus/components/ConfigurableSlot.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomenus/components/ConfigurableSlot.kt @@ -28,7 +28,7 @@ class ConfigurableSlot( ) : PositionedComponent { override val row: Int = config.getInt("location.row") override val column: Int = config.getInt("location.column") - val page: Int = config.getInt("location.page") + val page: Int? = config.getIntOrNull("location.page") override val layer = runCatching { enumValueOf(config.getString("location.layer").uppercase()) } .getOrElse { MenuLayer.MIDDLE } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomenus/menus/Menu.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomenus/menus/Menu.kt index 59b34af..3543eff 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomenus/menus/Menu.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomenus/menus/Menu.kt @@ -82,7 +82,7 @@ fun buildMenu(plugin: EcoPlugin, menu: EcoMenu, config: Config): Menu { setMask(mask) for (slot in slots) { - if (pageNumber != slot.page) { + if (slot.page != null && pageNumber != slot.page) { continue } diff --git a/eco-core/core-plugin/src/main/resources/menus/_example.yml b/eco-core/core-plugin/src/main/resources/menus/_example.yml index dffa49d..8c714cf 100644 --- a/eco-core/core-plugin/src/main/resources/menus/_example.yml +++ b/eco-core/core-plugin/src/main/resources/menus/_example.yml @@ -87,7 +87,7 @@ slots: location: row: 6 column: 5 - page: 1 + page: 1 # If you don't specify a page, it will be on all pages # (Optional) You can specify the layer of the slot. # The layer can be any of: lower, middle, upper, or top (defaults to middle)