Skip to content
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

feat: Using Block Registry to Replace Iterating Over the Material Enum #3057

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Xiao-MoMi
Copy link

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

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