Skip to content

Conversation

@ferriarnus
Copy link
Member

@ferriarnus ferriarnus commented Jan 8, 2026

Description

Currently, the capture of mobs is still blocked by the Boss tag even if they are in the whitelist. Also added a whitelist for the spawner to match.

TODO

  • review

Breaking Changes

List any breaking changes in this section, such as: changed/removed APIs, changed or removed items/blocks or modifications to recipes and gameplay mechanics.

Checklist

  • My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you).
  • I have made corresponding changes to the documentation.
  • My changes are ready for review from a contributor.

Summary by CodeRabbit

  • New Features

    • Spawners and soul vials now support explicit whitelist entries so permitted entity types bypass blacklist restrictions.
  • Bug Fixes

    • Whitelist precedence enforced to prevent allowed entity types being incorrectly blocked.
  • Refactor

    • Removed legacy boss-specific capture checks and simplified entity capture/tag decision flow.
  • Tests

    • Obsolete boss-check tests removed to reflect updated behaviour.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 8, 2026

Walkthrough

Adds a spawner whitelist tag and localization entry, updates powered spawner to prefer the whitelist over the blacklist when blocking spawns, and simplifies soul-vial capture checks by removing boss-specific helpers and giving whitelist precedence.

Changes

Cohort / File(s) Summary
Tag Declarations
enderio/src/main/java/com/enderio/enderio/foundation/tag/EIOTags.java, enderio/src/datagen/java/com/enderio/enderio/datagen/common/tags/EIOEntityTagsProvider.java
Introduced SPAWNER_WHITELIST TagKey and registered the tag in datagen; SPAWNER_BLACKLIST retains BOSSES entries.
Localization / Datagen
enderio/src/datagen/java/com/enderio/enderio/datagen/client/EIOLanguageProvider.java
Added translation entry for EIOTags.EntityTypes.SPAWNER_WHITELIST.
Spawner Logic
enderio/src/main/java/com/enderio/enderio/content/machines/powered_spawner/PoweredSpawnerBlockEntity.java
Replaced unconditional blacklist check with whitelist-aware logic: block spawn only when entity ∈ SPAWNER_BLACKLIST and not ∈ SPAWNER_WHITELIST (whitelist takes precedence).
Entity Capture Logic
enderio/src/main/java/com/enderio/enderio/foundation/util/EntityCaptureUtils.java
Removed BOSS status and isBlacklistedBoss(...) helpers; getCapturableStatus() now checks SOUL_VIAL_WHITELIST first, then SOUL_VIAL_BLACKLIST, else returns capturable; removed related imports.
Tests
enderio/src/test/java/com/enderio/enderio/tests/util/EntityCaptureUtilityTests.java
Removed tests and imports related to boss blacklist checks and the removed helper methods.

Sequence Diagram(s)

sequenceDiagram
  participant Spawner as PoweredSpawner
  participant Tags as EIOTags/TagLookup
  participant Decision as SpawnDecision

  Spawner->>Tags: query SPAWNER_WHITELIST for EntityType
  Tags-->>Spawner: yes / no
  Spawner->>Tags: query SPAWNER_BLACKLIST for EntityType
  Tags-->>Spawner: yes / no
  Spawner->>Decision: evaluate (blacklist && !whitelist)
  Decision-->>Spawner: allow spawn / block spawn (set DISABLED)
Loading
sequenceDiagram
  participant Caller as CaptureCheck
  participant Tags as EIOTags/TagLookup
  participant Result as CapturableStatus

  Caller->>Tags: is type in SOUL_VIAL_WHITELIST?
  Tags-->>Caller: yes / no
  alt whitelist
    Caller->>Result: return CAPTURABLE
  else not whitelist
    Caller->>Tags: is type in SOUL_VIAL_BLACKLIST?
    Tags-->>Caller: yes / no
    alt blacklisted
      Caller->>Result: return BLACKLISTED
    else
      Caller->>Result: return CAPTURABLE
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

Type-Enhancement, Area-Backend, MC-1.21.1

Poem

🐰 A quiet hop, a tag anew, whitelist tucked in gentle care,
I guide the spawner’s little heart to let the chosen sprites appear.
Boss edges trimmed, old helpers gone, capture checks now crisp and bright,
A rabbit’s nibble in the code — a tidy, moonlit night.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: introducing a whitelist tag for both mob capturing and spawning, which is the core objective of this pull request.
Description check ✅ Passed The description covers the main change and rationale but lacks detail on testing requirements and does not explicitly describe the breaking API change (removal of BOSS enum entry and helper methods).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
enderio/src/main/java/com/enderio/enderio/foundation/util/EntityCaptureUtils.java (1)

41-41: Remove the unused CapturableStatus.BOSS enum value and update its test.

The BOSS enum value at line 41 is no longer returned by the getCapturableStatus() method. The current implementation checks the SOUL_VIAL_BLACKLIST tag and returns BLACKLISTED for boss entities instead of BOSS. Additionally, the test testGetCapturableStatus_RejectBoss() in EntityCaptureUtilityTests.java:38 will fail because it expects BOSS to be returned for ENDER_DRAGON, but the implementation will now return BLACKLISTED instead.

Remove the unused enum value and either remove or update the associated test.

🤖 Fix all issues with AI agents
In
@enderio/src/main/java/com/enderio/enderio/foundation/util/EntityCaptureUtils.java:
- Around line 61-65: The whitelist check in EntityCaptureUtils currently returns
CapturableStatus.CAPTURABLE for types in EIOTags.EntityTypes.SOUL_VIAL_WHITELIST
before performing the serialization check; move or reorder the serialization
capability check to run first (i.e., verify the entity can be
serialized/deserialized using the existing serialization check logic) and only
then allow the whitelist to override other restrictions so that the method
returns CAPTURABLE for whitelisted types only if they pass serialization.
🧹 Nitpick comments (1)
enderio/src/datagen/java/com/enderio/enderio/datagen/common/tags/EIOEntityTagsProvider.java (1)

30-30: Consider multi-line formatting for consistency.

The logic correctly mirrors the SOUL_VIAL_BLACKLIST pattern. However, for consistency with the multi-line chaining style used for SOUL_VIAL_BLACKLIST (lines 23-26), you might format this similarly.

♻️ Optional formatting adjustment
-        this.tag(EIOTags.EntityTypes.SPAWNER_BLACKLIST).addTag(Tags.EntityTypes.BOSSES).add(EntityType.WARDEN);
+        this.tag(EIOTags.EntityTypes.SPAWNER_BLACKLIST)
+                .addTag(Tags.EntityTypes.BOSSES)
+                .add(EntityType.WARDEN);
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ff54f9e and ee96526.

