pmmp / PocketMine-MP

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

BlockPlaceEvent block doesn't have the meta value it would have when placed #1760

Closed dktapps closed 1 year ago

dktapps commented 6 years ago

Issue description

In effect, BlockPlaceEvent->getBlock() might as well simply alias to BlockPlaceEvent->getItem()->getBlock() since the resulting set block is unknown before Block->place() is called.

This requires a separation of logic of the block meta determination code from the actual setting the block into the world.

OS and versions

Plugins

This is an API issue.

dktapps commented 5 years ago

This is planned to be fixed for 4.0.

dktapps commented 2 years ago

This can be addressed by using the resulting BlockTransaction produced by Block->place(). Also, it might be a good idea to provide the transaction to BlockPlaceEvent directly so that plugins can properly understand stuff like bed placement.