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

@ -48,8 +48,12 @@ class Slab extends Transparent{
}
public function getBoundingBox(){
if($this->boundingBox !== null){
return $this->boundingBox;
}
if(($this->meta & 0x08) > 0){
return new AxisAlignedBB(
return $this->boundingBox = new AxisAlignedBB(
$this->x,
$this->y + 0.5,
$this->z,
@ -58,7 +62,7 @@ class Slab extends Transparent{
$this->z + 1
);
}else{
return new AxisAlignedBB(
return $this->boundingBox = new AxisAlignedBB(
$this->x,
$this->y,
$this->z,