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

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