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

@ -29,14 +29,9 @@ use pocketmine\block\utils\DyeColor;
class DyedCandle extends Candle{
use ColoredTrait;
public function __construct(BlockIdentifier $idInfo, string $name, BlockTypeInfo $typeInfo){
$this->color = DyeColor::WHITE();
parent::__construct($idInfo, $name, $typeInfo);
}
protected function getCandleIfCompatibleType(Block $block) : ?Candle{
$result = parent::getCandleIfCompatibleType($block);
//different coloured candles can't be combined in the same block
return $result instanceof DyedCandle && $result->color->equals($this->color) ? $result : null;
return $result instanceof DyedCandle && $result->color === $this->color ? $result : null;
}
}