RuntimeBlockMapping: fixed palette cache never being initialized

I must have been very tired when I wrote this code
This commit is contained in:
Dylan K. Taylor 2020-06-17 21:33:56 +01:00
parent 333ed8ed2f
commit a686840e5e

View File

@ -161,6 +161,6 @@ final class RuntimeBlockMapping{
* @phpstan-return CacheableNbt<\pocketmine\nbt\tag\ListTag> * @phpstan-return CacheableNbt<\pocketmine\nbt\tag\ListTag>
*/ */
public function getStartGamePaletteCache() : CacheableNbt{ public function getStartGamePaletteCache() : CacheableNbt{
return $this->startGamePaletteCache ?? new CacheableNbt(new ListTag($this->bedrockKnownStates)); return $this->startGamePaletteCache ?? ($this->startGamePaletteCache = new CacheableNbt(new ListTag($this->bedrockKnownStates)));
} }
} }