DeadBush: updated support requirements

since 1.20 they can now be placed on grass and mud.
This commit is contained in:
Dylan K. Taylor 2023-09-08 16:41:06 +01:00
parent d7f69c5e24
commit efafc2c6ca
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -66,13 +66,19 @@ class DeadBush extends Flowable{
}
private function canBeSupportedBy(Block $block) : bool{
$blockId = $block->getTypeId();
return $blockId === BlockTypeIds::SAND
|| $blockId === BlockTypeIds::RED_SAND
|| $blockId === BlockTypeIds::PODZOL
|| $blockId === BlockTypeIds::MYCELIUM
|| $blockId === BlockTypeIds::DIRT
|| $blockId === BlockTypeIds::HARDENED_CLAY
|| $blockId === BlockTypeIds::STAINED_CLAY;
return
$block->hasTypeTag(BlockTypeTags::SAND) ||
$block->hasTypeTag(BlockTypeTags::MUD) ||
match($block->getTypeId()){
//can't use DIRT tag here because it includes farmland
BlockTypeIds::PODZOL,
BlockTypeIds::MYCELIUM,
BlockTypeIds::DIRT,
BlockTypeIds::GRASS,
BlockTypeIds::HARDENED_CLAY,
BlockTypeIds::STAINED_CLAY => true,
//TODO: moss block
default => false,
};
}
}