Implemented coral and coral fans

this implementation is very rough due to having to hack around lots more MCPE bullshit, and currently doesn't allow dynamic coral types; but it's there. We'll clean this up after 1.13 migration is done.
This commit is contained in:
Dylan K. Taylor
2021-04-17 02:04:10 +01:00
parent d5e1b4bd39
commit a32eb4ebc3
9 changed files with 389 additions and 7 deletions

View File

@ -26,6 +26,7 @@ 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;
@ -227,4 +228,15 @@ final class BlockLegacyIdHelper{
}
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");
}
}