Skip to content

Support fluid block placement in Schematicannon#10579

Open
SShakusora wants to merge 2 commits into
Creators-of-Create:mc1.21.1/devfrom
SShakusora:mc1.21.1/feature/Schematicannon-place-fluidblock
Open

Support fluid block placement in Schematicannon#10579
SShakusora wants to merge 2 commits into
Creators-of-Create:mc1.21.1/devfrom
SShakusora:mc1.21.1/feature/Schematicannon-place-fluidblock

Conversation

@SShakusora

Copy link
Copy Markdown

Description

This PR adds fluid placement support to the Schematicannon.

Source fluids in schematics are now tracked as fluid requirements instead of invalid blocks. The cannon can supply those requirements from adjacent fluid handlers, such as tanks, or from fluid-containing item containers. It then places fluids through NeoForge's FluidUtil.tryPlaceFluid, so vanilla and NeoForge placement rules still apply, including water vaporizing in dimensions where it cannot be placed.

Waterloggable blocks are handled as a block item plus a contained fluid requirement. If the fluid is provided, the block is placed and filled. If the new "skip missing fluids" option is enabled and the fluid is unavailable, the cannon can still place the dry block instead of blocking the entire build.

Free-standing source fluids are printed in a dedicated later pass, after normal and deferred structure blocks. This prevents the cannon from launching fluids before the surrounding structure exists, which helps with builds such as fluid containment and cobblestone generator schematics.

Changes

  • Adds fluid requirements to ItemRequirement and MaterialChecklist.
  • Splits schematic printing into separate passes for normal blocks, contained fluids, deferred blocks, free fluids, and entities.
  • Adds Schematicannon fluid resource lookup from adjacent IFluidHandlers and IFluidHandlerItem containers.
  • Supports partial draining from large or complex fluid containers while preserving the returned container.
  • Adds a skipMissingFluid Schematicannon option and UI/status text for missing or skipped fluids.
  • Adds fluid-aware clipboard checklist entries using Either<ItemStack, FluidStack> icons.
  • Adds fluid container resolution for Stock Keeper checklist requests.
  • Renders schematic preview fluids separately so fluid blocks are visible in client previews.
  • Adds GameTests covering fluid requirements, fluid placement, waterlogged blocks, complex containers, Nether vaporization, checklist tracking, and Stock Keeper fluid container resolution.

Notes

This is a continuation of the earlier draft PR:

The previous review raised a few specific concerns that this version addresses:

  • Fluids without bucket items can be supplied directly from fluid handlers.
  • Fluid item containers are drained through NeoForge capabilities instead of assuming a hardcoded bucket item.
  • Large or complex containers can be partially drained and returned with their remaining fluid.
  • Waterloggable blocks now have a fluid requirement and can fall back to a dry placement when missing-fluid skipping is enabled.
  • Fluid placement uses NeoForge placement rules, including dimension-specific vaporization behavior.
  • Free fluids are printed after the surrounding structure pass, rather than interleaved with normal blocks.

@VoidLeech VoidLeech added the pr type: feature PR adds a new feature or changes an existing feature label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr type: feature PR adds a new feature or changes an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants