Implemented Vector3 List and AxisAlignedBB Pool to decrease object allocation

This commit is contained in:
Shoghi Cervantes
2014-10-27 15:39:20 +01:00
parent be948f99cc
commit 7abf52e615
39 changed files with 273 additions and 223 deletions

View File

@ -58,7 +58,7 @@ class BlockIterator implements \Iterator{
$this->level = $level;
$this->maxDistance = (int) $maxDistance;
$startClone = clone $start;
$startClone = Vector3::createVector($start->x, $start->y, $start->z);
$startClone->y += $yOffset;
$this->currentDistance = 0;
@ -71,7 +71,7 @@ class BlockIterator implements \Iterator{
$secondPosition = 0;
$thirdPosition = 0;
$startBlock = $this->level->getBlock($startClone->floor());
$startBlock = $this->level->getBlock(Vector3::createVector($startClone->x, $startClone->y, $startClone->z)->floor());
if($this->getXLength($direction) > $mainDirection){
$this->mainFace = $this->getXFace($direction);