Move TreeType to generator package, added dedicated SaplingType enum

TreeType includes a bunch of stuff that don't have regular saplings associated with them, such as mangrove and azalea trees.
Mangrove has a dedicated propagule block with different behaviour than the others, and azalea trees are grown from azalea blocks, which are solid and have different behaviour to saplings.

We may also want to account for crimson and warped 'trees' in TreeType too, although I'm not sure if those belong there or not.
This commit is contained in:
Dylan K. Taylor
2023-05-04 16:54:10 +01:00
parent 299ff5d912
commit 2c81446e5b
10 changed files with 97 additions and 24 deletions

View File

@ -55,7 +55,7 @@ use pocketmine\block\tile\ShulkerBox as TileShulkerBox;
use pocketmine\block\tile\Skull as TileSkull;
use pocketmine\block\tile\Smoker as TileSmoker;
use pocketmine\block\utils\LeavesType;
use pocketmine\block\utils\TreeType;
use pocketmine\block\utils\SaplingType;
use pocketmine\block\utils\WoodType;
use pocketmine\crafting\FurnaceType;
use pocketmine\entity\projectile\Projectile;
@ -1108,9 +1108,9 @@ final class VanillaBlocks{
});
$saplingTypeInfo = new Info(BreakInfo::instant(), [Tags::POTTABLE_PLANTS]);
foreach(TreeType::getAll() as $treeType){
$name = $treeType->getDisplayName();
self::register($treeType->name() . "_sapling", new Sapling(BlockLegacyIdHelper::getSaplingIdentifier($treeType), $name . " Sapling", $saplingTypeInfo, $treeType));
foreach(SaplingType::getAll() as $saplingType){
$name = $saplingType->getDisplayName();
self::register($saplingType->name() . "_sapling", new Sapling(BlockLegacyIdHelper::getSaplingIdentifier($saplingType), $name . " Sapling", $saplingTypeInfo, $saplingType));
}
foreach(LeavesType::getAll() as $leavesType){
$name = $leavesType->getDisplayName();