mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 00:25:04 +00:00
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:
@ -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");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user