-
Notifications
You must be signed in to change notification settings - Fork 0
feature/upgrade-to-1-21-10 #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @olehrstm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on a comprehensive version upgrade for the project, primarily targeting Minecraft 1.21.10. It involves updating various core dependencies such as Fabric Loader, Fabric API, and Kotlin Loader to ensure full compatibility with the new Minecraft version. Additionally, the build system has been modernized with a Gradle wrapper upgrade, and specific code adaptations were made to align with changes in Minecraft's client-side APIs, particularly in how mouse events are processed. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request upgrades the project dependencies to support Minecraft 1.21.10, including updates to Gradle, Fabric, and Kotlin versions. The changes in build.gradle.kts and gradle.properties are consistent with this goal. The update to ExtractPackScreen.kt adapts the mouseClicked method to a new signature from the Minecraft API. My review focuses on ensuring the logic remains correct after this API migration. I've found one potential issue regarding the order of operations in the updated mouseClicked method.
| override fun mouseClicked(click: Click?, doubled: Boolean): Boolean { | ||
| if (click == null) return super.mouseClicked(click, doubled) | ||
|
|
||
| if (extractionState.isExtracting.value) return true // block interaction while extracting | ||
|
|
||
| val hovered = listRenderer.getHoveredIndex(mouseX.toInt(), mouseY.toInt(), width, serverPackProfiles.size) | ||
| val hovered = listRenderer.getHoveredIndex(click.x.toInt(), click.y.toInt(), width, serverPackProfiles.size) | ||
| if (hovered in serverPackProfiles.indices) { | ||
| selectedIndex = hovered | ||
| updateButtonStates() | ||
| return true | ||
| } | ||
| return super.mouseClicked(mouseX, mouseY, button) | ||
|
|
||
| return super.mouseClicked(click, doubled) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order of checks in mouseClicked has been changed, which could introduce a bug. The check for extractionState.isExtracting.value should be the first thing in the method to ensure that all interactions are blocked during extraction, which was the original behavior. With the current implementation, if click is null, the method will return false via super.mouseClicked even if an extraction is in progress, potentially allowing other UI elements to process the event.
| override fun mouseClicked(click: Click?, doubled: Boolean): Boolean { | |
| if (click == null) return super.mouseClicked(click, doubled) | |
| if (extractionState.isExtracting.value) return true // block interaction while extracting | |
| val hovered = listRenderer.getHoveredIndex(mouseX.toInt(), mouseY.toInt(), width, serverPackProfiles.size) | |
| val hovered = listRenderer.getHoveredIndex(click.x.toInt(), click.y.toInt(), width, serverPackProfiles.size) | |
| if (hovered in serverPackProfiles.indices) { | |
| selectedIndex = hovered | |
| updateButtonStates() | |
| return true | |
| } | |
| return super.mouseClicked(mouseX, mouseY, button) | |
| return super.mouseClicked(click, doubled) | |
| } | |
| override fun mouseClicked(click: Click?, doubled: Boolean): Boolean { | |
| if (extractionState.isExtracting.value) return true // block interaction while extracting | |
| if (click == null) return super.mouseClicked(click, doubled) | |
| val hovered = listRenderer.getHoveredIndex(click.x.toInt(), click.y.toInt(), width, serverPackProfiles.size) | |
| if (hovered in serverPackProfiles.indices) { | |
| selectedIndex = hovered | |
| updateButtonStates() | |
| return true | |
| } | |
| return super.mouseClicked(click, doubled) | |
| } |
No description provided.