refactor: introduce FuelHelper interface for fuel value management#364
Merged
Indemnity83 merged 2 commits intoMay 9, 2026
Merged
Conversation
Contributor
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@common/src/main/java/com/logistics/core/lib/power/FuelHelper.java`:
- Around line 30-32: ServiceLoader.load(FuelHelper.class) in the
FuelHelper.INSTANCE initialization can throw IllegalStateException when no
provider is registered; add a service provider descriptor named
META-INF/services/com.logistics.core.lib.power.FuelHelper to your resources
containing the fully qualified class name of your FuelHelper implementation
(e.g., com.logistics.core.lib.power.DefaultFuelHelper), ensure that
implementation class is on the classpath, and verify the descriptor has the
exact FQN with no extra whitespace so ServiceLoader.findFirst() can discover the
provider for FuelHelper used by the INSTANCE field.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 1fa1ed0b-dff6-479e-85f9-a1c04265a6a6
📒 Files selected for processing (5)
common/src/main/java/com/logistics/core/lib/power/FuelHelper.javacommon/src/main/java/com/logistics/power/engine/block/entity/StirlingEngineBlockEntity.javacommon/src/main/java/com/logistics/power/engine/ui/StirlingEngineScreenHandler.javafabric/src/main/java/com/logistics/fabric/FabricFuelHelper.javaneoforge/src/main/java/com/logistics/neoforge/NeoForgeFuelHelper.java
Indemnity83
added a commit
that referenced
this pull request
May 9, 2026
Indemnity83
added a commit
that referenced
this pull request
May 9, 2026
This was referenced May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This update introduces a
FuelHelperinterface designed to standardize fuel value handling across different loaders, enriching the mod's compatibility and maintainability. By abstracting the fuel value logic, this change facilitates easier integration and extension of fuel-related functionality for future development, allowing developers to focus on building new features more efficiently.Changes
New FuelHelper Interface:
FuelHelperinterface that includes methods for validating fuel and retrieving burn durations.Loader-Specific Implementations:
FabricFuelHelperandNeoForgeFuelHelperclasses implementing theFuelHelperinterface for their respective environments.Updated Stirling Engine Logic:
StirlingEngineBlockEntityandStirlingEngineScreenHandlerto utilize theFuelHelperinterface methods instead of direct level calls, improving code clarity and flexibility.Notes