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

@ -53,8 +53,8 @@ class Lever extends Flowable{
return $rotationMeta | ($this->powered ? 0x08 : 0);
}
public function readStateFromMeta(int $meta) : void{
$rotationMeta = $meta & 0x07;
public function readStateFromData(int $id, int $stateMeta) : void{
$rotationMeta = $stateMeta & 0x07;
if($rotationMeta === 5 or $rotationMeta === 6){
$this->position = self::TOP;
$this->facing = $rotationMeta === 5 ? Facing::SOUTH : Facing::EAST;
@ -66,7 +66,7 @@ class Lever extends Flowable{
$this->facing = BlockDataValidator::readHorizontalFacing(6 - $rotationMeta);
}
$this->powered = ($meta & 0x08) !== 0;
$this->powered = ($stateMeta & 0x08) !== 0;
}
public function getStateBitmask() : int{