Clean up ID flattening hacks

This commit is contained in:
Dylan K. Taylor
2019-02-21 10:38:29 +00:00
parent 89fce7712a
commit 635fb5dde4
59 changed files with 231 additions and 212 deletions

View File

@ -44,10 +44,10 @@ class FenceGate extends Transparent{
return Bearing::fromFacing($this->facing) | ($this->open ? 0x04 : 0) | ($this->inWall ? 0x08 : 0);
}
public function readStateFromMeta(int $meta) : void{
$this->facing = BlockDataValidator::readLegacyHorizontalFacing($meta & 0x03);
$this->open = ($meta & 0x04) !== 0;
$this->inWall = ($meta & 0x08) !== 0;
public function readStateFromData(int $id, int $stateMeta) : void{
$this->facing = BlockDataValidator::readLegacyHorizontalFacing($stateMeta & 0x03);
$this->open = ($stateMeta & 0x04) !== 0;
$this->inWall = ($stateMeta & 0x08) !== 0;
}
public function getStateBitmask() : int{