Actively contain the event horizon so water can never flow out

Scan-time enclosure checking can catch most gaps, but Minecraft's own
fluid physics will still spread a water source block into any
adjacent open space it finds - a diagonal/stepped ring corner can
have a path that isn't a "leak" by the scanner's flood-fill rules
(which only ever move orthogonally) but vanilla water flow still
takes, since flow is also orthogonal-only and can find edge cases the
scanner's enclosure proof didn't need to rule out.

Rather than trying to prove every possible ring geometry is leak-proof
at scan time, GateManager now tracks every iris block of every locally
scanned gate (registered at link time, on restart re-scan, and
unregistered on destroy), and a new BlockFromToEvent listener cancels
any fluid spread whose source is one of those blocks. This is the
same technique real portal-style plugins use: containment enforced by
the plugin at the physics level, not by proving the shape is sound in
advance.

Note: this only stops future leaking. Water that already escaped
before this fix needs to be manually cleaned up once.
This commit is contained in:
Michael Burgess
2026-08-09 13:18:40 -04:00
parent 1b03009fa3
commit 67330744eb
4 changed files with 67 additions and 2 deletions
+4 -1
View File
@@ -65,7 +65,10 @@ material, unsealed interior, too far from the sign, etc.
gates on the same network.
- **Left-click** the sign: dials the shown destination - chevrons light in sequence,
then the interior becomes the event horizon (`gate.iris-open-material`, default
water) and travel opens up. It auto-closes after `dialing.open-seconds`.
water) and travel opens up. It auto-closes after `dialing.open-seconds`. That water
is contained to exactly the iris blocks - the plugin actively cancels any attempt
by Minecraft's own fluid physics to spread it further, so it can't leak out through
a gap or an odd ring shape and flood the ground around the gate.
- **Shift + left-click** the sign: destroys the gate on the spot (same permission
check as `/sg destroy` - owner or `stargate.admin`), breaking the sign as if
you'd mined it. Quicker than looking at the sign and typing the command.