Skip to content

Conversation

@failutee
Copy link
Contributor

@failutee failutee commented Dec 1, 2025

Tested on: 1.21.8

Screen.Recording.2025-12-01.at.18.47.12-1.mov

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @failutee, 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 resolves an issue where dynamic border blocks were not correctly restored to their original state after being hidden, leading to visual inconsistencies for players. The changes introduce a robust mechanism to capture and store the original block types, allowing for precise restoration when the border is no longer active. This enhancement significantly improves the visual fidelity and overall user experience of the border animation system.

Highlights

  • Improved Border Block Restoration: The system now stores and restores the original blocks when a border is hidden, rather than simply replacing them with air. This prevents visual glitches and ensures the environment returns to its exact previous state.
  • Refactored Block Handling Logic: The methods responsible for showing, hiding, and filtering border blocks have been significantly refactored. This includes renaming methods for clarity and streamlining the process of sending block change packets to players.
  • Introduction of originalBlocks Map: A new ConcurrentHashMap named originalBlocks has been added to track the original block IDs for each player. This map is crucial for accurately restoring blocks when the border animation concludes.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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

  1. 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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @failutee, 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 resolves an issue where the animated border blocks were not correctly reverting to their original state after being hidden. The changes introduce a robust system to store the original block types at border locations and restore them precisely, preventing permanent alterations to the game world and ensuring a seamless visual experience for players.

Highlights

  • Block Restoration Logic: Implemented a mechanism to store and restore original block types when the border animation is hidden. Previously, blocks were simply replaced with air, leading to unintended changes in the world.
  • Original Block Tracking: Introduced a new originalBlocks map to keep track of the actual block IDs at each BorderPoint for individual players, ensuring accurate restoration.
  • Refactored Block Processing: Updated block processing methods (showBlocks, restoreBlocks, filterPassablePoints) to leverage the new block restoration logic and to group blocks more precisely by chunk sections (3D) for packet sending.
  • Passable Block Filtering: Modified the logic for determining 'passable' border points to also save the original block type if the block is not solid, preventing border blocks from appearing inside solid structures.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 introduces a significant improvement by correctly handling border block placement to avoid permanently destroying existing blocks. It now saves the original blocks before displaying the border and restores them afterward. The refactoring to centralize lock acquisition and rename methods for clarity is well done. I've identified one critical issue and a couple of medium-severity suggestions for improvement. The critical issue is in the updatePlayer method, which doesn't seem to save original blocks during border updates, potentially reintroducing the bug this PR aims to fix. I've also suggested improving a method name for clarity and optimizing how block IDs are resolved.

…er/animation/block/BorderBlockController.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 correctly fixes an issue where the border visualization would destroy non-solid blocks by implementing a mechanism to save and restore the original blocks. The refactoring and renaming of methods also improve code clarity. I've found two significant issues: a critical race condition in onBorderShowAsyncEvent that could lead to data corruption, and a high-severity memory leak where player data is not cleaned up from the new maps upon logout. Please see my detailed comments for suggestions on how to fix these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant