mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Improve BlockFactory initialization performance
as expected, expanding data range unconditionally resulted in some performance issues ...
This commit is contained in:
@ -51,6 +51,8 @@ class Anvil extends Transparent implements Fallable{
|
||||
return $this->damage << 2;
|
||||
}
|
||||
|
||||
public function getRequiredStateDataBits() : int{ return 4; }
|
||||
|
||||
protected function decodeState(BlockDataReader $r) : void{
|
||||
$this->setDamage($r->readBoundedInt(2, self::UNDAMAGED, self::VERY_DAMAGED));
|
||||
$this->setFacing($r->readHorizontalFacing());
|
||||
|
Reference in New Issue
Block a user