From b25e8e26f0cf5cf16897215e7dbb654f537f561a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 12 Jan 2023 21:31:50 +0000 Subject: [PATCH] BaseBanner: fixed incorrect support requirements --- src/block/BaseBanner.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/block/BaseBanner.php b/src/block/BaseBanner.php index 5b3f9acce9..400b8a78ed 100644 --- a/src/block/BaseBanner.php +++ b/src/block/BaseBanner.php @@ -112,7 +112,14 @@ abstract class BaseBanner extends Transparent{ return SupportType::NONE(); } + private function canBeSupportedBy(Block $block) : bool{ + return $block->isSolid(); + } + public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ + if(!$this->canBeSupportedBy($blockReplace->getSide($this->getSupportingFace()))){ + return false; + } if($item instanceof ItemBanner){ $this->color = $item->getColor(); $this->setPatterns($item->getPatterns()); @@ -124,7 +131,7 @@ abstract class BaseBanner extends Transparent{ abstract protected function getSupportingFace() : int; public function onNearbyBlockChange() : void{ - if($this->getSide($this->getSupportingFace())->getId() === BlockLegacyIds::AIR){ + if(!$this->canBeSupportedBy($this->getSide($this->getSupportingFace()))){ $this->position->getWorld()->useBreakOn($this->position); } }