-
Notifications
You must be signed in to change notification settings - Fork 15
Temperature Data System
This page explains how temperature-related data is defined, stored, and encoded for blocks, fluids, and biomes in the mod.
Each type of data (temperature, conduction, and resilience) is stored in a datapack under the following paths:
| Data Type | Registry | Path |
|---|---|---|
| Block Temperature | Registries.BLOCK | data/crowns/float_map/blocks/temperatures.json |
| Block Conduction | Registries.BLOCK | data/crowns/float_map/blocks/conduction.json |
| Block Resilience | Registries.BLOCK | data/crowns/float_map/blocks/resilience.json |
| Fluid Temperature | Registries.FLUID | data/crowns/float_map/fluids/temperatures.json |
| Fluid Conduction | Registries.FLUID | data/crowns/float_map/fluids/conduction.json |
| Fluid Resilience | Registries.FLUID | data/crowns/float_map/fluids/resilience.json |
| Biome Temperature | Registries.BIOME | data/crowns/float_map/biomes/temperatures.json |
- Precision: 1/255 β 0.39%
- Storage: 1 byte per voxel, 4 KB per section
The three layers work together in the implicit solver each tick:
- Conduction determines how strongly a voxel is coupled to its neighbours (off-diagonal matrix entries).
- Resilience determines how strongly a voxel is pulled toward its default temperature (diagonal contribution + RHS source term).
-
Temperature holds the current state (
T_current) going in and the computed state (T_next) coming out.
See Temperature Computation for how these are assembled into the linear system.
Last updated: June 2026 β Author: Real Ant Engineer
# Temperature Data SystemThis page explains how temperature-related data is defined, stored, and encoded for blocks, fluids, and biomes in the mod.
Each type of data (temperature, conduction, and resilience) is stored in a datapack under the following paths:
| Data Type | Registry | Path |
|---|---|---|
| Block Temperature | Registries.BLOCK |
data/crowns/float_map/blocks/temperatures.json |
| Block Conduction | Registries.BLOCK |
data/crowns/float_map/blocks/conduction.json |
| Block Resilience | Registries.BLOCK |
data/crowns/float_map/blocks/resilience.json |
| Fluid Temperature | Registries.FLUID |
data/crowns/float_map/fluids/temperatures.json |
| Fluid Conduction | Registries.FLUID |
data/crowns/float_map/fluids/conduction.json |
| Fluid Resilience | Registries.FLUID |
data/crowns/float_map/fluids/resilience.json |
| Biome Temperature | Registries.BIOME |
data/crowns/float_map/biomes/temperatures.json |
All of these are handled by instances of the FloatMap Data Loader from the Formic API.
{
"replace": false,
"values": {
"#minecraft:stone_ore_replaceables": 295.15,
"minecraft:lava": 4000.0,
"minecraft:water": 293.15
}
}Explanation:
-
#before a name means it's a tag reference. - Plain names are direct registry entries.
- The
"replace"field determines whether to overwrite or merge with existing datapack values.
Each file follows this same format for temperatures, conduction, and resilience.
Each chunk section (16Γ16Γ16 blocks) stores local physical values for temperature, conduction, and resilience. Each value type uses a dedicated data layer class that extends AbstractDataLayer.
All layers share the same 3D indexing scheme:
index = x + z * 16 + y * 256
Valid coordinates are 0β15 on each axis. The total size of each layer is 4096 values (16Β³).
| Layer | Stored type | Bytes/voxel | Precision | Value range | Purpose |
|---|---|---|---|---|---|
TemperatureDataLayer |
short |
2 | 0.1 K | 0 β ~6553 K | Absolute temperature |
ConductionDataLayer |
custom 8-bit mini-float | 1 | ~10β15% | 2β»ΒΉβΆ β 1.75Γ2β΄β· | Thermal conductivity |
ResilienceDataLayer |
byte |
1 | 1/255 β 0.4% | 0.0 β 1.0 | Temperature stability factor |
Stores temperature per voxel in Kelvin. This data is read and written each tick by the temperature computation system.
When determining the initial temperature of a position, the system checks in the following order:
- Fluids β if the block contains or is submerged in one
- Blocks β if no fluid temperature is available
- Biome β as a fallback background temperature
Temperatures are stored as 16-bit signed shorts, using a fixed-point representation with 1 decimal place of precision.
| Operation | Formula |
|---|---|
| Encoding | stored = (short)(temperature * 10 + Short.MIN_VALUE) |
| Decoding | temperature = (stored - Short.MIN_VALUE) / 10.0 |
- Precision: 0.1 K
-
Range: 0 K to
(Short.MAX_VALUE - Short.MIN_VALUE) / 10β 6553 K - Storage: 2 bytes per voxel, 8 KB per section
Note:
TemperatureDataLayermaintains afloat[]values array in memory for fast access. Thedecode()andencode()methods are bypassed in favour of direct array reads/writes viagetDirect()andsetDirect().
Stores the thermal conductivity per voxel, controlling how fast heat diffuses between neighbours. It uses a custom 8-bit mini-float format to cover a very wide range of physically meaningful values in a single byte.
Bit layout: [E E E E E E M M]
| |
6-bit exp 2-bit mantissa
-
Mantissa (bits 0β1): encodes values
1.0,1.25,1.5,1.75(i.e.1 + mantissa/4) - Exponent (bits 2β7): stored with a bias of 16, giving an effective range of β16 to +47
| Operation | Formula |
|---|---|
| Decoding | value = (1 + mantissa / 4.0) * 2^(exponent - 16) |
| Encoding | Compute floor(log2(value)), clamp exponent, round mantissa |
-
Range:
2β»ΒΉβΆ(β 1.5Γ10β»β΅) to1.75 Γ 2β΄β·(β 2.4Γ10ΒΉβ΄) - Precision: ~10β15% relative error (logarithmic spacing)
- Storage: 1 byte per voxel, 4 KB per section
A decoded float[] cache is maintained in memory so that repeated reads during the solver's inner loop don't re-execute the bit arithmetic every time.
Stores a resilience factor in the range [0, 1], representing how strongly a voxel resists diffusion and returns to its default temperature each tick.
-
0.0β the voxel diffuses freely with no pull toward a default -
0.5β moderate stabilisation -
1.0β the voxel is fully locked to its default temperature (used for strong heat sources/sinks)
In the solver, resilience appears in both the diagonal of matrix A and the source vector b, acting as a per-voxel spring constant pulling temperature toward T_default.
Stored as a signed byte, linearly mapped to [0, 1].
| Operation | Formula |
|---|---|
| Encoding | stored = (byte)(round(resilience * 255) - 128) |
| Decoding | resilience = (stored + 128) / 255.0 |
- Precision: 1/255 β 0.39%
- Storage: 1 byte per voxel, 4 KB per section
The three layers work together in the implicit solver each tick:
- Conduction determines how strongly a voxel is coupled to its neighbours (off-diagonal matrix entries).
- Resilience determines how strongly a voxel is pulled toward its default temperature (diagonal contribution + RHS source term).
-
Temperature holds the current state (
T_current) going in and the computed state (T_next) coming out.
See Temperature Computation for how these are assembled into the linear system.
Last updated: June 2026 β Author: Real Ant Engineer