Make use of new API method getChunkAtPosition()

This commit is contained in:
Dylan K. Taylor
2018-10-20 15:58:29 +01:00
parent d9ebe6f321
commit 9f8a2dc61a
2 changed files with 3 additions and 3 deletions

View File

@ -1554,7 +1554,7 @@ class Level implements ChunkManager, Metadatable{
$this->timings->setBlock->startTiming();
if($this->getChunk($pos->x >> 4, $pos->z >> 4, true)->setBlock($pos->x & 0x0f, $pos->y, $pos->z & 0x0f, $block->getId(), $block->getDamage())){
if($this->getChunkAtPosition($pos, true)->setBlock($pos->x & 0x0f, $pos->y, $pos->z & 0x0f, $block->getId(), $block->getDamage())){
if(!($pos instanceof Position)){
$pos = $this->temporalPosition->setComponents($pos->x, $pos->y, $pos->z);
}
@ -2859,7 +2859,7 @@ class Level implements ChunkManager, Metadatable{
$max = $this->worldHeight;
$v = $spawn->floor();
$chunk = $this->getChunk($v->x >> 4, $v->z >> 4, false);
$chunk = $this->getChunkAtPosition($v, false);
$x = (int) $v->x;
$z = (int) $v->z;
if($chunk !== null and $chunk->isGenerated()){