mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Boat: use BoatType enum instead of TreeType
TreeType really belongs in the generator package. Not all types of tree may have their own boat type (e.g. azalea). We can't use WoodType for this either, because some types of wood also don't have associated boat types (crimson, warped).
This commit is contained in:
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace pocketmine\item;
|
||||
|
||||
use pocketmine\block\utils\RecordType;
|
||||
use pocketmine\block\utils\TreeType;
|
||||
use pocketmine\block\VanillaBlocks;
|
||||
use pocketmine\block\VanillaBlocks as Blocks;
|
||||
use pocketmine\entity\Entity;
|
||||
@ -539,15 +538,15 @@ final class VanillaItems{
|
||||
self::register("writable_book", new WritableBook(new IID(Ids::WRITABLE_BOOK), "Book & Quill"));
|
||||
self::register("written_book", new WrittenBook(new IID(Ids::WRITTEN_BOOK), "Written Book"));
|
||||
|
||||
foreach(TreeType::getAll() as $type){
|
||||
//TODO: tree type should be dynamic in the future, but we're staying static for now for the sake of consistency
|
||||
foreach(BoatType::getAll() as $type){
|
||||
//boat type is static, because different types of wood may have different properties
|
||||
self::register($type->name() . "_boat", new Boat(new IID(match($type){
|
||||
TreeType::OAK() => Ids::OAK_BOAT,
|
||||
TreeType::SPRUCE() => Ids::SPRUCE_BOAT,
|
||||
TreeType::BIRCH() => Ids::BIRCH_BOAT,
|
||||
TreeType::JUNGLE() => Ids::JUNGLE_BOAT,
|
||||
TreeType::ACACIA() => Ids::ACACIA_BOAT,
|
||||
TreeType::DARK_OAK() => Ids::DARK_OAK_BOAT,
|
||||
BoatType::OAK() => Ids::OAK_BOAT,
|
||||
BoatType::SPRUCE() => Ids::SPRUCE_BOAT,
|
||||
BoatType::BIRCH() => Ids::BIRCH_BOAT,
|
||||
BoatType::JUNGLE() => Ids::JUNGLE_BOAT,
|
||||
BoatType::ACACIA() => Ids::ACACIA_BOAT,
|
||||
BoatType::DARK_OAK() => Ids::DARK_OAK_BOAT,
|
||||
default => throw new AssumptionFailedError("Unhandled tree type " . $type->name())
|
||||
}), $type->getDisplayName() . " Boat", $type));
|
||||
}
|
||||
|
Reference in New Issue
Block a user