1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
//! **What a cell of a piece does when there is fluid beside it.**
//!
//! A body of fluid is the one thing an author places that does not stay placed.
//! Every other block is where it was written; water and lava run — down first,
//! then sideways — until something holds them, and they run on the server's own
//! clock, before any player arrives. So a piece carrying a pond, a channel or a
//! flooded cellar is asserting something about the cells around it, and nothing
//! upstream of the server had been checking that assertion.
//!
//! Three facts decide it. All three are block knowledge rather than grid
//! knowledge, which is why they live here beside the registry every emitter and
//! auditor already depends on — and all three were **measured on the pinned
//! 1.21.11 server** (`tools/spike-block-settling/`, its `observations.json`),
//! because two of them are the opposite of what this module was first written
//! with:
//!
//! - **A fluid block runs.** `minecraft:water` / `minecraft:lava` in a cell
//! spreads into any open cell beside or below it — measured: a source with
//! one open neighbour and no other way out put 8 flowing cells into it, and
//! the same source in a sealed box stayed 1 source, 0 flowing.
//! - **A block written `waterlogged=true` does NOT run.** It holds its water,
//! spreads nothing, and stays waterlogged — measured beside an open cell, and
//! again after a block update was forced next to it (the update schedules a
//! fluid tick, so "it has not moved yet" and "it will not move" are different
//! claims and this rig tells them apart). It is fluid the author placed, and
//! it is not a body that leaks.
//! - **A block written `waterlogged=false` is a WALL.** Spreading water does not
//! fill it. Measured five ways — a grate and a stair in a wall, a stair turned
//! so its open face meets the water, a stair with a source on each side, and a
//! source directly above one — and every rig left the block dry and the water
//! where it was put. The plausible-sounding opposite ("a grate is a hole,
//! because iron bars are waterloggable") is a claim about *placing* water in
//! that cell, not about a body beside it.
//!
//! So the rule is short: **a fluid block must be a source, and must have
//! something — anything — in each of the five cells it would run into.**
//!
//! # The documented residue
//!
//! Any written non-fluid block is read here as holding fluid. Vanilla is
//! stricter in one direction this cannot see: it also flows into, and destroys,
//! blocks that do not block movement — a torch, a carpet, a plant. Separating
//! those from stone needs collision shapes, which are not in the pinned data
//! tables this repo derives from. That is the honest under-approximation: this
//! rule can miss such a leak and cannot invent one.
use BTreeMap;
/// A body of fluid in a piece is not still, or not where it was authored.
pub const DW_FLUID_ESCAPES: &str = "DW0800";
/// Minecraft's two fluids, as this module's callers spell them. The membership
/// question is [`delvewright_dsl::blockshape::is_fluid`]; this is the list a
/// diagnostic prints.
pub const FLUIDS: = ;
/// How wet one cell is.
/// True when this id is one of the game's fluid blocks.
///
/// **Not decided here** (spec-0056). This module and `delvec` each used to carry
/// a fluid list, tied together by a cross-crate test whose own header said the
/// duplication was unavoidable because `delvec` may not depend on this crate.
/// That premise was true and is no longer the whole truth: both already depend on
/// `delvewright-dsl`, which is where the block-shape table now lives, so the two
/// lists collapse into one and the test tying them becomes a check that the
/// delegation is real.
/// True for the three air blocks — the cells a fluid runs into. Also the
/// block-shape authority's, for the same reason.
/// True for the one block that means "whatever was already here": a cell the
/// piece deliberately does not decide, so nothing about it can be judged.
/// How wet a written block is.
/// **True when this block would hold a fluid back.**
///
/// Everything does except air and fluid itself — including a block written
/// `waterlogged=false`, which is the measured fact this rule turns on, and a
/// block written `waterlogged=true`, which is already full and spreads nothing.