[GH-ISSUE #5134] Native mods: fill, drain and read a block's fluids through a side #1565

Closed
opened 2026-11-02 15:48:02 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Qwerner88880 on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5134

Originally assigned to: @Qwerner88880 on GitHub.

🤖 Filed by Qwerner88880's AI agent (ZCode, GLM-5.3), not by Qwerner88880 personally.

Part of #4953's capabilities (the fluid handler on blocks comes after the item handler), of #3911 (Mods).

A native mod can put items into a block, read and take them through a side, and move them between blocks (#5130) — but nothing of the kind exists for fluids. A pipe or machine that fills a tank, drains a cauldron, or moves water and lava between blocks has to know every container's rules itself, and can't even read how full anything is.

What I plan — one hook point, the container one's mirror, and three helpers in the item handler's shape:

  • native_block_entity_fluids(block, fluids) [added after the claim: the container hook (API 17) is how a bundle declares its slots today, so tanks go the same way]: the tank count with each capacity in millibuckets, the tanks each face reaches, and which may be filled and drained. The tanks' state lives in the block entity's saved compound, so it survives restarts.
  • native_fluid_tanks(dimension, pos, face): the tank a block opens through that side — its fluid, amount and capacity in millibuckets — and whether that side may drain it. None for a block that holds no fluid there.
  • native_fluid_insert(dimension, pos, face, fluid, amount): fills up to amount millibuckets, answering what did not fit, as a hopper-style pipe would.
  • native_fluid_extract(dimension, pos, face, fluid, amount): drains up to amount millibuckets through that side, if the side allows draining.

Not in this: energy (it waits for a shared standard), mod fluid registration, flowing and rendering (a separate item in the tracking list), and the fluid handler on items (a bucket or bottle that fills and drains) — that follows the same claim if it fits, else its own issue.

Originally created by @Qwerner88880 on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5134 Originally assigned to: @Qwerner88880 on GitHub. > 🤖 Filed by Qwerner88880's AI agent (ZCode, GLM-5.3), not by Qwerner88880 personally. Part of #4953's capabilities (the fluid handler on blocks comes after the item handler), of #3911 (Mods). A native mod can put items into a block, read and take them through a side, and move them between blocks (#5130) — but nothing of the kind exists for fluids. A pipe or machine that fills a tank, drains a cauldron, or moves water and lava between blocks has to know every container's rules itself, and can't even read how full anything is. What I plan — one hook point, the container one's mirror, and three helpers in the item handler's shape: - **`native_block_entity_fluids(block, fluids)`** [added after the claim: the container hook (API 17) is how a bundle declares its slots today, so tanks go the same way]: the tank count with each capacity in millibuckets, the tanks each face reaches, and which may be filled and drained. The tanks' state lives in the block entity's saved compound, so it survives restarts. - **`native_fluid_tanks(dimension, pos, face)`:** the tank a block opens through that side — its fluid, amount and capacity in millibuckets — and whether that side may drain it. `None` for a block that holds no fluid there. - **`native_fluid_insert(dimension, pos, face, fluid, amount)`:** fills up to `amount` millibuckets, answering what did not fit, as a hopper-style pipe would. - **`native_fluid_extract(dimension, pos, face, fluid, amount)`:** drains up to `amount` millibuckets through that side, if the side allows draining. Not in this: energy (it waits for a shared standard), mod fluid registration, flowing and rendering (a separate item in the tracking list), and the fluid handler on items (a bucket or bottle that fills and drains) — that follows the same claim if it fits, else its own issue.
Author
Owner

@Qwerner88880 commented on GitHub (Oct 31, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6543603216 --> @Qwerner88880 commented on GitHub (Oct 31, 2026): 🤖 Agent: /claim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#1565
No description provided.