⛔ Files ignored due to path filters (1)
  • enderio/src/generated/resources/data/enderio/tags/entity_type/soul_vial_blacklist.json is excluded by !**/generated/**
📒 Files selected for processing (2)
  • enderio/src/datagen/java/com/enderio/enderio/datagen/common/tags/EIOEntityTagsProvider.java
  • enderio/src/main/java/com/enderio/enderio/foundation/util/EntityCaptureUtils.java
🧰 Additional context used
🧬 Code graph analysis (2)
enderio/src/datagen/java/com/enderio/enderio/datagen/common/tags/EIOEntityTagsProvider.java (1)
enderio/src/main/java/com/enderio/enderio/foundation/tag/EIOTags.java (2)
  • EntityTypes (191-202)
  • EIOTags (21-203)
enderio/src/main/java/com/enderio/enderio/foundation/util/EntityCaptureUtils.java (1)
enderio/src/main/java/com/enderio/enderio/foundation/tag/EIOTags.java (2)
  • EIOTags (21-203)
  • EntityTypes (191-202)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Run Tests
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (2)
enderio/src/datagen/java/com/enderio/enderio/datagen/common/tags/EIOEntityTagsProvider.java (2)

32-32: LGTM! Whitelist follows established pattern.

The new SPAWNER_WHITELIST tag correctly mirrors the approach used for SOUL_VIAL_WHITELIST, providing an empty tag that users or modpacks can populate to override the blacklist. This completes the whitelist/blacklist pair for spawners as described in the PR objectives.


23-26: Logic is sound for blacklist-with-whitelist-override pattern.

Adding the BOSSES tag to the blacklist aligns with the PR's goal of establishing a default deny-list that can be overridden by the whitelist (as implemented in EntityCaptureUtils). The explicit inclusion of WARDEN is defensive programming to ensure it's always blacklisted regardless of tag membership.

Tags.EntityTypes.BOSSES is a valid NeoForge tag, properly imported from net.neoforged.neoforge.common.Tags and consistently used across the codebase including production code (AttractorObeliskBlockEntity) and test code (EntityCaptureUtilityTests).

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
enderio/src/main/java/com/enderio/enderio/foundation/util/EntityCaptureUtils.java (1)

24-37: Dragon filtering at line 32 contradicts whitelist precedence.

The ender dragon is unconditionally filtered out at line 32, which contradicts the documented behaviour in getCapturableStatus() (lines 64–65) that states "Whitelist takes precedence over all". If the dragon is added to SOUL_VIAL_WHITELIST, getCapturableStatus() will return CAPTURABLE (line 67), but getCapturableEntityTypes() will still exclude it. Either the whitelist check should override dragon filtering, or the whitelist comment should be updated to clarify that the ender dragon is a special case.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1274665 and f192ac8.

📒 Files selected for processing (2)
  • enderio/src/main/java/com/enderio/enderio/foundation/util/EntityCaptureUtils.java
  • enderio/src/test/java/com/enderio/enderio/tests/util/EntityCaptureUtilityTests.java
💤 Files with no reviewable changes (1)
  • enderio/src/test/java/com/enderio/enderio/tests/util/EntityCaptureUtilityTests.java
🧰 Additional context used
🧬 Code graph analysis (1)
enderio/src/main/java/com/enderio/enderio/foundation/util/EntityCaptureUtils.java (1)
enderio/src/main/java/com/enderio/enderio/foundation/tag/EIOTags.java (2)
  • EIOTags (21-203)
  • EntityTypes (191-202)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Run Tests
🔇 Additional comments (2)
enderio/src/main/java/com/enderio/enderio/foundation/util/EntityCaptureUtils.java (2)

39-53: Enum simplification is safe and approved.

The streamlined CapturableStatus enum now focuses on three clear states (CAPTURABLE, BLACKLISTED, INCOMPATIBLE), which improves code clarity. The removal of the BOSS enum value and related helpers does not break any existing references—no usage of CapturableStatus.BOSS or isBlacklistedBoss exists elsewhere in the codebase.


59-75: Whitelist precedence logic correctly implements the PR objective.

The updated control flow properly prioritises the whitelist over all other checks, allowing previously restricted mobs (such as bosses) to be captured when explicitly whitelisted. The comments clearly explain this design decision.

The removal of the public helper methods isBlacklistedBoss(Entity) and isBlacklistedBoss(EntityType<?>) is safe; no references to these methods exist elsewhere in the codebase.

@Rover656
Copy link
Member

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)

enderio/src/main/java/com/enderio/enderio/foundation/util/EntityCaptureUtils.java (1)> 24-37: Dragon filtering at line 32 contradicts whitelist precedence.

The ender dragon is unconditionally filtered out at line 32, which contradicts the documented behaviour in getCapturableStatus() (lines 64–65) that states "Whitelist takes precedence over all". If the dragon is added to SOUL_VIAL_WHITELIST, getCapturableStatus() will return CAPTURABLE (line 67), but getCapturableEntityTypes() will still exclude it. Either the whitelist check should override dragon filtering, or the whitelist comment should be updated to clarify that the ender dragon is a special case.

📜 Review details

getCapturableStatus needs updating to match the logic changes you've made.

don't allow the ender dragon
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@enderio/src/main/java/com/enderio/enderio/foundation/util/EntityCaptureUtils.java`:
- Around line 64-73: The comment claims the whitelist "takes precedence over
all" but the code blacklists EntityType.ENDER_DRAGON before checking
EIOTags.EntityTypes.SOUL_VIAL_WHITELIST; to fix, move the Ender Dragon check
(the block returning CapturableStatus.BLACKLISTED for EntityType.ENDER_DRAGON)
so it runs after the whitelist check in EntityCaptureUtils, ensuring the
whitelist (EIOTags.EntityTypes.SOUL_VIAL_WHITELIST) can override the dragon
exception and keep the surrounding comment accurate.

Copy link
Member

@Rover656 Rover656 left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@Rover656 Rover656 merged commit 9d8f678 into Team-EnderIO:1.21.1 Jan 29, 2026
5 checks passed
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.

2 participants