Door: fix deserialization of top flag

it's not clear what bugs this caused, if any, but nonetheless it is incorrect.
This commit is contained in:
Dylan K. Taylor 2019-12-03 21:04:04 +00:00
parent 962e6162eb
commit f302517a2d

View File

@ -58,7 +58,7 @@ class Door extends Transparent{
}
public function readStateFromData(int $id, int $stateMeta) : void{
$this->top = $stateMeta & BlockLegacyMetadata::DOOR_FLAG_TOP;
$this->top = ($stateMeta & BlockLegacyMetadata::DOOR_FLAG_TOP) !== 0;
if($this->top){
$this->hingeRight = ($stateMeta & BlockLegacyMetadata::DOOR_TOP_FLAG_RIGHT) !== 0;
$this->powered = ($stateMeta & BlockLegacyMetadata::DOOR_TOP_FLAG_POWERED) !== 0;