Skip to content

Minecraft: Java Edition 26.3 rewritten from scratch in Rust, checked against vanilla with 281 differential harnesses. Get it with the Horizon launcher.

Wind bursts push firework rockets and thrown tridents

HrafnaValkyrjad3c7a961e83e
diff --git a/crates/horizon-client/src/game/remote_projectiles.rs b/crates/horizon-client/src/game/remote_projectiles.rs
index d55e52bd4..821e76ebd 100644
--- a/crates/horizon-client/src/game/remote_projectiles.rs
+++ b/crates/horizon-client/src/game/remote_projectiles.rs
@@ -795,7 +795,10 @@ impl Game<'_> {
out.push(json!({"id": c.id, "kind": "minecraft:end_crystal", "position": at(c.position), "show_bottom": c.show_bottom}));
}
for t in &self.tridents {
- out.push(json!({"id": t.id, "kind": "minecraft:trident", "position": at(t.position)}));
+ out.push(json!({"id": t.id, "kind": "minecraft:trident", "position": at(t.position), "velocity": at(t.velocity)}));
+ }
+ for r in &self.rockets {
+ out.push(json!({"id": r.id, "kind": "minecraft:firework_rocket", "position": at(r.position), "velocity": at(r.velocity)}));
}
for p in &self.creatures.projectiles {
out.push(json!({"id": p.id, "kind": format!("{:?}", p.kind).split([' ', '{']).next().unwrap_or(""), "position": at(p.position), "velocity": at(p.velocity),
diff --git a/crates/horizon-client/src/game/wind.rs b/crates/horizon-client/src/game/wind.rs
index e2d6a882b..5d9b968db 100644
--- a/crates/horizon-client/src/game/wind.rs
+++ b/crates/horizon-client/src/game/wind.rs
@@ -426,6 +426,35 @@ impl Game<'_> {
);
}
self.falling = falling;
+ // Firework rockets (0.25 wide, eyes at 0.85 of it), tridents in flight
+ // (0.5 wide, eyes at 0.13; like any arrow not pushed in the ground)
+ // take `Entity.pushFromExplosion` alike.
+ let mut rockets = std::mem::take(&mut self.rockets);
+ for r in &mut rockets {
+ let p = r.position;
+ push_box(
+ self,
+ p,
+ [p.x - 0.125, p.y, p.z - 0.125],
+ [p.x + 0.125, p.y + 0.25, p.z + 0.125],
+ 0.2125,
+ &mut r.velocity,
+ );
+ }
+ self.rockets = rockets;
+ let mut tridents = std::mem::take(&mut self.tridents);
+ for t in tridents.iter_mut().filter(|t| !t.in_ground) {
+ let p = t.position;
+ push_box(
+ self,
+ p,
+ [p.x - 0.25, p.y, p.z - 0.25],
+ [p.x + 0.25, p.y + 0.5, p.z + 0.25],
+ f64::from(0.13_f32),
+ &mut t.velocity,
+ );
+ }
+ self.tridents = tridents;
// VehicleEntity.ignoreExplosion: a mob's burst (a breeze's) leaves
// boats and minecarts alone with mob griefing off.
if !(breeze && !self.ui.rules.bool("mob_griefing")) {
diff --git a/tools/lan_e2e.py b/tools/lan_e2e.py
index 172bff678..5da414bae 100755
--- a/tools/lan_e2e.py
+++ b/tools/lan_e2e.py
@@ -11638,6 +11638,54 @@ def check_blast_bystanders(host, guest, out):
CHECKS += ['blast-bystanders']
CHECK_FNS['blast-bystanders'] = check_blast_bystanders
+def check_wind_remaining(host, guest, out):
+ """A wind burst pushes a firework rocket and a thrown trident (ServerExplosion.hurtEntities ->
+ Entity.pushFromExplosion; neither overrides ignoreExplosion). Real 26.3 server, wind charge into the floor,
+ tick freeze, tick step 1 after the burst: the rocket's Motion x -0.3174, -0.3650, -0.4197 and y 0.5971, 0.6371,
+ 0.6771 on the next three ticks (it starts at (0, 0.08, 0), 0.8 west of the burst, 1.0 above the floor); a
+ trident 0.8 east gets (+0.446, +0.490) on the first tick when NoGravity holds. A summoned trident here
+ ignores NoGravity and falls first, so only its direction is asserted."""
+ hx, hy, hz = (int(v // 1) for v in pos_of(host))
+ x, y, z = hx + 6, hy, hz
+ host('command', command='gamemode spectator')
+
+ def read():
+ found = {}
+ for p in host.raw('simulation')['projectiles']:
+ if p['kind'] in ('minecraft:trident', 'minecraft:firework_rocket') and abs(p['position'][0] - x) < 4:
+ found[p['kind'].split(':')[1]] = p['velocity']
+ return found
+ detail = {}
+ try:
+ host('command', command='tick unfreeze')
+ for c in (f'fill {x - 8} {y - 1} {z - 8} {x + 8} {y - 1} {z + 8} minecraft:bedrock',
+ f'fill {x - 8} {y} {z - 8} {x + 8} {y + 5} {z + 8} minecraft:air', 'kill @e[type=!player]', 'tick freeze',
+ f'summon minecraft:trident {x + 1.3} {y + 1.0} {z + 0.5} {{NoGravity:1b}}',
+ f'summon minecraft:firework_rocket {x - 0.3} {y + 1.0} {z + 0.5} {{LifeTime:200}}', 'tick step 2'):
+ host('command', command=c)
+ host.wait(8)
+ detail['before'] = read()
+ host('command', command=f'summon minecraft:wind_charge {x + 0.5} {y + 0.6} {z + 0.5} {{Motion:[0.0,-1.0,0.0]}}')
+ detail['ticks'] = []
+ for _ in range(3):
+ host('command', command='tick step 1')
+ host.wait(4)
+ detail['ticks'].append(read())
+ finally:
+ host('command', command='tick unfreeze')
+ host('command', command='kill @e[type=!player]')
+ host('command', command='gamemode creative')
+ first = detail['ticks'][0]
+ assert 'firework_rocket' in first and 'trident' in first, f'no rocket listed: {detail}'
+ rocket = first['firework_rocket']
+ assert abs(rocket[0] + 0.3174) < 0.01 and abs(rocket[1] - 0.5971) < 0.01, f'the rocket was not pushed like vanilla: {detail}'
+ trident = first['trident']
+ assert trident[0] > 0.2 and trident[1] > 0.1, f'the trident was not pushed away: {detail}'
+ return detail
+
+
+CHECKS += ['wind-remaining']
+CHECK_FNS['wind-remaining'] = check_wind_remaining
def check_selector_tags(host, guest, out):