-
Notifications
You must be signed in to change notification settings - Fork 3
Update to 1.21.2 - 1.21.4 #15
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
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.
Hello @Fourmisain, 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!
Summary of Changes
This pull request updates the Minecraft version from 1.21.1 to 1.21.4. It addresses changes in the game's API, specifically the removal of GameRules from World and ClientWorld, and changes to Item.Settings and TypedActionResult. The PR also includes an item definition file required for 1.21.4.
Highlights
- Minecraft Version Update: The Minecraft version has been updated from 1.21.1 to 1.21.4, requiring adjustments to dependencies and code.
- GameRules Handling: The
GameRulesare no longer automatically synced, so the daylight cycle is now manually synced usingGameruleSyncPayload. - Item Settings Update:
Item.Settingsnow requires aRegistryKeyto be passed. - TypedActionResult Removal: The
TypedActionResultclass has been removed and replaced withActionResult. - Item Definition: An item definition file (
assets/testutils/items/rulebook.json) has been added for the rulebook item to ensure the model shows up in 1.21.4.
Changelog
Click here to see the changelog
- .minepkg-lock.toml
- Updated Minecraft version to 1.21.4.
- Updated fabric version to 0.119.0+1.21.4.mpkg.1.
- Updated mapping to 1.21.4+build.8.
- gradle.properties
- Updated minecraft_version to 1.21.2.
- Updated yarn_mappings to 1.21.2+build.1.
- Updated fabric_version to 0.106.1+1.21.2.
- Updated libgui_version to 12.0.1+1.21.2.
- Updated minecraft_version_range to >=1.21.2 <=1.21.4.
- minepkg.toml
- Updated minecraft requirement to >=1.21.2 <=1.21.4.
- src/main/java/io/minepkg/testutils/RuleBookGUI.java
- Removed import of
net.minecraft.world.GameRules(line 24). - Replaced
w.getGameRules().getBoolean(GameRules.DO_DAYLIGHT_CYCLE)withTestUtilsClient.doDaylightCycle(line 187). - Replaced
world.getGameRules().getBoolean(GameRules.DO_DAYLIGHT_CYCLE)withTestUtilsClient.doDaylightCycle(line 222).
- Removed import of
- src/main/java/io/minepkg/testutils/RuleBookItem.java
- Removed import of
net.minecraft.item.ItemStack(line 5). - Removed import of
net.minecraft.util.TypedActionResult(line 10). - Replaced
TypedActionResult<ItemStack> use(...)withActionResult use(...)(line 19). - Replaced
new TypedActionResult<>(ActionResult.SUCCESS, playerEntity.getStackInHand(hand))withActionResult.SUCCESS(line 28).
- Removed import of
- src/main/java/io/minepkg/testutils/TestUtils.java
- Replaced
io.minepkg.testutils.network.s2c.WeatherGameruleSyncPayloadwithio.minepkg.testutils.network.s2c.GameruleSyncPayload(line 7). - Added imports for
net.minecraft.registry.RegistryKeyandnet.minecraft.registry.RegistryKeys(lines 17-18). - Modified item registration to use
RegistryKey(lines 48-52). - Replaced
broadcastWeatherRuleChangewithbroadcastRules(lines 101, 106). - Replaced
WeatherGameruleSyncPayloadwithGameruleSyncPayload(lines 125, 136). - Removed
sendWeatherRuleand replaced it withsendWeatherRulewhich usesGameruleSyncPayload(lines 133-137).
- Replaced
- src/main/java/io/minepkg/testutils/TestUtilsClient.java
- Added
doDaylightCycleboolean (line 13). - Replaced
WeatherGameruleSyncPayloadwithGameruleSyncPayload(lines 26-31). - Added
TestUtilsClient.doDaylightCycle = payload.doDaylightCycle();(line 30).
- Added
- src/main/java/io/minepkg/testutils/network/s2c/GameruleSyncPayload.java
- Added new file for
GameruleSyncPayloadto sync both daylight and weather rules.
- Added new file for
- src/main/java/io/minepkg/testutils/network/s2c/WeatherGameruleSyncPayload.java
- Removed file.
- src/main/resources/assets/testutils/items/rulebook.json
- Added new file for item definition.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and 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 to provide feedback.
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.
Trivia time!
What is the name of the Swedish game developer that created Minecraft?
Click here for the answer
Markus Alexej Persson, also known as Notch, created Minecraft.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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
The pull request updates the mod to Minecraft version 1.21.4, adapting to API changes and ensuring compatibility. The changes include updating dependencies, adjusting to changes in how GameRules are handled, and providing necessary item definitions. Overall, the changes seem well-structured and address the necessary updates for the new Minecraft version.
Summary of Findings
- GameRule Synchronization: The pull request correctly addresses the change in GameRules synchronization by manually syncing the daylight cycle along with the weather. This ensures that the client receives the correct game rule states.
- Item Settings Update: The update to
Item.Settingsby passing aRegistryKeyis correctly implemented, adapting to the API changes in the new Minecraft version. - Redundant
sendWeatherRulecall: ThesendWeatherRulemethod is called beforesendOpenBookPacketinRuleBookItem.use. SincesendWeatherRuleis now sending all gamerules, it is redundant to call it before opening the book.
Merge Readiness
The pull request appears to be well-structured and addresses the necessary updates for Minecraft version 1.21.4. However, the redundant sendWeatherRule call should be removed for efficiency. Once this is addressed, the pull request should be ready for merging. I am unable to approve this pull request, and other reviewers should review and approve this code before merging.
|
(Renamed |
GameRulesaren't part ofWorldandClientWorldanymore, as they are not synced with the client automatically anymore (I think).Not a big problem since we already manually synced the weather one anyways, so I just added the daylight one to it as well (see
GameruleSyncPayload).The
Item.Settingsnow need to be passed aRegistryKeyand there's noTypedActionResultanymore.1.21.4 needs an item definition (
assets/testutils/items/rulebook.json) for the item model to show up.There's no harm to leave that in 1.21.2/3.
Leaving as a draft to look over again tomorrow, though it should be fully functional.