mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
LightPopulationTask: Don't overwrite the whole chunk on completion
this is more efficient (less data copied for ITC), fixes #2873, and also fixes terrain changes during task run getting overwritten. This still leaves the problem that the light information provided may be out of date by the time the task completes, but this is nonetheless a step forward.
This commit is contained in:
@ -620,6 +620,17 @@ class Chunk{
|
||||
return $this->heightMap->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $values
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function setHeightMapArray(array $values) : void{
|
||||
if(count($values) !== 256){
|
||||
throw new \InvalidArgumentException("Expected exactly 256 values");
|
||||
}
|
||||
$this->heightMap = \SplFixedArray::fromArray($values);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
Reference in New Issue
Block a user