Skip to content

Add API to get Tile Entities in a Chunk by Predicate#4907

Merged
Proximyst merged 1 commit into
PaperMC:masterfrom
me4502:feature/block-predicate-tes
Dec 24, 2020
Merged

Add API to get Tile Entities in a Chunk by Predicate#4907
Proximyst merged 1 commit into
PaperMC:masterfrom
me4502:feature/block-predicate-tes

Conversation

@me4502
Copy link
Copy Markdown
Member

@me4502 me4502 commented Dec 18, 2020

Currently, if someone wants to get all sign BlockState instances in a chunk, they end up parsing BlockEntity data of all BlockEntities in the chunk.

This means that a simple task like scanning sign lines ends up loading the contents of every container.

This API adds another method that takes a Predicate<Block>, to allow plugins to filter down by factors such as material, position, biome, etc. Due to the non-certain number of results here, some optimisations from the non-predicate version had to be omitted (pre-allocating array size).

@me4502 me4502 requested a review from a team as a code owner December 18, 2020 11:12
@me4502 me4502 requested a review from Proximyst December 18, 2020 12:57
Copy link
Copy Markdown
Contributor

@MrIvanPlays MrIvanPlays left a comment

Choose a reason for hiding this comment

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

minor diff stuff

Proximyst
Proximyst previously approved these changes Dec 18, 2020
Copy link
Copy Markdown
Contributor

@Proximyst Proximyst left a comment

Choose a reason for hiding this comment

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

LGTM! Imports are a non-issue. Best conflicts are import conflicts; no thinking involved 😁

Proximyst
Proximyst previously approved these changes Dec 19, 2020
Copy link
Copy Markdown
Contributor

@Proximyst Proximyst left a comment

Choose a reason for hiding this comment

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

Still LGTM! 😃

DenWav
DenWav previously approved these changes Dec 20, 2020
@Proximyst Proximyst dismissed stale reviews from DenWav and themself via f58bccc December 24, 2020 09:24
@Proximyst
Copy link
Copy Markdown
Contributor

@limbo-app ready

Copy link
Copy Markdown

@limbo-app limbo-app left a comment

Choose a reason for hiding this comment

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

Pull request automatically approved for merging - a core team member has previously approved this pull request.

@Proximyst Proximyst enabled auto-merge (rebase) December 24, 2020 09:26
@Proximyst Proximyst merged commit 0bdfb01 into PaperMC:master Dec 24, 2020
@me4502 me4502 deleted the feature/block-predicate-tes branch February 3, 2021 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants