Added Torch::setFacing() and Torch::getFacing()

these are not implemented with AnyFacingTrait because it would break LSP to have a setFacing that doesn't accept DOWN.
This commit is contained in:
Dylan K. Taylor 2021-02-06 22:31:36 +00:00
parent ce855f2133
commit 609b21679f
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -52,6 +52,17 @@ class Torch extends Flowable{
return 0b111;
}
public function getFacing() : int{ return $this->facing; }
/** @return $this */
public function setFacing(int $facing) : self{
if($facing === Facing::DOWN){
throw new \InvalidArgumentException("Torch may not face DOWN");
}
$this->facing = $facing;
return $this;
}
public function getLightLevel() : int{
return 14;
}