Improve BlockFactory initialization performance

as expected, expanding data range unconditionally resulted in some performance issues ...
This commit is contained in:
Dylan K. Taylor
2022-06-27 15:37:05 +01:00
parent bedc9cf518
commit 0afb67be7d
75 changed files with 169 additions and 3 deletions

View File

@ -47,6 +47,8 @@ class SnowLayer extends Flowable implements Fallable{
protected int $layers = self::MIN_LAYERS;
public function getRequiredStateDataBits() : int{ return 3; }
protected function decodeState(BlockDataReader $r) : void{
$this->layers = $r->readBoundedInt(3, self::MIN_LAYERS - 1, self::MAX_LAYERS - 1) + 1;
}