Skip to content

Add Configurable EntityContainer instead of always using basic#66

Merged
Tofaa2 merged 1 commit into
Tofaa2:masterfrom
Chubbyduck1:master
May 23, 2026
Merged

Add Configurable EntityContainer instead of always using basic#66
Tofaa2 merged 1 commit into
Tofaa2:masterfrom
Chubbyduck1:master

Conversation

@Chubbyduck1
Copy link
Copy Markdown
Contributor

@Chubbyduck1 Chubbyduck1 commented May 23, 2026

The AbstractEntityLibAPI would constantly use the basic implementation of the EntityContainer. This PR allows developers to specify another one, and track entities themselves.

If a custom EntityContainer is not provided, it'll simply default to the basic implementation, keeping backwards compatibility.

Summary by CodeRabbit

  • New Features
    • APIConfig now supports EntityContainer configuration, enabling customization of entity handling with automatic fallback to default settings.

Review Change Stack

…ls back to `EntityContainer#basic()` if unspecified
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 376ab44c-53b8-4189-b971-62c6329b8ec5

📥 Commits

Reviewing files that changed from the base of the PR and between 2d9d7cb and 26ed0ab.

📒 Files selected for processing (2)
  • api/src/main/java/me/tofaa/entitylib/APIConfig.java
  • common/src/main/java/me/tofaa/entitylib/common/AbstractEntityLibAPI.java

📝 Walkthrough

Walkthrough

APIConfig gains EntityContainer configuration support through a new private field, fluent setter method, and nullable getter. AbstractEntityLibAPI's constructor now retrieves the configured container from APIConfig settings and falls back to a basic container when none is provided.

Changes

EntityContainer Configuration and Initialization

Layer / File(s) Summary
APIConfig container configuration
api/src/main/java/me/tofaa/entitylib/APIConfig.java
APIConfig adds a new entityContainer field with a fluent setter method returning the config instance for chaining, a @Nullable getter to retrieve the configured container, and the required imports for EntityContainer and @Nullable.
AbstractEntityLibAPI constructor initialization
common/src/main/java/me/tofaa/entitylib/common/AbstractEntityLibAPI.java
The defaultEntityContainer field is moved from field-level initialization to the constructor, where it checks settings.getEntityContainer() and falls back to EntityContainer.basic() when no container is configured.

🎯 2 (Simple) | ⏱️ ~8 minutes

🐰 A config-driven container leaps,
Where defaults and settings align,
Null-safe and fluent, the API now keeps
Its entity container just fine! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a configurable EntityContainer with a fallback to the basic implementation instead of always using basic.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@Tofaa2 Tofaa2 merged commit b7541c2 into Tofaa2:master May 23, 2026
2 of 3 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