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
//! A lightning strike's surface, and **every game fact it is built on, in one
//! file** (spec-0092).
//!
//! Each number below is read from the pinned 1.21.11 game's own bytes —
//! `net.minecraft.world.entity.LightningBolt` and `Entity.thunderHit`,
//! disassembled with `javap` and named through Mojang's official 1.21.11
//! mappings — and the dedicated server's class is byte-identical to the
//! client's, so the facts are the server's. The emitter, the refusals and the
//! skill page read them from here: re-pinning the strike against a later game
//! is one diff in this file.
//!
//! The rules built on the facts — the reach box judged on cells, the refused
//! blocks — are **authored**, and they live with the check that states them
//! (`delvec`'s `compiler::lightning`).
/// The classes the facts below were read from (spec-0092 *Ground*). Named so a
/// re-pin knows what to re-read, and asserted by the test that lands the verb.
pub const READ_FROM: = ;
/// The vanilla entity a `lightning` effect summons.
pub const BOLT_ENTITY: &str = "minecraft:lightning_bolt";
/// How far the bolt reaches sideways, in blocks, on each horizontal axis
/// [cited — `LightningBolt.tick`, the `3.0` it inflates its position by].
pub const REACH_HORIZONTAL: i32 = 3;
/// How far the bolt reaches below its position, in blocks [cited — the same
/// `3.0`].
pub const REACH_BELOW: i32 = 3;
/// How far the bolt reaches above its position, in blocks [cited — `6.0 + 3.0`].
pub const REACH_ABOVE: i32 = 9;
/// Damage the bolt deals a body in reach, in HP [cited — `Entity.thunderHit`,
/// `hurtServer(…, lightningBolt(), 5.0F)`].
pub const DAMAGE_HP: u32 = 5;
/// Seconds a body in reach burns for [cited — `Entity.thunderHit`,
/// `igniteForSeconds(8.0F)`], at one HP a second while it burns.
pub const BURN_SECONDS: u32 = 8;
/// The worst a strike does to an unarmoured player in reach, in HP: the hit and
/// the whole burn. Under a full body's twenty.
/// The gamerule whose value decides whether a bolt lights fire [cited —
/// `LightningBolt.spawnFire` asks `ServerLevel.canSpreadFireAround`, which asks
/// whether a non-spectator player stands strictly closer than this radius].
/// Every delve seals it at `0`, and no distance is less than zero.
pub const FIRE_GAMERULE: &str = "fire_spread_radius_around_player";
/// **Whether the bolt rewrites the block it strikes** [cited —
/// `LightningBolt.powerLightningRod` and `clearCopperOnLightningStrike`]: a
/// lightning rod is powered, and a weathering or waxed copper block is scraped
/// back along a random walk through the copper beside it — a world write the
/// game rolls.
///
/// `block` is a block id with or without its state suffix. The copper family is
/// read by name: every weathering and waxed copper block of the pinned game
/// carries `copper` in its id. Copper ore and raw copper match the name too and
/// are refused with the family, which errs in the safe direction.