mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 05:34:54 +00:00
Block->getBoundingBox() and Block->getCollisionBoxes() are now final
Force usage of Block->recalculateBoundingBox() and Block->recalculateCollisionBoxes()
This commit is contained in:
parent
6dd1cdc413
commit
e29ac514d7
@ -50,11 +50,11 @@ class Air extends Transparent{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getBoundingBox() : ?AxisAlignedBB{
|
||||
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getCollisionBoxes() : array{
|
||||
protected function recalculateCollisionBoxes() : array{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@ -671,7 +671,7 @@ class Block{
|
||||
/**
|
||||
* @return AxisAlignedBB[]
|
||||
*/
|
||||
public function getCollisionBoxes() : array{
|
||||
final public function getCollisionBoxes() : array{
|
||||
if($this->collisionBoxes === null){
|
||||
$this->collisionBoxes = $this->recalculateCollisionBoxes();
|
||||
foreach($this->collisionBoxes as $bb){
|
||||
@ -696,7 +696,7 @@ class Block{
|
||||
/**
|
||||
* @return AxisAlignedBB|null
|
||||
*/
|
||||
public function getBoundingBox() : ?AxisAlignedBB{
|
||||
final public function getBoundingBox() : ?AxisAlignedBB{
|
||||
if($this->boundingBox === null){
|
||||
$this->boundingBox = $this->recalculateBoundingBox();
|
||||
if($this->boundingBox !== null){
|
||||
|
@ -74,7 +74,7 @@ class NetherPortal extends Transparent{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getBoundingBox() : ?AxisAlignedBB{
|
||||
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user