Skip to content

Remove remaining duplication in fluid/power/factory blocks#38

Merged
CoderJoeW merged 4 commits intomainfrom
simplify/code-review-fixes
Mar 20, 2026
Merged

Remove remaining duplication in fluid/power/factory blocks#38
CoderJoeW merged 4 commits intomainfrom
simplify/code-review-fixes

Conversation

@CoderJoeW
Copy link
Copy Markdown
Owner

Summary

  • Use ADJACENT_FACES in PowerSplitter and FluidMerger instead of inline face lists
  • Extract updateFluidState() to FluidBlock base class, add propertyName to FluidType enum, and remove duplicate methods from FluidPipe, FluidMerger, FluidSplitter — FluidContainer reuses it inside updateProperties()
  • Extract MaterialFactory base class from CobblestoneFactory/ObsidianFactory with shared powerUpdate() and hasFluidAvailable() logic

Replace inline listOf(BlockFace.NORTH, ...) with the inherited
ADJACENT_FACES constant from AtlasBlock.
Add propertyName to FluidType enum and move the duplicated
updateFluidState() method into FluidBlock. FluidContainer reuses it
inside its own updateProperties() alongside fill_level.
CobblestoneFactory and ObsidianFactory had nearly identical
powerUpdate() and hasFluidAvailable() methods. Pull shared logic
into an abstract MaterialFactory with powerCost and outputMaterial
as the only varying properties.
@CoderJoeW CoderJoeW merged commit da820b3 into main Mar 20, 2026
3 checks passed
@CoderJoeW CoderJoeW deleted the simplify/code-review-fixes branch March 20, 2026 04:09
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