mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
RuntimeDataDescriber: Introduce boundedIntAuto, replacing boundedInt
closes #6096 boundedIntAuto automatically calculates the correct number of bits to use based on the given bounds. The bounds must be constant, of course.
This commit is contained in:
@ -38,7 +38,7 @@ abstract class FillableCauldron extends Transparent{
|
||||
private int $fillLevel = self::MIN_FILL_LEVEL;
|
||||
|
||||
protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
|
||||
$w->boundedInt(3, self::MIN_FILL_LEVEL, self::MAX_FILL_LEVEL, $this->fillLevel);
|
||||
$w->boundedIntAuto(self::MIN_FILL_LEVEL, self::MAX_FILL_LEVEL, $this->fillLevel);
|
||||
}
|
||||
|
||||
public function getFillLevel() : int{ return $this->fillLevel; }
|
||||
|
Reference in New Issue
Block a user