From 4e9c3e101d69fa979915ee820592d8020e0c52fa Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 12 Jan 2023 19:42:33 +0000 Subject: [PATCH] Bell: fixed blocks not being able to be placed when not ringing the bell --- src/block/Bell.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/block/Bell.php b/src/block/Bell.php index 70c78d027..4af738d59 100644 --- a/src/block/Bell.php +++ b/src/block/Bell.php @@ -161,21 +161,20 @@ final class Bell extends Transparent{ public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ if($player !== null){ $faceHit = Facing::opposite($player->getHorizontalFacing()); - if($this->attachmentType->equals(BellAttachmentType::CEILING())){ - $this->ring($faceHit); - } - if($this->attachmentType->equals(BellAttachmentType::FLOOR()) && Facing::axis($faceHit) === Facing::axis($this->facing)){ - $this->ring($faceHit); - } if( - ($this->attachmentType->equals(BellAttachmentType::ONE_WALL()) || $this->attachmentType->equals(BellAttachmentType::TWO_WALLS())) && - ($faceHit === Facing::rotateY($this->facing, false) || $faceHit === Facing::rotateY($this->facing, true)) + $this->attachmentType->equals(BellAttachmentType::CEILING()) || + ($this->attachmentType->equals(BellAttachmentType::FLOOR()) && Facing::axis($faceHit) === Facing::axis($this->facing)) || + ( + ($this->attachmentType->equals(BellAttachmentType::ONE_WALL()) || $this->attachmentType->equals(BellAttachmentType::TWO_WALLS())) && + ($faceHit === Facing::rotateY($this->facing, false) || $faceHit === Facing::rotateY($this->facing, true)) + ) ){ $this->ring($faceHit); + return true; } } - return true; + return false; } public function ring(int $faceHit) : void{