Skip to content

Conversation

@Xiao-MoMi
Copy link
Contributor

The Material in Bukkit is an enum, which is not very flexible. This PR replaces it with Minecraft's built-in block registry to reduce unnecessary checks. Additionally, it changes values() to getAllDefaultBlockStates() to improve readability.

@Xiao-MoMi Xiao-MoMi requested a review from a team as a code owner January 2, 2025 21:41
@github-actions github-actions bot added the Feature This PR adds a new feature label Jan 2, 2025
@dordsor21
Copy link
Member

I would point out that (iirc) Spigot (and paper) plan to replace enums for materials with a registry of similar sorts (this has already been done for biomes).

@SirYwell
Copy link
Member

I assume this is supposed to fix #3060? In that case, I'd be fine with the change, at least until spigot marks it BlockType class/Block registry as non-internal.

@dordsor21
Copy link
Member

I assume this is supposed to fix #3060? In that case, I'd be fine with the change, at least until spigot marks it BlockType class/Block registry as non-internal.

I'm not sure, I feel we'd have more reports if there was a consistent issue? It should only be an issue if Spigot/Paper have stopped maintaining the Material enum for some reason...

Regardless, the API-breaking change needs to go

@Xiao-MoMi Xiao-MoMi requested a review from dordsor21 January 13, 2025 07:31
@dordsor21
Copy link
Member

I'd like to test with P2 first as I'm not fully convinced this will allow data to be available at the point it's needed there

Copy link
Member

@dordsor21 dordsor21 left a comment

Choose a reason for hiding this comment

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

Took a second to give it a test, but looks to be working. lgtm

@dordsor21 dordsor21 requested a review from a team January 31, 2025 15:50
@dordsor21 dordsor21 merged commit 9380555 into IntellectualSites:main Feb 9, 2025
10 checks passed
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.

3 participants