mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-17 08:54:22 +00:00
Bell: fixed blocks not being able to be placed when not ringing the bell
This commit is contained in:
parent
d295e1be54
commit
4e9c3e101d
@ -161,21 +161,20 @@ final class Bell extends Transparent{
|
|||||||
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
||||||
if($player !== null){
|
if($player !== null){
|
||||||
$faceHit = Facing::opposite($player->getHorizontalFacing());
|
$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(
|
if(
|
||||||
($this->attachmentType->equals(BellAttachmentType::ONE_WALL()) || $this->attachmentType->equals(BellAttachmentType::TWO_WALLS())) &&
|
$this->attachmentType->equals(BellAttachmentType::CEILING()) ||
|
||||||
($faceHit === Facing::rotateY($this->facing, false) || $faceHit === Facing::rotateY($this->facing, true))
|
($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);
|
$this->ring($faceHit);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ring(int $faceHit) : void{
|
public function ring(int $faceHit) : void{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user