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

Add API to allow conditional rendering of block entities #2316

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Jozufozu
Copy link

@Jozufozu Jozufozu commented Feb 3, 2024

This PR aims to provide a way for other mods to fully take over rendering of specific block entities.

The solution here is to expose an API by which users associate a predicate with a block entity type.
If that predicate returns false for a given block entity, that block entity will not be added to a chunk's BuiltSectionInfo, and will therefore never be considered for rendering later on.

The predicate is stored directly in the given block entity type via a mixin'd interface.

- Extend BlockEntityType to store a predicate, always returning true by
  default.
- Evaluate the predicate in ChunkBuilderMeshingTask before fetching the
  BlockEntityRenderer.
- Expose a method to set the predicate for a given BlockEntityType in
  the API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant