mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 07:39:42 +00:00
Migrate all but two remaining legacy enums to native PHP 8.1 enums
This commit is contained in:
@@ -40,7 +40,7 @@ class Banner extends ItemBlockWallOrFloor{
|
||||
public const TAG_PATTERN_COLOR = TileBanner::TAG_PATTERN_COLOR;
|
||||
public const TAG_PATTERN_NAME = TileBanner::TAG_PATTERN_NAME;
|
||||
|
||||
private DyeColor $color;
|
||||
private DyeColor $color = DyeColor::BLACK;
|
||||
|
||||
/**
|
||||
* @var BannerPatternLayer[]
|
||||
@@ -48,11 +48,6 @@ class Banner extends ItemBlockWallOrFloor{
|
||||
*/
|
||||
private array $patterns = [];
|
||||
|
||||
public function __construct(ItemIdentifier $identifier, Block $floorVariant, Block $wallVariant){
|
||||
parent::__construct($identifier, $floorVariant, $wallVariant);
|
||||
$this->color = DyeColor::BLACK();
|
||||
}
|
||||
|
||||
public function getColor() : DyeColor{
|
||||
return $this->color;
|
||||
}
|
||||
@@ -102,7 +97,7 @@ class Banner extends ItemBlockWallOrFloor{
|
||||
if($patterns !== null && $patterns->getTagType() === NBT::TAG_Compound){
|
||||
/** @var CompoundTag $t */
|
||||
foreach($patterns as $t){
|
||||
$patternColor = $colorIdMap->fromInvertedId($t->getInt(self::TAG_PATTERN_COLOR)) ?? DyeColor::BLACK(); //TODO: missing pattern colour should be an error
|
||||
$patternColor = $colorIdMap->fromInvertedId($t->getInt(self::TAG_PATTERN_COLOR)) ?? DyeColor::BLACK; //TODO: missing pattern colour should be an error
|
||||
$patternType = $patternIdMap->fromId($t->getString(self::TAG_PATTERN_NAME));
|
||||
if($patternType === null){
|
||||
continue; //TODO: this should be an error
|
||||
|
Reference in New Issue
Block a user