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

@ -38,6 +38,10 @@ class Trapdoor extends Transparent{
}
public function getBoundingBox(){
if($this->boundingBox !== null){
return $this->boundingBox;
}
$damage = $this->getDamage();
$f = 0.1875;
@ -104,7 +108,7 @@ class Trapdoor extends Transparent{
}
}
return $bb;
return $this->boundingBox = $bb;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){