Merge branch 'master' into 0.10

This commit is contained in:
Shoghi Cervantes
2014-11-06 18:56:47 +01:00
6 changed files with 44 additions and 16 deletions

View File

@ -1366,13 +1366,10 @@ class Level implements ChunkManager, Metadatable{
if($pos instanceof Position and $pos->getLevel() !== $this){
return null;
}
$tiles = $this->getChunkTiles($pos->x >> 4, $pos->z >> 4);
if(count($tiles) > 0){
foreach($tiles as $tile){
if($tile->x === (int) $pos->x and $tile->y === (int) $pos->y and $tile->z === (int) $pos->z){
return $tile;
}
}
$chunk = $this->getChunk($pos->x >> 4, $pos->z >> 4);
if($chunk instanceof FullChunk){
return $chunk->getTile($pos->x & 0x0f, $pos->y & 0x7f, $pos->z & 0x0f);
}
return null;