World: remove create params from loadChunk() and loadChunkAtPosition()

This commit is contained in:
Dylan K. Taylor
2020-12-03 18:49:14 +00:00
parent a67f0d1f75
commit 999defd20d
2 changed files with 19 additions and 25 deletions

View File

@ -243,7 +243,7 @@ abstract class Entity{
$this->boundingBox = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
$this->recalculateBoundingBox();
$this->chunk = $this->getWorld()->getOrLoadChunkAtPosition($this->location, false);
$this->chunk = $this->getWorld()->getOrLoadChunkAtPosition($this->location);
if($this->chunk === null){
throw new \InvalidStateException("Cannot create entities in unloaded chunks");
}
@ -1366,7 +1366,7 @@ abstract class Entity{
if($this->chunk !== null){
$this->chunk->removeEntity($this);
}
$this->chunk = $this->getWorld()->loadChunk($chunkX, $chunkZ, false);
$this->chunk = $this->getWorld()->loadChunk($chunkX, $chunkZ);
if($this->chunk === null){
//TODO: this is a non-ideal solution for a hard problem
//when this happens the entity won't be tracked by any chunk, so we can't have it hanging around in memory