RuntimeBlockMapping is now a singleton instead of static class

this prepares for a fully dynamic block mapper, as well as allowing a small performance improvement to chunk encoding by eliding the constant lazy-init checks.
This commit is contained in:
Dylan K. Taylor
2020-04-23 21:09:58 +01:00
parent f3fed60d57
commit aa1828aa98
4 changed files with 34 additions and 36 deletions

View File

@ -111,7 +111,7 @@ class Block{
* @internal
*/
public function getRuntimeId() : int{
return RuntimeBlockMapping::toStaticRuntimeId($this->getId(), $this->getMeta());
return RuntimeBlockMapping::getInstance()->toStaticRuntimeId($this->getId(), $this->getMeta());
}
public function getMeta() : int{