mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
remove World->isFullBlock(), add Block->isFullCube(), clean up some BB mess
This commit is contained in:
@ -46,6 +46,7 @@ use pocketmine\world\Position;
|
||||
use pocketmine\world\World;
|
||||
use function array_merge;
|
||||
use function assert;
|
||||
use function count;
|
||||
use function dechex;
|
||||
use const PHP_INT_MAX;
|
||||
|
||||
@ -713,6 +714,15 @@ class Block{
|
||||
return AxisAlignedBB::one();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isFullCube() : bool{
|
||||
$bb = $this->getCollisionBoxes();
|
||||
|
||||
return count($bb) === 1 and $bb[0]->getAverageEdgeLength() >= 1; //TODO: average length 1 != cube
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Vector3 $pos1
|
||||
* @param Vector3 $pos2
|
||||
|
Reference in New Issue
Block a user