Skip to content

Conversation

@SirYwell
Copy link
Member

@SirYwell SirYwell commented Sep 2, 2024

Overview

Description

isMovementBlocker is called in the HeightmapProcessor for every edited column at least once, so it's kind of a hot method. On newer Spigot versions, the call Material#isSolid() however requires a map lookup as it goes through the registry, slowing down the method call unnecessarily. As we already have the NMS block state available, we can just take the shortcut and call the method that is used by Spigot (and by the NMS heightmap calculation) directly.

### Submitter Checklist
- [x] Make sure you are opening from a topic branch (**/feature/fix/docs/ branch** (right side)) and not your main branch.
- [x] Ensure that the pull request title represents the desired changelog entry.
- [x] New public fields and methods are annotated with `@since TODO`.
- [x] I read and followed the [contribution guidelines](https://github.com/IntellectualSites/.github/blob/main/CONTRIBUTING.md).

@SirYwell SirYwell requested a review from a team as a code owner September 2, 2024 17:01
@github-actions github-actions bot added the Feature This PR adds a new feature label Sep 2, 2024
@dordsor21 dordsor21 requested a review from a team September 2, 2024 19:06
Copy link
Member

@PierreSchwang PierreSchwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels reasonable

@SirYwell SirYwell merged commit 378334b into main Sep 3, 2024
@SirYwell SirYwell deleted the feature/movementBlocker-shortcut branch September 3, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature This PR adds a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants