All types of coral now have fully dynamic types

This commit is contained in:
Dylan K. Taylor
2021-05-19 22:49:44 +01:00
parent 69fa8e8db7
commit af678f985d
11 changed files with 161 additions and 96 deletions

View File

@ -26,7 +26,6 @@ namespace pocketmine\block;
use pocketmine\block\BlockIdentifier as BID;
use pocketmine\block\BlockLegacyIds as Ids;
use pocketmine\block\tile\Sign as TileSign;
use pocketmine\block\utils\CoralType;
use pocketmine\block\utils\DyeColor;
use pocketmine\block\utils\TreeType;
use pocketmine\item\ItemIds;
@ -244,17 +243,6 @@ final class BlockLegacyIdHelper{
if($id === null){
throw new \InvalidArgumentException("Stone slab type should be 1, 2, 3 or 4");
}
return new BlockIdentifierFlattened($id[0], $id[1], $meta);
}
public static function getWallCoralFanIdentifier(CoralType $type) : BlockIdentifier{
switch($type->id()){
case CoralType::TUBE()->id(): return new BID(Ids::CORAL_FAN_HANG, 0, ItemIds::CORAL_FAN);
case CoralType::BRAIN()->id(): return new BID(Ids::CORAL_FAN_HANG, 1, ItemIds::CORAL_FAN);
case CoralType::BUBBLE()->id(): return new BID(Ids::CORAL_FAN_HANG2, 0, ItemIds::CORAL_FAN);
case CoralType::FIRE()->id(): return new BID(Ids::CORAL_FAN_HANG2, 1, ItemIds::CORAL_FAN);
case CoralType::HORN()->id(): return new BID(Ids::CORAL_FAN_HANG3, 0, ItemIds::CORAL_FAN);
}
throw new AssumptionFailedError("Switch should cover all coral types");
return new BlockIdentifierFlattened($id[0], [$id[1]], $meta);
}
}