mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBoundingBox() : ?AxisAlignedBB{
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCollisionBoxes() : array{
|
protected function recalculateCollisionBoxes() : array{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -671,7 +671,7 @@ class Block{
|
|||||||
/**
|
/**
|
||||||
* @return AxisAlignedBB[]
|
* @return AxisAlignedBB[]
|
||||||
*/
|
*/
|
||||||
public function getCollisionBoxes() : array{
|
final public function getCollisionBoxes() : array{
|
||||||
if($this->collisionBoxes === null){
|
if($this->collisionBoxes === null){
|
||||||
$this->collisionBoxes = $this->recalculateCollisionBoxes();
|
$this->collisionBoxes = $this->recalculateCollisionBoxes();
|
||||||
foreach($this->collisionBoxes as $bb){
|
foreach($this->collisionBoxes as $bb){
|
||||||
@ -696,7 +696,7 @@ class Block{
|
|||||||
/**
|
/**
|
||||||
* @return AxisAlignedBB|null
|
* @return AxisAlignedBB|null
|
||||||
*/
|
*/
|
||||||
public function getBoundingBox() : ?AxisAlignedBB{
|
final public function getBoundingBox() : ?AxisAlignedBB{
|
||||||
if($this->boundingBox === null){
|
if($this->boundingBox === null){
|
||||||
$this->boundingBox = $this->recalculateBoundingBox();
|
$this->boundingBox = $this->recalculateBoundingBox();
|
||||||
if($this->boundingBox !== null){
|
if($this->boundingBox !== null){
|
||||||
|
@ -74,7 +74,7 @@ class NetherPortal extends Transparent{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBoundingBox() : ?AxisAlignedBB{
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user