* feat(plugin-api): add resolve-block-state and set-block-entity-nbt
* feat(plugin-api): implement get-block-entity-nbt
Serializes block entity at position to raw NBT bytes via
write_internal(). Returns None if no block entity exists.
* feat(plugin-api): implement block-state-to-info
---------
Co-authored-by: Jakub Palacky <kubik.palacky@gmail.com>
Item::CROSSBOW ships a ChargedProjectiles component by default, carrying an empty
projectile list (crates/pumpkin-data/src/generated/item.rs, the CROSSBOW components
table). normal_use tested only for the presence of that component, which is therefore
true for every crossbow including a freshly crafted one.
The result is that the first right-click on an uncharged crossbow takes the fire branch,
fire_projectiles iterates an empty list and does nothing, and charging never starts, so
the crossbow cannot be used at all until something else happens to write a non-empty
patch.
Vanilla gates on the list being present AND non-empty:
ChargedProjectiles chargedProjectiles = itemStack.get(DataComponents.CHARGED_PROJECTILES);
if (chargedProjectiles != null && !chargedProjectiles.isEmpty()) {
(CrossbowItem.java:67-68, 26.2.) Matching that here restores the charge-then-fire cycle.
Test plan:
- cargo fmt --all
- RUSTFLAGS="-D warnings" cargo clippy -p pumpkin --all-targets
`ProtoChunk::new` took its height from the noise settings while
`Chunk::build_level_sections` builds and reads back `dimension.height / 16`
sections. The End and the Nether are the two dimensions taller than their noise
settings (256 vs 128), so their proto chunks held 8 sections for the 16 the
level chunk asks for and `get_block_state_raw` indexed past the end of
`flat_block_map`, panicking on every generation thread. The same mismatch left
light data covering half the column and dropped features placed above y = 128.
A chunk spans its dimension, as in vanilla's `LevelHeightAccessor`; the noise
settings only bound the vertical window the generator writes into. `ProtoChunk`
now carries both, storage sized by the dimension plus a generation window built
with `GenerationShapeConfig::trim_height`, so surface rules, carver height
providers and feature placement keep resolving against y < 128 there.
The panic quoted in the issue (`chunk_density_function.rs`, len 99 index 129)
was the same conflation in `populate_noise` and is already fixed by 3c43f971.