mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
AgeableTrait: fixed incorrect number of bits
the original method breaks if MAX_AGE is 0 or any power of 2.
This commit is contained in:
parent
31cd096b4b
commit
fe543a4789
@ -35,7 +35,7 @@ trait AgeableTrait{
|
||||
protected int $age = 0;
|
||||
|
||||
protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
|
||||
$w->boundedInt((int) ceil(log(self::MAX_AGE, 2)), 0, self::MAX_AGE, $this->age);
|
||||
$w->boundedInt(((int) log(self::MAX_AGE, 2)) + 1, 0, self::MAX_AGE, $this->age);
|
||||
}
|
||||
|
||||
public function getAge() : int{ return $this->age; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user