Skip to content

Add fluid block autoplace with a pluggable fluid cost and source API - #72

Open
ABKQPO wants to merge 9 commits into
masterfrom
fluid-block-autoplace
Open

Add fluid block autoplace with a pluggable fluid cost and source API#72
ABKQPO wants to merge 9 commits into
masterfrom
fluid-block-autoplace

Conversation

@ABKQPO

@ABKQPO ABKQPO commented Sep 11, 2026

Copy link
Copy Markdown
Member

Summary

Add fluid autoplace support for projectors

  • Add FluidPlacementRegistry for fluid costs and custom placement logic, with water and lava registered by default
  • Add fluid elements via ofFluidBlock / ofFluid; existing block-based structure definitions automatically become fluid elements when no item form exists
  • Add overflow protection so fluids are placed only after the structure can contain them
  • Charge only the missing fluid amount and restore the previous block if placement fails
  • Support fluid sources from player containers, registered FluidSourceProviders, and multiblock build environments
  • Add configuration for enabling fluid autoplace and gate strictness, including registry ordering/disabling
  • Maintain API compatibility with default methods and no removed or changed public signatures

Showcase

output.mp4

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

Water, lava and every Forge fluid block can now be placed by survival autoplace, paid for with fluid instead of with an item.

* Fluid costs are registered per block state, water and lava are registered by default, and a registration can ask for fluid even when the block also has an item form.
* A fluid is only placed once the rest of the structure is in place, so it cannot flow out of a half built multiblock, and only the fluid missing from a position is charged, so topping up a leak costs the difference instead of a whole bucket.
* The fluid comes from the player: their fluid containers, plus whatever mods contribute through the new fluid container extractor and fluid source provider registries.
* Existing structure definitions need no change, as ofBlock and the other block elements become fluid elements when the block has no item form.
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