Merge pull request #2438 from RoyalPixelsDE/fix/end-crystals-at-generation
🤖 Agent: Gate check by Ludovic's AI agent (Claude). Checked against 26.3: `SpikeFeature` places the end crystals during decoration, so they are saved with the chunk that generates them, as here. Gate: this wave's 50 PRs merged on main in one tree (union 9033a9c3b): fmt and clippy `-D warnings` clean, the horizon-client (1136 lib plus the integration tests), horizon-client-core (37), horizon-world (165) and horizon-protocol (100) tests pass, the fast build links, and the 140 harnesses `parity.py` picks for the tree's changed files pass on playhorizon (remote_fireworks, a known load flake there, passed on a rerun on a quiet Mac mini). `lan_e2e.py` passes 14 checks with the host on its server thread and in-frame (chest, xp, damage, kills, projectiles, mobs, drops, body, stopsound, digging, instant_digging, books, knockback, barter); `hurt` fails on main too when run after `damage` (check-order dependency, not this wave). Thanks @FusselTV!
This commit is contained in:
@@ -873,6 +873,33 @@ impl PlacementContext for World<'_> {
|
||||
self.entities.push(nbt);
|
||||
Ok(())
|
||||
}
|
||||
/// SpikeFeature.placeSpike: the crystal is a fresh entity of the region,
|
||||
/// saved with the chunk.
|
||||
fn spawn_end_crystal(
|
||||
&mut self,
|
||||
position: [f64; 3],
|
||||
yaw: f32,
|
||||
beam_target: Option<[i32; 3]>,
|
||||
invulnerable: bool,
|
||||
) -> Result<(), PlacementQueryError> {
|
||||
use crate::nbt::Tag;
|
||||
let mut nbt = crate::nbt::Compound::new();
|
||||
nbt.insert("id".into(), Tag::String("minecraft:end_crystal".into()));
|
||||
nbt.insert(
|
||||
"Pos".into(),
|
||||
Tag::List(position.iter().map(|v| Tag::Double(v.to_bits())).collect()),
|
||||
);
|
||||
nbt.insert(
|
||||
"Rotation".into(),
|
||||
Tag::List(vec![Tag::Float(yaw.to_bits()), Tag::Float(0)]),
|
||||
);
|
||||
nbt.insert("Invulnerable".into(), Tag::Byte(i8::from(invulnerable)));
|
||||
nbt.insert("ShowBottom".into(), Tag::Byte(1));
|
||||
if let Some(b) = beam_target {
|
||||
nbt.insert("beam_target".into(), Tag::IntArray(b.to_vec()));
|
||||
}
|
||||
self.add_entity(nbt)
|
||||
}
|
||||
fn set_block_entity(
|
||||
&mut self,
|
||||
position: [i32; 3],
|
||||
|
||||
Reference in New Issue
Block a user