diff --git a/changelogs/1.3.1-beta+fabric-1.19.md b/changelogs/1.3.1-beta+fabric-1.19.md new file mode 100644 index 0000000..9f70df9 --- /dev/null +++ b/changelogs/1.3.1-beta+fabric-1.19.md @@ -0,0 +1,6 @@ +Now with fixed scroll! + +**Changed**: +- Scroll offset is now capped to max scroll offset + +**Full Changelog**: https://github.com/eth0net/enchant-menu/compare/v1.3.0+fabric-1.19...v1.3.1-beta+fabric-1.19 diff --git a/gradle.properties b/gradle.properties index d6f974b..5695dbc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,6 +19,6 @@ completeConfigVersionId=zaC01d1T # Mod Properties mavenGroup=com.github.eth0net modId=enchant-menu -modVersion=1.3.0+fabric-1.19 -modVersionName=1.3.0 Fabric 1.19 -modVersionType=release +modVersion=1.3.1-beta+fabric-1.19 +modVersionName=1.3.1 Beta Fabric 1.19 +modVersionType=beta diff --git a/src/main/kotlin/com/github/eth0net/enchantmenu/client/gui/screen/EnchantMenuScreen.kt b/src/main/kotlin/com/github/eth0net/enchantmenu/client/gui/screen/EnchantMenuScreen.kt index 7adedd9..572dc62 100644 --- a/src/main/kotlin/com/github/eth0net/enchantmenu/client/gui/screen/EnchantMenuScreen.kt +++ b/src/main/kotlin/com/github/eth0net/enchantmenu/client/gui/screen/EnchantMenuScreen.kt @@ -40,6 +40,7 @@ class EnchantMenuScreen(handler: EnchantMenuScreenHandler, playerInventory: Play private val canScroll get() = handler.enchantments.size > maxRows private val maxScrollOffset get() = if (canScroll) handler.enchantments.size - maxRows else 0 private var scrollOffset = 0 + get() = if (field > maxScrollOffset) maxScrollOffset else field set(value) { field = if (value <= 0) { 0