IntellectualSites / FastAsyncWorldEdit

Blazingly fast world manipulation for artists, builders and everyone else: https://www.spigotmc.org/resources/13932/
Other
624 stars 225 forks source link

Avoid map lookup in `isMovementBlocker` calls #2906

Closed SirYwell closed 2 months ago

SirYwell commented 2 months ago

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