Reservoir
The Reservoir (BlockReservoir / TileReservoir) is a 4-block fluid storage multiblock that forms a 2×2 cube. It provides higher capacity than a single tank and has a built-in water regeneration system.
Core Blocks
- Block:
crazypants.enderio.machine.reservoir.BlockReservoir - Tile:
crazypants.enderio.machine.reservoir.TileReservoir - ModObject:
blockReservoir
Multiblock Formation
- Fixed 4-block 2×2 cube: Two rows of two blocks each.
- Automatic: Formed by
formMultiblock()when two non-multiblock reservoirs are placed orthogonally adjacent, and a fourth block exists to complete the 2×2. - Detection algorithm: For each
ForgeDirection, checks if the block in that direction AND the diagonal block are both non-multiblock reservoirs. If so, forms a 4-block multiblock. - Positions: Each tile is assigned a
Posenum (TL,TR,BL,BR) based on its orientation relative to the master. - Master: The block at position
multiblock[0](determined byisMaster()— the first block in themultiblockarray) is the controller.
Formation detection (example):
[dir=SOUTH, neighbor=EAST] → forms
[A][B]
[C][D]
Where A = placed block, B = inDirection(SOUTH), C = inDirection(EAST), D = diagonal
Formation Rules
- All four blocks must be
BlockReservoirinstances. - The four blocks must occupy a 2×2 square (not a line or L-shape).
- If any block is broken, the entire multiblock dissolves.
- Re-formation is attempted automatically via
onNeighborBlockChange(). - The reservoir does NOT require water to form — it works empty.
Fluid Storage
- Total capacity: 2,000 mB (2 buckets) — each block holds 500 mB.
- Regen tank: When the main tank is full and
regenTankis empty, a secondarySmartTankwith capacity 2,000 mB is created to simulate “condensing” of steam/lava back to water. This is purely visual/functional for the water cycle. - Accepted fluid: Only water (
FluidRegistry.WATER).doFill()returns 0 for any non-water fluid. - Auto-eject: If
autoEjectis enabled, the controller scans all 6 directions of all 4 multiblock blocks for adjacentIFluidHandlertanks and distributes fluid evenly to neighbors.
Energy / Data Flow
- No power consumption — purely passive fluid storage.
- IFluidHandler: Implements
fill(),drain(),canFill(),canDrain()— all routed through the master tile. - Auto-eject logic (
doUpdateTankNeighbours): Every 20 ticks whenautoEjectis true and tank has fluid, distributes fluid evenly to all adjacent fluid handlers. - Fluid level sync:
tankDirtyflag triggers block metadata update (render change).
Rendering
ReservoirRendererrenders the 2×2 structure with per-face water level visualization.- Each face has a different water level based on the
MbFaceenum and the tile’sPos. - Water render bounds are calculated from the full 4-block
AxisAlignedBB. - The block renders with
isOpaqueCube() = falseandrenderAsNormalBlock() = falsefor custom rendering.
Tank Neighbours
When autoEject is enabled, the reservoir tracks which adjacent blocks are IFluidHandler:
for each multiblock block coord:
for each ForgeDirection:
if adjacent block NOT in multiblock AND implements IFluidHandler:
add to tankNeighbours list
Fluid is then distributed round-robin to all neighbors.