From e29ac514d7d8e4fb6d3985652b7762e0f281c82b Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 15 Aug 2019 16:16:08 +0100 Subject: [PATCH] Block->getBoundingBox() and Block->getCollisionBoxes() are now final Force usage of Block->recalculateBoundingBox() and Block->recalculateCollisionBoxes() --- src/block/Air.php | 4 ++-- src/block/Block.php | 4 ++-- src/block/NetherPortal.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/block/Air.php b/src/block/Air.php index 88f4063f09..13b15513f8 100644 --- a/src/block/Air.php +++ b/src/block/Air.php @@ -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 []; } } diff --git a/src/block/Block.php b/src/block/Block.php index d5f1841804..b0a2f91427 100644 --- a/src/block/Block.php +++ b/src/block/Block.php @@ -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){ diff --git a/src/block/NetherPortal.php b/src/block/NetherPortal.php index acaca0ec3c..93f13bc274 100644 --- a/src/block/NetherPortal.php +++ b/src/block/NetherPortal.php @@ -74,7 +74,7 @@ class NetherPortal extends Transparent{ return false; } - public function getBoundingBox() : ?AxisAlignedBB{ + protected function recalculateBoundingBox() : ?AxisAlignedBB{ return null; }