mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Fixed getBlock() performance degradation caused by 781de3efab
, added Level->getBlockAt() to avoid creating vectors everywhere
This commit is contained in:
@ -2579,7 +2579,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
}
|
||||
|
||||
public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool{
|
||||
$block = $this->level->getBlock($this->temporalVector->setComponents($packet->blockX, $packet->blockY, $packet->blockZ));
|
||||
$block = $this->level->getBlockAt($packet->blockX, $packet->blockY, $packet->blockZ);
|
||||
|
||||
//TODO: this doesn't handle crops correctly (need more API work)
|
||||
$item = Item::get($block->getItemId(), $block->getVariant());
|
||||
|
Reference in New Issue
Block a user