mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
fix: send correct block state ID when cancelling interact event (#2405)
The cancelled handler in handle_use_item_on sent block.id (BlockId) instead of the actual BlockStateId, causing clients to see wrong block states (e.g. stone appearing as snow) when plugins cancel PlayerInteractEvent on right-click.
This commit is contained in:
@@ -2282,9 +2282,10 @@ impl JavaClient {
|
||||
server;
|
||||
event;
|
||||
'cancelled: {
|
||||
let state_id = world.get_block_state_id(&position);
|
||||
self.enqueue_packet(&CBlockUpdate::new(
|
||||
position,
|
||||
VarInt(block.id.as_u16() as i32),
|
||||
VarInt(i32::from(state_id.as_u16())),
|
||||
))
|
||||
.await;
|
||||
return Ok(());
|
||||
|
||||
Reference in New Issue
Block a user