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

@ -46,8 +46,12 @@ class WoodSlab 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,
@ -56,7 +60,7 @@ class WoodSlab extends Transparent{
$this->z + 1
);
}else{
return new AxisAlignedBB(
return $this->boundingBox = new AxisAlignedBB(
$this->x,
$this->y,
$this->z,