Save block bounding boxes, improves block cache

This commit is contained in:
Shoghi Cervantes
2014-10-13 18:38:00 +02:00
parent 5448a48f67
commit 1eec333501
24 changed files with 113 additions and 39 deletions

View File

@ -43,7 +43,11 @@ class Cactus extends Transparent{
}
public function getBoundingBox(){
return new AxisAlignedBB(
if($this->boundingBox !== null){
return $this->boundingBox;
}
return $this->boundingBox = new AxisAlignedBB(
$this->x + 0.0625,
$this->y,
$this->z + 0.0625,