mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
Fixed #3093
This commit is contained in:
parent
f7e6246dc2
commit
b856e5e909
@ -580,6 +580,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
return $this->port;
|
||||
}
|
||||
|
||||
public function getNextPosition(){
|
||||
return $this->newPosition !== null ? new Position($this->newPosition->x, $this->newPosition->y, $this->newPosition->z, $this->level) : $this->getPosition();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -1637,6 +1637,15 @@ class Level implements ChunkManager, Metadatable{
|
||||
++$realCount;
|
||||
}
|
||||
|
||||
if($player !== null){
|
||||
if(($diff = $player->getNextPosition()->subtract($player->getPosition())) and $diff->lengthSquared() > 0.00001){
|
||||
$bb = $player->getBoundingBox()->getOffsetBoundingBox($diff->x, $diff->y, $diff->z);
|
||||
if($hand->getBoundingBox()->intersectsWith($bb)){
|
||||
++$realCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($realCount > 0){
|
||||
return false; //Entity in block
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user