pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.28k stars 1.56k forks source link

The block is not placed if you put it on an interactive block #4659

Closed Gaprix closed 2 years ago

Gaprix commented 2 years ago

Issue description

If you try to place a block on a block with which you can interact, then it will only be placed on the client side

Steps to reproduce the issue

  1. Place the door
  2. Take a block of stone in your hand
  3. Hold down the shift key
  4. Try putting a stone on the door
  5. The block is placed only on the client side

OS and versions

Plugins

none

Crashdump, backtrace or other files

https://youtu.be/cT-sz-PcUJw

dktapps commented 2 years ago

Can you test this in 4.0?

Gaprix commented 2 years ago

The bug is missing on version 4.0.2

dktapps commented 2 years ago

This is most likely caused by this change: 292827a311a8792718b6405975518ef923a47475

Gaprix commented 2 years ago

It's true

Gaprix commented 2 years ago

I found another consequence: https://youtu.be/ZxUycx6MXIw

dktapps commented 2 years ago

I've no idea what causes that.

ColinHDev commented 2 years ago

This is most likely caused by this change: 292827a

This is caused by sneaking not being registered by the server any longer. Therefore Player::isSneaking() will return false and the block interaction will take place. https://github.com/pmmp/PocketMine-MP/blob/next-minor/src/world/World.php#L1809