Bamboo: fixed supporting block requirements (#5196)

This commit is contained in:
Colin 2022-08-14 18:37:55 +02:00 committed by GitHub
parent f1c571a528
commit bf4f6e5d53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -124,7 +124,11 @@ class Bamboo extends Transparent{
}
private function canBeSupportedBy(Block $block) : bool{
return $block->hasTypeTag(BlockTypeTags::DIRT) || $block->hasTypeTag(BlockTypeTags::MUD);
return
$block->getTypeId() === BlockTypeIds::GRAVEL ||
$block->hasTypeTag(BlockTypeTags::DIRT) ||
$block->hasTypeTag(BlockTypeTags::MUD) ||
$block->hasTypeTag(BlockTypeTags::SAND);
}
private function seekToTop() : Bamboo{

View File

@ -52,7 +52,11 @@ final class BambooSapling extends Flowable{
}
private function canBeSupportedBy(Block $block) : bool{
return $block->hasTypeTag(BlockTypeTags::DIRT) || $block->hasTypeTag(BlockTypeTags::MUD);
return
$block->getTypeId() === BlockTypeIds::GRAVEL ||
$block->hasTypeTag(BlockTypeTags::DIRT) ||
$block->hasTypeTag(BlockTypeTags::MUD) ||
$block->hasTypeTag(BlockTypeTags::SAND);
}
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{