Skip to content

Refactor item validation in ReactorInputInventory to use CNTags for better maintainability#63

Merged
MathisGredt merged 1 commit intomainfrom
change-hardcoded-item-to-Tags
Sep 21, 2025
Merged

Refactor item validation in ReactorInputInventory to use CNTags for better maintainability#63
MathisGredt merged 1 commit intomainfrom
change-hardcoded-item-to-Tags

Conversation

@Giovanniricotta2002
Copy link
Member

This pull request refactors the codebase to replace hardcoded item checks with tag-based checks, improving flexibility and maintainability. Additionally, wildcard imports were introduced in one file. The most important changes are summarized below:

Refactoring to use tag-based item checks:

  • Updated calculateHeat in ReactorControllerBlockEntity to replace hardcoded item ID checks ("createnuclear:uranium_rod" and "createnuclear:graphite_rod") with checks using CNTags.CNItemTags.FUEL.tag and CNTags.CNItemTags.COOLER.tag. This change applies to both the main loop and proximity heat calculations. [1] [2]
  • Modified isItemValid in ReactorInputInventory to use CNTags.CNItemTags.FUEL.matches and CNTags.CNItemTags.COOLER.matches instead of directly comparing items to CNItems.URANIUM_ROD and CNItems.GRAPHITE_ROD.

Import changes:

  • Replaced specific imports with a wildcard import (import net.nuclearteam.createnuclear.*) in ReactorControllerBlockEntity. This reduces verbosity but may introduce unnecessary imports.
  • Added the CNTags import in ReactorInputInventory to support the tag-based checks.

@MathisGredt MathisGredt merged commit 4a6e8dc into main Sep 21, 2025
@Giovanniricotta2002 Giovanniricotta2002 deleted the change-hardcoded-item-to-Tags branch September 30, 2025 17:37
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