Skip to content

feat(api): extend typed block lookups and add entity lookup - #995

Open
strobil wants to merge 5 commits into
PlayPro:masterfrom
Vanilla-Game:codex/typed-block-material-filters
Open

strobil wants to merge 5 commits into
PlayPro:masterfrom
Vanilla-Game:codex/typed-block-material-filters

Conversation

@strobil

@strobil strobil commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The existing blockLookup(Block, LookupOptions) only searches at a specific block. This PR adds blockLookup(LookupOptions) for searches within a radius, across a world, or across all worlds. The new overload returns block breaks, placements, and interactions; entity events are handled separately by entityLookup. Both block overloads share the same lookup implementation.

It also adds:

  • Material inclusion/exclusion for typed block lookups, including legacy stone variants.
  • LookupOptions.world(World) for whole-world searches in spatial typed lookups.
  • entityLookup(LookupOptions) returning EntityResult, with entityActions(List<EntityAction>), includeEntities(List<EntityType>), and excludeEntities(List<EntityType>) filters.

Entity lookups return spawn and kill events. Spawn events match either their original or persisted current/final location; results retain the original event coordinates.

Compatibility

Empty or omitted filters preserve each lookup’s default results. Material inclusion returns only matching block events; material exclusion leaves entity events unchanged in the existing block overload.

The last call to world, location, or radius determines the search area. Omitting all three searches across all worlds. The existing blockLookup(Block, LookupOptions) still uses the supplied block’s coordinates.

The existing blockLookup(Block, LookupOptions) retains entity events when no action or material-inclusion filter excludes them. Command and legacy lookups are unchanged.

Approach

@Intelli, now that there’s a dedicated entityLookup, would you be okay with the new blockLookup(LookupOptions) returning only block events, while keeping the existing overload unchanged for compatibility? Or would you prefer both block overloads to keep returning entity events too?

@strobil
strobil marked this pull request as ready for review September 15, 2026 10:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-15T12:13:33.344204Z d4aee7f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 817ded89bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main/java/net/coreprotect/api/BlockAPI.java
@strobil
strobil marked this pull request as draft September 15, 2026 11:13
@strobil strobil changed the title feat(api): extend typed block lookup filters and scope feat(api): extend typed block lookups and add entity lookup Sep 15, 2026
@strobil

strobil commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: d4aee7f1ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@strobil
strobil marked this pull request as ready for review September 15, 2026 12:10
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.

1 participant