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

@ -516,7 +516,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
$this->boundingBox = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
$this->recalculateBoundingBox();
$this->chunk = $this->level->getChunk($this->getFloorX() >> 4, $this->getFloorZ() >> 4, false);
$this->chunk = $this->level->getChunkAtPosition($this, false);
if($this->chunk === null){
throw new \InvalidStateException("Cannot create entities in unloaded chunks");
}