mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Block: specifying required type/state data bits is no longer required
RuntimeDataSizeCalculator allows calculating the number of required bits from describeType directly, which considerably reduces boilerplate code.
This commit is contained in:
@ -32,8 +32,6 @@ class FrostedIce extends Ice{
|
||||
|
||||
protected int $age = 0;
|
||||
|
||||
public function getRequiredStateDataBits() : int{ return 2; }
|
||||
|
||||
protected function describeState(RuntimeDataDescriber $w) : void{
|
||||
$w->boundedInt(2, 0, self::MAX_AGE, $this->age);
|
||||
}
|
||||
|
Reference in New Issue
Block a user