WTF, ghost objects and why does this fix it? (and btw, fixes #2488)

This commit is contained in:
Shoghi Cervantes 2015-01-03 03:38:25 +01:00
parent 8e3667c95b
commit d207a5daea
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89
2 changed files with 3 additions and 2 deletions

View File

@ -987,6 +987,7 @@ class Block extends Position implements Metadatable{
$this->y = (int) $v->y; $this->y = (int) $v->y;
$this->z = (int) $v->z; $this->z = (int) $v->z;
$this->level = $v->level; $this->level = $v->level;
$this->boundingBox = null;
} }
/** /**
@ -1067,7 +1068,7 @@ class Block extends Position implements Metadatable{
if($this->boundingBox !== null){ if($this->boundingBox !== null){
return $this->boundingBox; return $this->boundingBox;
}else{ }else{
return $this->boundingBox = $this->recalculateBoundingBox(); return ($this->boundingBox = $this->recalculateBoundingBox());
} }
} }

View File

@ -565,7 +565,7 @@ class Item{
public function getBlock(){ public function getBlock(){
if($this->block instanceof Block){ if($this->block instanceof Block){
return $this->block; return clone $this->block;
}else{ }else{
return Block::get(self::AIR); return Block::get(self::AIR);
} }