Chunk: clean up nonsensical code in initChunk()

I have no idea why the extra check was there, or why the null assignment was used, because it doesn't make any sense.
This commit is contained in:
Dylan K. Taylor 2019-12-01 21:14:23 +00:00
parent fee3c17148
commit 17037f5e9c

View File

@ -694,7 +694,7 @@ class Chunk{
public function initChunk(Level $level){
if(!$this->isInit){
$changed = false;
if($this->NBTentities !== null){
$level->timings->syncChunkLoadEntitiesTimer->startTiming();
foreach($this->NBTentities as $nbt){
if($nbt instanceof CompoundTag){
@ -716,6 +716,7 @@ class Chunk{
}
}
}
$this->NBTentities = [];
$level->timings->syncChunkLoadEntitiesTimer->stopTiming();
$level->timings->syncChunkLoadTileEntitiesTimer->startTiming();
@ -733,12 +734,9 @@ class Chunk{
}
}
$this->NBTtiles = [];
$level->timings->syncChunkLoadTileEntitiesTimer->stopTiming();
$this->NBTentities = null;
$this->NBTtiles = null;
}
$this->hasChanged = $changed;
$this->isInit = true;