Migrate all but two remaining legacy enums to native PHP 8.1 enums

This commit is contained in:
Dylan K. Taylor
2023-09-07 19:32:45 +01:00
parent ae564e445d
commit 94d98fb5c4
57 changed files with 1027 additions and 1086 deletions

View File

@ -48,11 +48,6 @@ class Bed extends Transparent{
protected bool $occupied = false;
protected bool $head = false;
public function __construct(BlockIdentifier $idInfo, string $name, BlockTypeInfo $typeInfo){
$this->color = DyeColor::RED();
parent::__construct($idInfo, $name, $typeInfo);
}
protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
$w->horizontalFacing($this->facing);
$w->bool($this->occupied);
@ -65,6 +60,8 @@ class Bed extends Transparent{
$tile = $this->position->getWorld()->getTile($this->position);
if($tile instanceof TileBed){
$this->color = $tile->getColor();
}else{
$this->color = DyeColor::RED; //legacy pre-1.1 beds don't have tiles
}
return $this;