BlockPalette::liquid_block_count() returned the inverse of what it
should: the Homogeneous arm returned 0 when the section was liquid and
the full VOLUME (4096) when it was not, and the Heterogeneous arm summed
the counts of non-liquid blocks (filtering on !is_liquid).
Flip both arms to actually count liquid blocks, mirroring the correct
sibling non_air_block_count(): Homogeneous yields VOLUME when the single
block is liquid (0 otherwise) and Heterogeneous filters on is_liquid.
This value is sent to clients as the fluid count in chunk data
(MC 26.1+), so the inversion reported wrong fluid counts to players.
* starting implementing the advancement command
* implementing globally of the advancement command
* fixing lib.rs
* implementing the new Advancement argument and updating the AdvancementArgs lifetime
* updating wit by adding advancement as command arg
* cargo fmt
* fixing the advancement
hooking the saving
spawn blocking task for IO task
* fixing the update of load to be async
* adding await to load for a test
* fix when save is disable
* making save_enable check first
* fix conflict
* update hash
* fix wit change
* fix column_pos
* adding rust documentation
* typos fix
* removing example
* invalid advancement packet
* fix itemstack parsing to use ItemStack Template ones
* changing enum type from i32 to VarInt
* fix packet by switching up the frame type and flags
* fixing packet and loading of the advancement
* cargo clippy
* update wit
When a player right-clicks with a shield already in the off-hand,
`prepare_hand_item_for_use` locks the ItemStack Mutex via `held`,
then tries to lock the same Mutex again through `get_or_insert`.
Tokio's Mutex is not reentrant, causing a permanent deadlock that
crashes the server 5 seconds later when the tick loop times out.
Add `PlayerInventory::is_already_equipped()` which uses Arc::ptr_eq
to detect when the item is already in the target slot, and skip the
redundant equip logic before any lock is attempted.
Closes#2288
Adds a non-cancellable PlayerRespawnEvent fired from World::respawn_player
once a respawn destination (world, position, rotation) is determined,
exposing it to plugins through the WIT event API (host + guest). The
previous world, respawned world, position, yaw, pitch and whether the
player kept their data are provided. Bumps the pumpkin-plugin-wit
submodule to the matching event definition.
Closes#1714. Depends on Pumpkin-MC/pumpkin-plugin-wit#8.
* fix(attributes): Update modifier id to use string identifier instead of Uuid to prevent modifier duplication on client
* style: format enderman imports
* fix(entity): use vanilla enderman attacking modifier id
---------
Co-authored-by: Missing_Love <42416195+Q2297045667@users.noreply.github.com>
the const [&T; 29873]s for block(state) mapping were being inlined ~300 times just to be deduplicated by LLVM.
They are now statics but are accessed via const fns.
This improves compile times by roughly 12 minutes.
Snow placement checked is_side_solid (isSideSolidFullSquare / support
shape), which leaves override to be empty. Vanilla's SnowBlock#canPlaceAt
instead checks the snow_layer support tags and whether the block's
collision shape fully covers the top face — leaves have a full-cube
collision shape, so they should support snow layers.
Fixes#2218
* fix(entity): prevent duplicate items and drop animation replay on reconnect
When a player reconnects, spawn_world_entity_chunks unconditionally
created new entity instances from chunk NBT, even if those entities
already existed in the world (e.g. another player still tracking them).
This caused three bugs:
1. Drop animation replay: read_nbt_non_mut restores the original drop
velocity from NBT, so the client renders items as if they were just
dropped again.
2. Uncollectable ghost items: duplicate entities with different
entity_ids but the same UUID desync client and server state, making
items impossible to pick up.
3. Dupe glitch: the same chunk NBT entry spawns a second entity on
every reconnect, duplicating items in the world.
Fix by:
- Checking world.entities for existing entities with the same UUID
before creating new ones; if found, only send spawn packet for the
existing entity to the reconnecting player.
- Clearing velocity to zero after NBT restore so the spawn packet does
not carry stale drop velocity.
- Adding a UUID dedup guard in add_entity_silent as a second line of
defense.
* fix(item): restore NBTStorage for ItemEntity to fix ghost items after reconnect
Re-implement write_nbt/read_nbt_non_mut to persist and restore:
- Item compound (via write_item_stack/read_item_stack)
- Age, PickupDelay, Health
Add new_for_restore() constructor without random velocity.
Update EntityType::ITEM dispatch to use new_for_restore() instead of
ItemEntity::new() with AIR.
* fix(clippy): resolve doc-markdown and collapsible-if in ItemEntity
---------
Co-authored-by: Missing_Love <42416195+Q2297045667@users.noreply.github.com>